mirror of
https://github.com/deepseek-ai/deepseek-harness
synced 2026-08-15 21:04:50 +00:00
Review finding, valid: under the registry's Code Mode the assembly's only wire tool is run_code, which the plan allowlist filtered out — leaving the model with NO tools at all, the exit review included. The composition exists today (the acp-agent example ships a code-mode overlay), so plan mode bricked it outright. run_code is a transport, not a capability: every bridged sub-call is serialized back through ToolRegistry.execute() carrying the same agent, so tools/pre-execute judges each capability individually — exactly like native calls. Both layers now exempt it by name: the filter keeps it visible (tests pin plan-mode Code Mode assembly = ['run_code']) and the gate passes the wrapper while the same run's write sub-call still denies with the plan-mode reason. Documented residual, same class as the prepend-after-load one: the SDK section renders from the registry's store, so a plan-mode program may be offered bindings whose dispatch the gate then denies — nothing runs that a native call could not.
mode/ — session-mode policy family
Session modes: named, logged, per-agent policy states, with plan mode as the first shipped definition. A single product package — there is no interface/implementation seam here, because a mode's variable parts are config values (allowlist, section text), not swappable implementations.
| Package | Role | ctx key |
|---|---|---|
mode/ |
mode/set vocabulary + fold, the ctx.modes service (list/get/set with the turn-boundary flush), the soft layer (assemble filter + mode:policy section), the hard layer (tools/pre-execute deny-by-default gate), and the model-facing exit_plan_mode review tool |
ctx.modes |
The mode in force is a pure function of the session log (SessionEventMap['mode/set'], last one wins), so resume and fork restore it with no extra machinery; the default mode is the absence of policy, keeping the plugin invisible until a mode is set. UIs read flips off session/event: the stdio app exposes /mode, the ACP bridge maps the vocabulary to the session-mode picker. RFC: plan mode.