fix(agent-core-v2): degrade idle-session steer to turn launch like v1 - #2723
fix(agent-core-v2): degrade idle-session steer to turn launch like v1#2723sailist wants to merge 1 commit into
Conversation
- return the enqueue-launched turn instead of rejecting with prompt.not_found when no prompt is pending at steer time - report steer as queued when a manual compaction holds the context - sync title/lastPrompt metadata on main-agent steer, matching v1 - update the v1-v2 parity test to assert converged behavior
🦋 Changeset detectedLatest commit: 8110bdc 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: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8110bdc3ec
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const turn = await queued.launched; | ||
| return turn === undefined ? undefined : { turn_id: turn.id }; |
There was a problem hiding this comment.
Preserve steer history when degrading to launch
When this branch is taken for an idle session, queued.launched is the turn started by promptService.enqueue(); that path uses a PromptStepRequest, and LoopService.startTurn persists a turn.prompt record. v1 AgentTurn.steer() records turn.steer before launching, so the v2 call now succeeds while history/transcript consumers see it as a normal prompt instead of a steer. Use a steer launch path for this degradation rather than returning the enqueue-launched prompt.
Useful? React with 👍 / 👎.
Related Issue
No linked issue — the problem is explained below.
Problem
Sending a message (steer) while a goal run is between turns — or on an idle session — made v2 reject with a spurious
prompt.not_found("Failed to steer") error. v1 treats an idle steer like a prompt: it launches a fresh turn and updates the session title/lastPrompt. v2's steer RPC enqueues first, and the enqueue itself already launches the turn when nothing is pending, so the follow-up steer-by-id could never find the record pending and rejected. The v2 path also never synced the title/lastPrompt metadata.What changed
packages/agent-core-v2/src/agent/rpc/rpcService.ts: when the enqueued message is no longer pending (the enqueue already launched it as its own turn), return that turn instead of rejecting — v1's steer-degrades-to-launch end state. When the message is pending but there is nothing active to steer into (a manual compaction holds the context), report it as queued (undefined) instead of failing, since it launches once compaction finishes. Also sync title/lastPrompt metadata on main-agent steer, matching v1's prompt behavior.packages/node-sdk/src/sdk-rpc-client-v2.ts: update thesteerfacade doc comment to describe the converged v1/v2 behavior.packages/node-sdk/test/v1-v2-parity.test.ts: replace the pinned-divergence test with one asserting both engines launch a turn and update metadata on an idle-session steer.This approach keeps the fix at the RPC boundary, matching v1 semantics without changing the underlying prompt/steer pipeline.
Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.