Files
deepseek-harness/packages/mode
kingwl ac21ae0794 fix(mode): dedupe the boundary flush wrapper and cover its disposed branch
CI caught two gaps in the review-fix commit: the two post-next() flush
listeners were literal clones (jscpd), and the disposed-skip branch inside
them had no covering test. Extract one shared flushAfter wrapper and pin the
skip with a captured-continuation disposal test (a downstream listener
disposes the fiber mid-waterfall; the resumed wrapper appends nothing).
2026-07-22 10:12:09 +08:00
..
2026-07-21 11:43:54 +08:00

mode/ — session-mode policy family

Session modes: named, logged, per-agent collaboration 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 part is a config value (the section text), not a swappable implementation.

Package Role ctx key
mode/ mode/set vocabulary + fold, the ctx.modes service (list/get/set with the turn-boundary flush), the mode:policy guidance section, 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 deployment supplies plan instructions through Cordis config, while exit_plan_mode remains registered in every mode to keep the request tool catalog stable. UIs read flips off session/event; the ACP bridge maps the vocabulary to the session-mode picker, and a composed command registry gains the plugin-registered /mode command. Design: plan-mode Agent Note.