Phase 2: re-render system_prompt on :model switch (depends on Q9) #14
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
When the user runs
:model <name>mid-session, the active model config swaps butContext.system_promptdoes not. For Phase 0 this is fine — all models share the §6 default system prompt with theCMD:extraction contract.For Phase 2 (MCP), this becomes a real gap. Q9 (system-prompt augmentation locus) has three open answers:
broker.lua— same prompt regardless of model;:modelswap stays harmless.:modelswap MUST re-render the system prompt for the new model's schema.Where
repl.luameta:modelhandler. The handler currently setsactive_name, active_cfgand emits a status — does not touchctx.system_promptor otherwise notify the context.Resolution depends on
PHASE0.md §13 Q9. The fix shape is one of:
:modelswap, regeneratectx.system_promptby asking the new model's MCP layer for its tool schema and re-rendering the prompt. (per-request and hybrid options):modelswap during an active conversation forces a:resetof context. (heavy-handed but simple.)Surfaced by
Phase 5 review of commit range
7b5d586..a18e530(Phase 0 implementation).Labels
architecture(cross-phase concern).Closing as resolved by Q9 architecture choice.
Q9 was answered in
docs/PHASE2.md§3 row "System prompt augmentation" (and confirmed in §11 open-end resolution):Practical consequences:
DEFAULT_SYSTEM_PROMPTincontext.lua) is identical across all models — no per-model variation.to_messages()call regardless of model.toolsfield, computed fresh per ask_ai call viatools_schema()(repl.lua).So a
:modelswap doesn't need to re-renderctx.system_prompt— the static frame doesn't change, and the dynamic parts (tools, background, summary) refresh on every request anyway. The third resolution option in the issue body ("static option — no fix needed") applies.