Conversation
🦋 Changeset detectedLatest commit: 7d19195 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Repeat warnings miss common outcomes, shared guidance contradicts web behavior, and required documentation and changeset updates are absent.
Review effort: Balanced
Findings: 2
Open (3)
What changed in this PR
Caps WaitFor at 90 seconds, adds repeat-wait guidance, and lets TUI input interrupt active waits.
Changes:
- Adds main-agent, goal, and subagent wait guidance.
- Steers fresh and queued TUI input during
WaitFor. - Updates related tests and snapshots.
| File | Description |
|---|---|
packages/agent-core-v2/test/features/goal/stubs.ts |
Adds a goal-service stub. |
packages/agent-core-v2/test/features/goal/goal.test.ts |
Removes obsolete prompt assertions. |
packages/agent-core-v2/test/agent/task/tools/task-tools.test.ts |
Updates timeout and constructor tests. |
packages/agent-core-v2/test/agent/task/taskService.test.ts |
Supplies new tool dependencies. |
packages/agent-core-v2/test/agent/loop/loop.test.ts |
Updates tool-description snapshots. |
packages/agent-core-v2/src/agent/tools/task/task-wait/taskWaitTool.ts |
Adds contextual repeat-wait guidance. |
packages/agent-core-v2/src/agent/tools/task/task-wait/task-wait.ts |
Caps waits at 90 seconds. |
packages/agent-core-v2/src/agent/tools/task/task-wait/task-wait.md |
Revises main wait guidance. |
packages/agent-core-v2/src/agent/tools/task/task-wait/task-wait-subagent.md |
Adds subagent-specific guidance. |
apps/kimi-code/test/tui/kimi-tui-message-flow.test.ts |
Tests WaitFor steering behavior. |
apps/kimi-code/src/tui/kimi-tui.ts |
Steers eligible input and backlog. |
apps/kimi-code/src/tui/controllers/streaming-ui.ts |
Detects active tools by name. |
apps/kimi-code/src/tui/controllers/session-event-handler.ts |
Steers queued input when WaitFor starts. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
💡 Codex Review
Whenever new input steers a running wait, this newly emitted wait_status: interrupted is not recognized by the TUI's parseWaitForOutput, whose status union only accepts completed, timed_out, and no_tasks. The result therefore falls through to the normal completed header (Waited for background task) and generic body rather than indicating that user input ended the wait; extend the WaitFor renderer and its tests to handle this new status.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } finally { | ||
| progress.stop(); | ||
| tally.waitedMs += Date.now() - startedAt; |
There was a problem hiding this comment.
Avoid double-counting concurrent wait duration
When one model response emits multiple WaitFor calls, the tool executor runs them concurrently but every call adds its full elapsed duration to the shared turn tally here. Two parallel 90-second waits therefore report up to three minutes of total waiting, and even the two results can show different totals depending on completion order; since this warning is intended to tell the model how long the user has actually been kept waiting, track wall-clock intervals or serialize the accounting rather than summing overlapping calls.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not applicable: WaitFor declares no accesses, so the executor gives it ToolAccesses.all() (toolExecutorService.ts:438), and all conflicts with all in ToolScheduler — two WaitFor calls from one response run one after the other, never concurrently. Their elapsed times therefore don't overlap and the per-turn sum is the real wall-clock waiting time.
|
Codex review-body finding (render interrupted waits as interrupted): fixed in 5ceb8c5. @codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5ceb8c52e3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 750501cf55
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return { | ||
| output: this.withRepeatWarning(this.formatTimeout(args, startedAt, timeoutMs), tally), | ||
| isError: false, |
There was a problem hiding this comment.
Count the current wait before formatting the warning
For serialized repeated waits, withRepeatWarning is evaluated before the surrounding finally adds the current call's elapsed time to tally.waitedMs. Consequently, after two 90-second waits the second result reports only about 90 seconds total rather than three minutes, systematically understating the user-visible delay that this warning is intended to discourage; add the current duration before constructing the warning.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not applicable: withRepeatWarning is not evaluated inside the try. The timed-out and completed branches that call it come after the whole try/catch/finally statement, and the finally (which adds this call's Date.now() - startedAt to tally.waitedMs) has already run by then. The only early return inside the try statement is the interrupted one, which intentionally carries no warning. So after two 90-second waits the second result reports about 3m.
There was a problem hiding this comment.
Still holds after 1f40d5e: the accumulation moved from the finally to right after the try statement (and into the interrupted branch), in both cases before withRepeatWarning builds the total.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b0fded275e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 517ba3b451
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 242e5a7847
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f68738a63
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b37c1eec3c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4840cc0e80
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |


Requirement or Bug
Anonymous usage data shows the agent asks WaitFor for long timeouts (5–10 min) while real waits are short, and users waiting on it cannot get a message in until the wait ends.
Bug Reproduction Steps
WaitFor.Root Cause
agent-core already ends a wait on a steer (
wait_status: interrupted), but the TUI queues plain Enter input locally during a running turn and never steers it (only Ctrl-S / Tower mode do). Fundamental fix: steer while a main-agent WaitFor is running.Code Changes
Behavior Changes and Affected Users
timeoutmaxwait_foron (default), main/coder/Tower workersKIMI_CODE_EXPERIMENTAL_WAIT_FOR=0[wait_warning](main / goal / subagent wording)Not changed: subagent WaitFor calls never trigger TUI steering; web UI (code-app) still queues and needs the same change separately. User docs (en/zh) updated.
Tests:
task-tools.test.ts(cap, schema, subagent/main wiring),kimi-tui-message-flow.test.ts(Enter steers during WaitFor, queued backlog steered on WaitFor start, bash backlog kept, subagent WaitFor ignored, failed steer requeues),tool-call.test.ts(interrupted render). Prompt-wording substring tests for WaitFor were removed.Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.