fix(eve): emit turn epilogue when parking for connection authorization in conversation mode (#1525) - #1526
Open
iroiro147 wants to merge 1 commit into
Open
Conversation
…n in conversation mode (vercel#1525) A conversation-mode turn that parks on connection authorization never emitted a turn boundary: the authorization.required event went out on the stream, but no turn.completed / session.waiting followed, so useEveAgent clients never settled the turn — the UI spun on "Thinking…" forever, no continuation token reached the client, and cancel could not resolve. Mirror the input-request park branch: after emitting the authorization.required events, call emitTurnEpilogue in conversation mode (which emits turn.completed plus session.waiting carrying the continuation token) and carry the updated emissionState forward into the parked session. Task/channel sessions are unchanged. Verified end-to-end against the issue repro: the connect card renders immediately, the turn settles with turn.completed + session.waiting on the stream, cancel works, and resumed sessions behave. Added a regression assertion to the existing conversation-mode auth-park test proving the boundary events follow authorization.required and carry the session continuation token. Signed-off-by: Sarthak Singh <sarthak.singh@juspay.in>
Contributor
|
@iroiro147 is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
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.
Summary
Fixes #1525. A conversation-mode turn that parks on connection authorization never emitted a turn boundary:
authorization.requiredwent out on the session stream, but noturn.completed/session.waitingfollowed.useEveAgentclients derive turn status exclusively from a boundary event, so the chat UI spun on "Thinking…" forever, no continuation token reached the client, and cancel could not resolve.Root cause
packages/eve/src/harness/tool-loop.ts— the two park branches were asymmetric:emitTurnEpilogue(which emitsturn.completedandsession.waitingwith the continuation token) before returning.findAuthorizationSignalFromToolResultshit) emittedauthorization.requiredper challenge and returned the parked session without callingemitTurnEpilogue.Channel sessions do not need the boundary, and input-request parks (approvals) work everywhere — which is why only conversation-mode surfaces hung.
Fix
Mirror the input-request branch in the authorization park:
Task and channel sessions are unchanged.
Behavior
Stream events after this change (conversation-mode auth park):
The connect card renders immediately, the turn settles, cancel resolves, and resumed sessions behave — matching the end-to-end verification recorded on the issue.
Tests
packages/eve/src/harness/tool-loop.test.tswith a regression assertion provingturn.completedandsession.waitingfollowauthorization.requiredand carry the session continuation token.packages/evetypecheck: clean.src/harnessunit suite: 45 files / 694 tests passing.Verification
cd packages/eve && pnpm exec tsc -p tsconfig.json --noEmit && pnpm exec vitest run --config vitest.unit.config.ts src/harness🤖 Generated with Claude Code