consciousness/src
Kent Overstreet 60de579305 config: unify subconscious API resolution with the main chat path
Two parallel backend-resolution paths had drifted apart:

- Main chat: AppConfig::resolve_model() → a named BackendConfig in
  AppConfig.backends
- Subconscious / oneshot / context_window(): four skip-serde
  "cache" fields on Config (memory section) — api_base_url, api_key,
  api_model, api_context_window — that used to be populated at
  Config::try_load_shared time by walking memory.agent_model →
  root.models[name] → root[backend_name]

When we renamed `models` to `backends` and collapsed ModelConfig into
BackendConfig, the latter chain started silently dereferencing
`root.get("models")` → None → no population. Subconscious agents fell
through the "API not configured" guard; context_window() started
returning 0 (since api_context_window default is u64's 0 now that we
don't populate it). It was only visibly working for the main chat.

Collapse to one path:

- Drop Config.agent_model (duplicate of AppConfig.default_backend)
- Drop Config.{api_base_url, api_key, api_model, api_context_window}
  — no longer populated, no longer needed
- Drop default_context_window() — nobody reads the field anymore
- Drop the memory-side resolution block in try_load_shared()
- Subconscious (mind/unconscious.rs) and oneshot (agent/oneshot.rs)
  now call load_app() + resolve_model(&app.default_backend) just like
  the main chat does
- context_window() reads from config::app().backends[default_backend]
  .context_window, defaulting to 128k only if the backend doesn't
  specify one

Side effect: Kent's config file drops agent_model, api_reasoning,
journal_days, journal_max — all fields whose Rust counterparts are
now gone. (Figment tolerates unknown fields, so leaving them wouldn't
have broken anything, but they were lying about what's configurable.)

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
2026-04-16 16:02:43 -04:00
..
agent config: unify subconscious API resolution with the main chat path 2026-04-16 16:02:43 -04:00
bin context: tighten timestamp schema; every AstNode has one 2026-04-16 12:35:16 -04:00
cli Simplify context config: personality_nodes and agent_nodes 2026-04-15 02:37:49 -04:00
hippocampus store: add weight to index, index-only key matching 2026-04-15 05:14:04 -04:00
learn rust edition 2024 2026-04-05 06:20:16 -04:00
mind config: unify subconscious API resolution with the main chat path 2026-04-16 16:02:43 -04:00
subconscious agent: phase-aware bail script for surface-observe concurrency 2026-04-16 15:41:28 -04:00
thalamus hours_since_last_dream: return 0 if dream in progress 2026-04-15 21:58:03 -04:00
user config: drop dead code and collapse to a single backend 2026-04-16 15:41:55 -04:00
config.rs config: unify subconscious API resolution with the main chat path 2026-04-16 16:02:43 -04:00
config_writer.rs config_writer: emit pretty multi-line sections, drop json5 crate 2026-04-16 13:08:19 -04:00
lib.rs config_writer: json5 round-trip editing via json-five 2026-04-16 11:48:47 -04:00
locks.rs locks: add process-wide lock hold time tracking 2026-04-12 20:27:42 -04:00
main.rs cli: add 'node restore' command for undeleting nodes 2026-04-15 01:40:29 -04:00
mcp_server.rs memory.rs: clean up store access and tool dispatch 2026-04-13 14:27:38 -04:00
session.rs delete claude code integration 2026-04-09 19:58:07 -04:00
util.rs delete 20 dead public functions across 12 files 2026-04-02 16:21:01 -04:00