Expand description
Unified system-prompt assembly.
Every agent-loop entry point (CLI run / loop, HTTP API, TUI) calls
assemble_system_prompt to build the final system prompt from a
channel-prepared base. This is the single maintenance point for the
“common” prompt structure; channels only differ in how they source the
base (e.g. CLI --append-system-prompt, HTTP append_system_prompt
request field) and fold that into base before calling.
Layer order (stable → volatile, to maximise prefix-cache hits):
# Project context—AGENTS.md+CLAUDE.mdat workspace rootbase—default_system_prompt()+ 6 memory layers (already assembled inConfig::from_env) + any channelappend_system_prompt# Available skills—skill_index()## Sub-agents enabled+ sub-agent usage note — only whensub_agent_enabled(theAgenttool is registered in parallel bymulti::register_subagent_if_enabled)
Structs§
- Assembled
Prompt - Owned, structured view of an assembled system prompt.
- Prompt
Segments - Per-bucket substrings of an
AssembledPrompt. Each field is the exact text that contributes to that breakdown bucket; join order matchesAssembledPrompt::full.
Functions§
- assemble_
system_ prompt - Assemble the final system prompt for an agent run.