You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Delete the duplicated fallback system prompt once PromptAssembler is the only prompt path #1327
The agent's system prompt content exists in two places: the graph-seeded prompt nodes assembled by PromptAssembler, and a hardcoded fallback_system_prompt() that duplicates the same rules inline. The code comment on the fallback explicitly states it is an intentional, temporary duplication to be deleted once PromptAssembler is wired everywhere. This issue removes the duplication.
Problem Statement
fallback_system_prompt() in packages/agent/src/local_agent/prompt_templates.rs contains an inline copy of the TOOL STRATEGY / RESPONSE RULES content.
The canonical content lives in graph-seeded prompt nodes built by seed_prompt_nodes() and composed by PromptAssembler in packages/agent/src/prompt_assembler.rs.
The two can drift; the inline rules are an acknowledged stopgap (see the doc comment on fallback_system_prompt).
Proposed Solution
Confirm PromptAssembler is the only prompt-assembly path used in production (the agent loop selects: test override → graph assembler → fallback). Remove fallback_system_prompt() and its inline rule duplication. Retain only the minimal EMERGENCY_FALLBACK_PROMPT (in prompt_assembler.rs) for the corrupted/empty-database case, since that is a genuine safety net rather than a duplicate of the seeded rules.
Acceptance Criteria
Verified that production inference always uses PromptAssembler (no code path depends on fallback_system_prompt)
fallback_system_prompt() and its inline TOOL STRATEGY / RESPONSE RULES duplication are deleted
The minimal EMERGENCY_FALLBACK_PROMPT remains for the corrupted/empty-DB case
Any tests asserting on fallback_system_prompt are updated or removed appropriately
Code passes `bun run quality:fix`
Tests pass (`bun run test:all`)
Technical Specifications
Reference Files
Fallback to delete: `packages/agent/src/local_agent/prompt_templates.rs` (`fallback_system_prompt`)
Scoped to prompt assembly. It deletes a function in prompt_templates.rs and touches the fallback branch in agent_loop.rs. It does not change message types, the tool registry, or daemon wiring, so it runs in parallel with the related issues. Coordinate the small agent_loop.rs edit with concurrent work in that file.
Activity
ai-chat agent quality: fix runaway/hang + tool-call template leaks, t…
malibio commentedon Jun 5, 2026
Frontend baseline: 134 test files passed, 3844 tests passed.
Delete duplicated fallback system prompt; PromptAssembler is the only…
ai-chat agent quality: fix runaway/hang + tool-call template leaks, t…
Delete duplicated fallback system prompt; PromptAssembler is the only…