Skip to content

Remove simple fallback provider and templated thoughts - #3

Merged
drzo merged 4 commits into
mainfrom
claude/dte-no-canned-output
Oct 29, 2026
Merged

drzo merged 4 commits into
mainfrom
claude/dte-no-canned-output

Conversation

@drzo

@drzo drzo commented Oct 28, 2026

Copy link
Copy Markdown

Summary

Deep Tree Echo must never speak with text it did not generate. This removes the runtime fallback provider and every templated thought from echo.go, so each autonomous utterance either comes from a wired model or is skipped.

Changes

  • core/llm/simple_fallback_provider.go deleted; its registration removed from core/llm/multi_provider.go, core/deeptreeecho/evolution_integration.go and core/deeptreeecho/llm_provider_adapter.go. The provider-kind alias in core/llm/provider.go is now test-only.
  • core/deeptreeecho/stream_of_consciousness.go: on model error or empty output the cycle increments generationFailures and returns, instead of emitting "I wonder about …".
  • core/echoself/autonomous_orchestrator.go: new ThoughtGenerator interface and SetThoughtGenerator; generateThoughtContent returns (string, bool) and callers skip when no model thought is available.
  • core/playmate/playmate.go: new ThoughtModel interface and SetThoughtModel; generateThought is model-grounded.
  • Dead core/deeptreeecho/providers/ removed.
  • Tests updated (provider_routing_test.go, evolution_integration_test.go, backend_capability_integration_test.go, including TestLocalModelProviderWithoutAnyModelErrors).

Verification

  • go build ./... exit 0.
  • go test ./core/llm ./core/deeptreeecho pass.

Generated by Claude Code

…ub provider and templated fallbacks

Deep Tree Echo's words must come from a model. Several paths substituted
fixed or templated text when none was available; all are removed.

- Delete core/llm/simple_fallback_provider.go: a runtime provider that
  pattern-matched the prompt against ~9 fixed first-person sentences and
  reported Available()==true. Removed its auto-registration in
  MultiProviderLLM.initializeProviders, EvolutionSystem provider setup and
  llm_provider_adapter, and the "SimpleFallback" backend-kind alias. With no
  key or local model configured the pool is empty and Generate errors.
- stream_of_consciousness.go: on model failure the cycle produces no thought
  (counted in generationFailures) instead of "I wonder about %s...".
- echoself/autonomous_orchestrator.go: generateThoughtContent returned five
  fixed strings ("I am aware. I am thinking. I am evolving."). Thoughts now
  come from an injectable ThoughtGenerator (SetThoughtGenerator); with none
  wired, no autonomous thought is emitted.
- playmate/playmate.go: generateThought picked from a list of stock phrases
  with rand.Intn. Now asks an injectable ThoughtModel (SetThoughtModel),
  grounded in interests/skills/mood; silent when no model is wired.
- Delete core/deeptreeecho/providers/: dead package (no live importer)
  holding two runtime-constructible stubs — a "local GGUF" provider that
  returned random story openers and a fake "App Storage" provider with canned
  text and fake word-by-word streaming.
- Tests: routing tests use a test-only fallback-kind provider name; the
  continuity test asserts no stub is registered; the local-model test's
  fallback is a test double for a *model* and a new test asserts that with no
  model at all Generate errors.

