Description
Chat Modes and Source Controls let a user decide how the agent should behave and what knowledge it may use on a specific turn. Modes cover full execution, question answering, planning, broad research, and HUMAN.md building. Each mode contributes explicit prompt constraints and a default tool posture. Source controls independently enable or disable Memory Bank, selected Dotabases, web access, and connectors, with optional scope filters recorded on the sent user message.
The runtime resolves those choices before provider execution and renders them into stable prompt blocks. Disabled sources are named explicitly rather than disappearing, so the agent receives an honest boundary. The effective mode, filters, model, reasoning effort, and optional tool-posture override are snapshotted with the message, preserving what governed the answer even if conversation settings change later.
Selling Points
- Users can switch between acting, asking, planning, and researching without opening separate products or rewriting safety instructions.
- Per-turn source selection keeps sensitive or irrelevant knowledge out of a request while still allowing precise grounding.
- Explicit disabled-source declarations reduce model ambiguity about what it may consult.
- A tool-posture override gives users a direct read-only/full-action control when the selected local provider can enforce it.
- Stored snapshots make historical answers explainable because the transcript retains the controls active at send time.
User Story
A product lead needs a deployment plan but does not want the agent changing files. They select Plan mode, enable the relevant project Dotabase and Memory Bank, disable web access, and send the request. The agent receives read-only mode constraints plus the exact enabled-source list. The resulting user message retains those choices, so the lead can later see why the answer used internal decisions but no external research or write tools.
Extension Surface
This feature is configurable. packages/chat/src/types.ts exposes per-turn ContextFiltersEnvelope, model, reasoning-effort, and tool-posture values, while packages/chat/src/modes/definitions.ts supplies the fixed shipped mode registry. Users change behavior through these stored controls without code. Adding a new canonical mode still requires a code and contract change, so the feature is not externally pluggable.
Capabilities & Limits
- It applies one of five shipped modes with mode-specific prompt and tool constraints.
- It controls Memory Bank, Dotabase, web, and connector sources at turn grain.
- It snapshots filters and mode on the durable user message.
- Limit: source controls govern what the runtime offers; they do not grant access the actor lacks, and the set of canonical modes is closed.
Implementation Map
packages/chat/src/modes/definitions.tspackages/chat/src/modes/registry.tspackages/chat/src/dispatch/prompt-assembly.tspackages/chat/src/contracts/enabled-sources.tspackages/chat/src/types.ts