feat(coding-agent): added todo batching guidance and armed prewalk when option is set

- Updated system and todo prompt templates to require batching todo tool calls with real action calls instead of sending them alone.
- Passed a new `prewalkArmed` session flag in `createAgentSession`, set from whether `prewalk` was supplied.
This commit is contained in:
can1357
2026-07-15 05:44:23 +02:00
parent d39b9fc1cb
commit b31eccbc21
4 changed files with 7 additions and 0 deletions
+4
View File
@@ -6,6 +6,10 @@
- Added per-agent prewalk for subagents: a `prewalk` frontmatter field (`true` = hand off to the default prewalk target, a string = custom target model pattern) and a `task.agentPrewalk` settings override toggled per agent from the `/agents` dashboard with `P`. The bundled generic `task` agent ships with prewalk enabled by default (skipped when the target resolves to the subagent's own starting model, and never armed for plan-mode spawns).
### Changed
- Batched todo operations with real tool calls to prevent solo todo turns and extra round trips
### Fixed
- Fixed Bash internal URLs remaining unresolved when used as unquoted arguments inside command substitutions ([#5535](https://github.com/can1357/oh-my-pi/issues/5535)).
@@ -193,6 +193,7 @@ EXECUTION WORKFLOW
# 3. Decompose
- Update todos as you go; skip them for trivial requests. Marking a todo done is a transition: start the next in the same turn.
- Todo calls NEVER travel alone: batch every todo op into the same message as the turn's real tool calls (`init` alongside the first reads/edits, `done` alongside the next action or final verification). An assistant turn whose only tool call is todo wastes a full round trip.
- Plan only what makes the request work. Cleanup—changelog, docs, removing scaffolding—is NOT planned up front; it belongs to the final phase below. Tests are cleanup only for permanent feature/bug-fix work (see Cleanup).
# 4. Implement
@@ -22,6 +22,7 @@ Completing tasks out of phase order can move this pointer **back** to an earlier
## Rules
- Mark tasks done immediately after finishing. Complete phases in order.
- NEVER make a todo call your turn's only tool call — batch it with the real work: `init` with the first reads/edits, each `done`/`start` with the next action. Solo todo turns waste a round trip.
- Blocked? `append` a task to the active phase, or `drop`.
- Keep `task`/`phase` strings stable once introduced.
- Lost the exact task text? `view` echoes the list — NEVER guess from memory.
+1
View File
@@ -1590,6 +1590,7 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
eventBus,
outputSchema: options.outputSchema,
requireYieldTool: options.requireYieldTool,
prewalkArmed: options.prewalk !== undefined,
taskDepth: options.taskDepth ?? 0,
getSessionFile: () => sessionManager.getSessionFile() ?? null,
getEvalKernelOwnerId: () => evalKernelOwnerId,