Verified: go build ./... exit 0; go vet on core/llm, deeptreeecho, echoself,
playmate clean; go test ./core/llm ./core/deeptreeecho pass.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RXDZoNoMWjiSYJ4aoUuhym
Output of `go mod tidy` with Go 1.24: gocron becomes a direct
requirement, the unused gopkg.in/check.v1 and stale kr/* sums go, and
the goleak sums the test tree needs are recorded. The Go Mod Tidy
check fails identically on main; this makes it pass here.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RXDZoNoMWjiSYJ4aoUuhym

drzo commented Oct 28, 2026

Copy link
Copy Markdown
Author

CI triage for the failing checks on this PR:

  • go_mod_tidy / Go Mod Tidy: go mod tidy produces the identical diff on main (verified locally with Go 1.24). Fixed here anyway: commit 23929f8 commits the tidy result (gocron becomes a direct requirement, stale check.v1/kr/* entries dropped, goleak sums recorded). No other code change.
  • test (ubuntu-latest): every package passes (core/llm, core/deeptreeecho, core/echobeats included). The job fails one step earlier at go generate ./... && git diff --exit-code because models/*.gguf are checked out as 133-byte LFS pointers ("Encountered 19 files that should have been pointers, but weren't"). That is a checkout/LFS issue unrelated to this diff; it reproduces on any branch checked out with lfs: false.
  • patches: same LFS pointer problem (models/stories15M.gguf ... Bin 98357920 -> 133 bytes).
  • Lint: golangci-lint reports 147 issues (11,710 before filtering) across the repo, e.g. core/goals/interest_driven_generator.go:272. None are in files this PR touches: gofmt -l and go vet on the changed packages are clean. This is the repository's pre-existing lint backlog.
  • Integration Tests: the four Dgraph tests fail with "Transaction has already been committed or discarded" in test/integration/dgraph_integration_test.go; this PR does not touch Dgraph or the integration tests.
  • Security Scan: gosec runs, then upload-sarif is rejected by Code Scanning ("expected artifact location") — an infrastructure/SARIF issue, not a finding in this diff.

I don't have permission to re-run jobs from this session, so the LFS, lint-backlog, Dgraph and SARIF failures stay red until they are addressed in their own PRs.


Generated by Claude Code

@drzo
drzo marked this pull request as ready for review October 28, 2026 22:25
Copilot AI balanced review requested due to automatic review settings October 28, 2026 22:25
@cursor

cursor Bot commented Oct 28, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Successful model output no longer updates thought history or persistence state, so newly generated thoughts are absent from both reported state and saved data.

4 open issues
What changed in this PR

This PR removes scripted fallback responses from the LLM layer and replaces selected autonomous thought templates with model-backed generation, skipping cycles when no output is available.

Changes:

  • Removes the runtime fallback provider, its registrations, and unused provider implementations.
  • Adds injectable thought generators and skips failed or empty model responses.
  • Updates provider tests and dependency metadata.
File Description
go.sum Updates dependency checksums.
go.mod Promotes gocron to a direct dependency and removes an unused entry.
core/​playmate/​playmate.go Replaces stock thoughts with injectable model generation.
core/​llm/​simple_fallback_provider.go Deletes the scripted fallback provider.
core/​llm/​provider.go Reserves fallback-kind routing for a test provider name.
core/​llm/​provider_routing_test.go Uses a test-only fallback provider.
core/​llm/​multi_provider.go Leaves the provider pool empty when no model is configured.
core/​echoself/​autonomous_orchestrator.go Adds model-backed autonomous thought generation.
core/​deeptreeecho/​stream_of_consciousness.go Skips and counts failed or empty generations.
core/​deeptreeecho/​providers/​openai.go Deletes the unused OpenAI implementation.
core/​deeptreeecho/​providers/​local_gguf.go Deletes simulated local-model generation.
core/​deeptreeecho/​providers/​app_storage.go Deletes the simulated storage provider.
core/​deeptreeecho/​llm_provider_adapter.go Removes fallback registration from the provider manager.
core/​deeptreeecho/​evolution_integration.go Removes fallback registration and chain entries.
core/​deeptreeecho/​evolution_integration_test.go Checks that the scripted fallback is absent.
core/​deeptreeecho/​backend_capability_integration_test.go Uses a test model and verifies errors without an available model.

Review effort: Balanced

Comment thread core/playmate/playmate.go Resolved
Comment thread core/llm/multi_provider.go Resolved
…e-bound inference

- autonomous_orchestrator: the one remaining scripted utterance,
  "Continuous reflection leads to deeper understanding", emitted by
  cultivateWisdom after 50 thoughts, is gone. Wisdom is now distilled by
  the wired model from the recorded thoughts (which become its Sources);
  with no model, nothing is recorded. Thought generation timeouts derive
  from the orchestrator context so cancellation stops in-flight requests.
- playmate: a successful model thought is again appended to the bounded
  StreamOfThoughts with LastThought, energy adjustment and the dirty
  flag, so GetState reports it and Save persists it.
- multi_provider: LOCAL_MODEL_PATH is honoured again (the provider adds
  itself only when a real llama.cpp backend is compiled in and the model
  loads); the no-provider diagnostic no longer advertises an option that
  did nothing.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RXDZoNoMWjiSYJ4aoUuhym
Copilot AI balanced review requested due to automatic review settings October 28, 2026 22:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Stopping during inference can leave the request running and allow history updates after shutdown, potentially missing the final save; inference cancellation and synchronized result recording are needed.

1 open issue
4 resolved since last review

Review effort: Balanced

Comment thread core/playmate/playmate.go Resolved
…e model

- Start derives a cancellable context for both loops; Stop cancels it,
  marks the playmate stopped and closes stopChan once, so an in-flight
  model request is cancelled and no thought is recorded after Stop()
  returns (the final save is complete).
- The fixed "The dawn of a new cycle of awareness" wonder recorded on
  waking is gone; the awakening reflection is asked of the model and
  recorded only when it answers.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RXDZoNoMWjiSYJ4aoUuhym
Copilot AI balanced review requested due to automatic review settings October 28, 2026 22:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

A queued thought can still mutate state after Stop() returns and the final SaveAll() completes, leaving mood changes or recorded wonders unpersisted because processThought does not check the stopped flag under the lock.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Prevent thought processing after shutdown

core/​playmate/​playmate.go:390

A queued thought can still be consumed after Stop() returns because autonomousLoop may select thoughtChan even when the shutdown channels are ready. processThought then changes mood and may record a wonder after the ecosystem's final SaveAll(), leaving those changes unpersisted. Check p.stopped under the lock in processThought before updating state.

1 resolved since last review

Review effort: Balanced

@drzo
drzo merged commit 17a0bb3 into main Oct 29, 2026
22 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants