Skip to content

Code agent: tool ergonomics, parallel execution, plan/discuss modes, explorer subagent#318

Merged
drp8226 merged 4 commits into
mainfrom
feat/code-agent-upgrades
Jun 13, 2026
Merged

Code agent: tool ergonomics, parallel execution, plan/discuss modes, explorer subagent#318
drp8226 merged 4 commits into
mainfrom
feat/code-agent-upgrades

Conversation

@rohitprasad15

Copy link
Copy Markdown
Collaborator

Upgrades the Code agent's harness across four commits:

  • Env/git context injected into the system prompt; line-numbered, windowed read_file; run_shell with sane timeouts, a description for approval prompts, tail-keeping truncation, and background tasks; low-risk tool calls in one turn now execute concurrently
  • Memory revision tools (memory_update/memory_forget) with when-to-remember guidance; plan mode with a propose_plan approval round-trip that flips the live session to execution; a read-only explore subagent that keeps broad research out of the main context
  • Plan mode wired through the server WS and GUI (PlanCard with approve/revise actions)
  • New Discuss mode: read-only conversation without the planning contract

Tests: 297 passing (60+ new). Plan/discuss flows also verified end-to-end in the browser GUI against a live model.

- Inject an environment block (cwd, platform, date, git snapshot) into the
  system prompt at engine build, saving discovery tool calls every session
- Replace the toolkit's read_file with a line-numbered, windowing reader
  that degrades gracefully on big files instead of raising
- run_shell: 120s default / 600s max timeout (was 30s), a description
  param surfaced in approval prompts, and truncation that keeps the tail
  of long output where test/build verdicts live
- Background tasks: run_shell(run_in_background) + shell_task_output /
  shell_task_kill for dev servers and long builds
- TurnEngine: low-risk tool calls in one assistant turn now execute
  concurrently; writes/shell stay strictly ordered
- Memory: memory_update/memory_forget tools, [#id]s in the injected
  known-memories block, and when-to-remember guidance in the prompt
- Plan mode: propose_plan tool (plan-mode sessions only) with an
  out-of-band approval round-trip; approval flips the live permission
  mode so the same session executes the plan, rejection returns the
  user's feedback; a per-turn reminder rides on the latest user message
- Explorer: explore tool on the Code agent spawns a read-only child
  TurnEngine (plan-mode permissions, no shell, no recursion) and
  returns only its final report, keeping the parent context small
- Engine: TOOL_PROPOSED is now emitted for intercepted interactive
  tools (request_directory) again, plus the new propose_plan path
- Server WS: plan_approver round-trip (plan_proposed event out,
  plan_response in), checkpointed like other parked-on-user events
- GUI: PlanCard renders the proposed plan as markdown with approve
  (ask-per-step or full access) and reject-with-feedback actions;
  resolved plans persist in the transcript

Verified end-to-end in the browser GUI against a scratch repo:
read-only exploration, plan proposal, feedback revision, and
approve-and-run with the live mode flip.
Read-only was conflated with plan mode: picking it pushed the agent
toward proposing a plan even when the user just wanted to talk safely.

- Mode.DISCUSS: same read-only enforcement as plan mode, but no
  planning contract — the agent explores and describes changes in
  chat instead of proposing them
- propose_plan is now always registered (the GUI flips a live
  session's mode via set_mode) and rejected outside plan mode, with
  a discuss-appropriate message
- GUI mode menu: Discuss / Plan / Ask for approval / Full access /
  Custom, ordered by how much the agent may do
@rohitprasad15 rohitprasad15 requested a review from drp8226 June 13, 2026 01:37
@rohitprasad15

Copy link
Copy Markdown
Collaborator Author
discuss-mode

@drp8226 drp8226 merged commit 68dfb3b into main Jun 13, 2026
8 checks passed
@drp8226 drp8226 deleted the feat/code-agent-upgrades branch June 13, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants