Summary
Some models (notably Kimi) do not reliably understand that ending a turn without a tool call is the correct way to wait. Instead, they invoke the bash tool to run echo "Waiting...", which consumes an extra full turn and wastes tokens. Adding an explicit wait tool gives these models a sanctioned no-op action that cleanly ends the turn.
Current Behavior
When an agent is told to wait (e.g., for a background subagent to complete), models may invent a useless bash call to simulate waiting. This costs tokens and adds noise to the session.
Proposed Behavior
A built-in wait tool that does nothing, returns immediately, and ends the agent's turn. Its description and prompt guidelines will explicitly tell the model: "If you are told to wait for something, use this tool instead of running a shell command."
Acceptance Criteria
Context
This is a pragmatic fix for model-specific behavior where certain providers prefer to "do something" rather than end a turn empty-handed. The wait tool is the hammer for that nail.
Technical Notes
- Pattern after
suggest-next.ts or tasks.ts for a lightweight tool definition
- No parameters needed — a
Type.Object({}) or Type.Object({ reason: Type.Optional(Type.String()) }) schema
- The tool
execute should return immediately with a simple confirmation text
- Keep render call/result minimal to avoid TUI noise
Risks / Considerations
- Models could over-use
wait if instructions are too broad. Guidelines should narrowly scope it to "when explicitly told to wait" and "when background subagents are running and you have no other work"
- Should this be opt-in via
--tools or always available? Probably always available since it is harmless, but it should appear in --tools restrictions
Summary
Some models (notably Kimi) do not reliably understand that ending a turn without a tool call is the correct way to wait. Instead, they invoke the
bashtool to runecho "Waiting...", which consumes an extra full turn and wastes tokens. Adding an explicitwaittool gives these models a sanctioned no-op action that cleanly ends the turn.Current Behavior
When an agent is told to wait (e.g., for a background subagent to complete), models may invent a useless
bashcall to simulate waiting. This costs tokens and adds noise to the session.Proposed Behavior
A built-in
waittool that does nothing, returns immediately, and ends the agent's turn. Its description and prompt guidelines will explicitly tell the model: "If you are told to wait for something, use this tool instead of running a shell command."Acceptance Criteria
packages/coding-agent/src/core/tools/wait.tsimplementing a no-opwaittool with no parametersallTools,allToolDefinitions,createAllToolDefinitions, andcreateAllToolsinpackages/coding-agent/src/core/tools/index.tsToolNametype updated to include"wait"README.mdupdated: built-in tool count bumped (10 → 11) andwaitadded to the tool listpackages/coding-agent/README.mdupdated:waitadded to the built-in tools list and--toolsdocumentationpackages/coding-agent/docs/extensions.mdupdated if built-in tools are enumerated thereContext
This is a pragmatic fix for model-specific behavior where certain providers prefer to "do something" rather than end a turn empty-handed. The
waittool is the hammer for that nail.Technical Notes
suggest-next.tsortasks.tsfor a lightweight tool definitionType.Object({})orType.Object({ reason: Type.Optional(Type.String()) })schemaexecuteshould return immediately with a simple confirmation textRisks / Considerations
waitif instructions are too broad. Guidelines should narrowly scope it to "when explicitly told to wait" and "when background subagents are running and you have no other work"--toolsor always available? Probably always available since it is harmless, but it should appear in--toolsrestrictions