fix(agent-core-v2): let steer interrupt background task waits - #3697
Merged
Merged
Conversation
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. |
🦋 Changeset detectedLatest commit: f0a9c84 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 |
commit: |
Merged
teknium1
added a commit
to NousResearch/hermes-agent
that referenced
this pull request
Sep 13, 2026
…ort of MoonshotAI/kimi-code#3697) A user message sent mid-turn (CLI busy_input_mode=interrupt, gateway priority redirect, ACP redirect) goes through AIAgent.redirect(), which during tool execution degrades to steer() + request_yield() on the tool worker threads. The local terminal backend's foreground wait honours the yield (adopting the process into the background registry), but ProcessRegistry.wait() — the process_manage(action='wait') path — never checked it: a model sitting in a wait on an already-background process parked the user's message for up to the full wait window (default 180s, clamp allows more). wait() now consumes a pending yield on its own thread each poll pass and returns status "interrupted" with process_running=true and a note telling the model to respond to the user; the process is untouched and still notify-tracked. The plain-interrupt and timeout paths are unchanged. Live repro: on origin/main, request_yield() against a thread blocked in wait(timeout=12) had no effect (wait ran to timeout); after this change the wait releases in <1s with status=interrupted, process still running. Port of MoonshotAI/kimi-code#3697 ("let steer interrupt background task waits") adapted to Hermes' per-thread yield mechanism from 4632923.
teknium1
added a commit
to NousResearch/hermes-agent
that referenced
this pull request
Sep 13, 2026
…ort of MoonshotAI/kimi-code#3697) A user message sent mid-turn (CLI busy_input_mode=interrupt, gateway priority redirect, ACP redirect) goes through AIAgent.redirect(), which during tool execution degrades to steer() + request_yield() on the tool worker threads. The local terminal backend's foreground wait honours the yield (adopting the process into the background registry), but ProcessRegistry.wait() — the process_manage(action='wait') path — never checked it: a model sitting in a wait on an already-background process parked the user's message for up to the full wait window (default 180s, clamp allows more). wait() now consumes a pending yield on its own thread each poll pass and returns status "interrupted" with process_running=true and a note telling the model to respond to the user; the process is untouched and still notify-tracked. The plain-interrupt and timeout paths are unchanged. Live repro: on origin/main, request_yield() against a thread blocked in wait(timeout=12) had no effect (wait ran to timeout); after this change the wait releases in <1s with status=interrupted, process still running. Port of MoonshotAI/kimi-code#3697 ("let steer interrupt background task waits") adapted to Hermes' per-thread yield mechanism from 4632923.
teknium1
added a commit
to NousResearch/hermes-agent
that referenced
this pull request
Sep 13, 2026
…ort of MoonshotAI/kimi-code#3697) A user message sent mid-turn (CLI busy_input_mode=interrupt, gateway priority redirect, ACP redirect) goes through AIAgent.redirect(), which during tool execution degrades to steer() + request_yield() on the tool worker threads. The local terminal backend's foreground wait honours the yield (adopting the process into the background registry), but ProcessRegistry.wait() — the process_manage(action='wait') path — never checked it: a model sitting in a wait on an already-background process parked the user's message for up to the full wait window (default 180s, clamp allows more). wait() now consumes a pending yield on its own thread each poll pass and returns status "interrupted" with process_running=true and a note telling the model to respond to the user; the process is untouched and still notify-tracked. The plain-interrupt and timeout paths are unchanged. Live repro: on origin/main, request_yield() against a thread blocked in wait(timeout=12) had no effect (wait ran to timeout); after this change the wait releases in <1s with status=interrupted, process still running. Port of MoonshotAI/kimi-code#3697 ("let steer interrupt background task waits") adapted to Hermes' per-thread yield mechanism from 4632923.
loteiron
pushed a commit
to loteiron/ZeusAgent
that referenced
this pull request
Sep 14, 2026
…ort of MoonshotAI/kimi-code#3697) A user message sent mid-turn (CLI busy_input_mode=interrupt, gateway priority redirect, ACP redirect) goes through AIAgent.redirect(), which during tool execution degrades to steer() + request_yield() on the tool worker threads. The local terminal backend's foreground wait honours the yield (adopting the process into the background registry), but ProcessRegistry.wait() — the process_manage(action='wait') path — never checked it: a model sitting in a wait on an already-background process parked the user's message for up to the full wait window (default 180s, clamp allows more). wait() now consumes a pending yield on its own thread each poll pass and returns status "interrupted" with process_running=true and a note telling the model to respond to the user; the process is untouched and still notify-tracked. The plain-interrupt and timeout paths are unchanged. Live repro: on origin/main, request_yield() against a thread blocked in wait(timeout=12) had no effect (wait ran to timeout); after this change the wait releases in <1s with status=interrupted, process still running. Port of MoonshotAI/kimi-code#3697 ("let steer interrupt background task waits") adapted to Hermes' per-thread yield mechanism from 463292351fe. Adapted for ZeusAgent with local regression coverage. Upstream-Commit: cbd4492f1fc3b336619a7871b5dae94b86975693
7723qqq
added a commit
to 7723qqq/kimi-code
that referenced
this pull request
Sep 17, 2026
Brings the fork's Rust engine up to the behaviors ported from upstream since 0.42.0, and moves the version to 2.0.0 to follow upstream (never bumped independently). Ports landed here, each recorded in packages/kimi-agent/ROADMAP.md §6.2 and scripts/upstream-v2-delta-allowlist.json with its own evidence: - MoonshotAI#3688 MCP media originals are preserved instead of flattened to a text preview: src/mcp/output.rs adds the content-block conversion and the result-to-delivery path, FileStore gains content-addressed writing, and the attachment reference is resolvable by Read/ReadMediaFile. - MoonshotAI#3734 streamed attempt state is invalidated when the LLM requester retries: a turn-scoped tool-call id ledger, streamed tool-call deltas from all three wire protocols, and an attempt guard that rolls back on every failure exit. - MoonshotAI#3697 steer interrupts a background-task wait — plus the blocking wait it needed. The engine's WaitFor had been routed through a synchronous local store, so a 5s wait returned in 6ms reporting a timeout; the toolset now waits on its own task runner, and a steer signal ends that wait early without cancelling the turn or its tasks. WaitFor gains the wait-any form. - MoonshotAI#3846 an MCP tool call returning 401 flips the server to needs-auth. - MCP servers connect once per process, starting at startup. - AI session titles are generated through the managed chat_title tool. - The abort fix in the preceding commit. Also refreshes the ROADMAP evidence blocks, the upstream delta allowlist, the bilingual docs those behaviors surface in, and the TUI rendering for the new wait status.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
No linked GitHub issue. This addresses new steering messages being blocked while the agent waits for a background task.
Problem
When the model calls
WaitFor, steering adds input for the next step but does not release the active wait. A user can therefore wait up to 600 seconds before the model handles their new message, even though the background task runs independently.What changed
WaitForreturns a non-errorinterruptedresult when steered, preserving tool history and leaving background tasks running.Validation:
pnpm --filter @moonshot-ai/agent-core-v2 run typecheckpassed.pnpm run lintpassed with zero errors; existing repository warnings remain.pnpm -C docs run buildpassed.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.