Files
deepseek-harness/packages/plan
Yichen Jiang 9d0c97b9d2 feat(tools): admit conditional tools per step
ctx.tools.register(definition, { when }) adds a synchronous or asynchronous
condition. AgentLoop resolves conditions once per proposed step with the
agent, the model selection that step preparation captured, and the turn
signal, before prompt assembly and agent/pre-step. The resulting
ResolvedToolSet governs tool declarations, Native dispatch, PTC bindings,
and nested calls for that step and its retries, and the turn disposes it
when the proposal is rejected or fails, when no step opens, and after the
step. A false condition removes the tool everywhere; a thrown condition
ends the turn with TOOL_ACTIVATION_FAILED. Calls whose registration was
replaced or removed during the step return UNKNOWN_TOOL.

system-prompt/assemble now transforms PromptPresentation without a tool
array, so tool declarations stay provider-owned. exit_plan_mode is declared
only for steps whose selected plan state is active, the same state that
renders plan guidance; it still rejects a call before the selection is
logged.

Model selection stays as master defines it; this change adds no model
selection event or Agent field.
2026-10-21 15:02:29 +08:00
..

description, kind
description kind
Package map for the plan group: the plan-mode feature that guides the agent to explore and design before executing, for users and maintainers navigating the group. package-group

plan/ — plan collaboration state

English | 中文

Summary

The plan/ group provides plan mode: while it is active, the agent explores and designs before executing, guided by instructions the deployment writes, and presents the finished plan for your approval before carrying it out. You can enter and leave plan mode with the /plan command and approve the plan or send the agent back to keep planning. Plan mode guides rather than restricts: every tool stays available, and limits such as sandbox mode and approval prompts are configured separately. The group contains one package, plan-mode.

Table of Contents


Packages

One package provides the whole plan-mode feature; the subsystem reference owns the exhaustive contracts.

Package Role ctx key
plan-mode/ Provides plan mode: /plan enters and leaves it, deployment guidance steers the agent while planning, and exit_plan_mode presents the finished plan for your review ctx.planMode

Start with the subsystem reference for the shared vocabulary, then read the design note for the decisions.

Dev Note

Working context for maintainers — click to expand

None.