Files
docker-agent/examples/session_plan.yaml
T
Trung Nguyen 8135b54ae7 feat(session_plan): per-session markdown plan toolset alongside plan
Adds a session_plan toolset that complements the existing plan toolset:

  plan         shared, named, cross-session, multi-agent collaboration.
               write_plan(name, ...), read_plan(name), list_plans, ...
  session_plan one ephemeral markdown plan per session, addressed by
               session ID. write_session_plan(content),
               read_session_plan(), exit_plan_mode().

Distinct tool names so an agent can enable either or both without
collision. The toolset is a metadata stub; handlers live runtime-side
(pkg/runtime/sessionplan_handlers.go), wired into toolMap next to
handoff and transfer_task because they need the live session.Session.

exit_plan_mode is a marker — it validates the plan exists and returns
'Plan ready for review.' It does not switch agents or solicit user
approval. Routing the next turn is the host's concern: a CLI that
prints results inline, a chat UI with a mode toggle, and a server
with a configured handoff can all consume the same signal.

A session_plan_updated event is emitted on every successful
write_session_plan. Stale plan files (>30 days) are best-effort swept
once per process.
2026-06-30 09:29:13 +02:00

49 lines
1.8 KiB
YAML

# A two-agent "plan then execute" workflow.
#
# The user starts in `root`. Typing `/plan` switches to `planner`, which has
# read-only tools and the session_plan toolset. The planner investigates
# the request, writes the plan to <data-dir>/session_plans/<session-id>.md,
# and calls exit_plan_mode when ready — that signal tells the host the plan
# is final. Switching back to `root` for execution is up to the host
# (toggle, slash command, an explicit handoff on the agent, …); the tool
# itself does not move the conversation.
agents:
root:
model: anthropic/claude-sonnet-4-5
description: Executes plans the planner has handed off
instruction: |
You execute plans the planner has prepared. When you see a message
saying a plan has been approved, read it with read_session_plan and
work through its steps in order. For ambiguous or multi-file changes
that have not been planned yet, type `/plan <task>` first instead of
starting work directly.
toolsets:
- type: session_plan
tools:
- read_session_plan
- type: filesystem
- type: shell
commands:
plan:
description: "Switch to the planner"
agent: planner
planner:
model: anthropic/claude-sonnet-4-5
description: Investigates the request and writes a plan for user review
instruction: |
Investigate the user's request with read-only tools, then draft the
plan with write_session_plan. Iterate — re-read code, ask clarifying
questions with user_prompt — until the plan is complete. When the
plan is final, call exit_plan_mode to mark it ready for review.
Do not modify any files. The only write you may perform is
write_session_plan.
toolsets:
- type: session_plan
- type: filesystem
readonly: true
- type: fetch
- type: user_prompt