Skip to content

fix(eve): emit turn epilogue when parking for connection authorization in conversation mode (#1525) - #1526

Open
iroiro147 wants to merge 1 commit into
vercel:mainfrom
iroiro147:fix/auth-park-turn-epilogue-1525
Open

fix(eve): emit turn epilogue when parking for connection authorization in conversation mode (#1525)#1526
iroiro147 wants to merge 1 commit into
vercel:mainfrom
iroiro147:fix/auth-park-turn-epilogue-1525

Conversation

@iroiro147

Copy link
Copy Markdown
Contributor

Summary

Fixes #1525. A conversation-mode turn that parks on connection authorization never emitted a turn boundary: authorization.required went out on the session stream, but no turn.completed / session.waiting followed. useEveAgent clients 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:

  • Input-request park (pending input batch) emits the input-requested event and then, in conversation mode, calls emitTurnEpilogue (which emits turn.completed and session.waiting with the continuation token) before returning.
  • Authorization park (findAuthorizationSignalFromToolResults hit) emitted authorization.required per challenge and returned the parked session without calling emitTurnEpilogue.

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:

if (config.mode === "conversation") {
  emissionState = await emitTurnEpilogue(
    emit,
    emissionState,
    config.mode,
    parkedSession.continuationToken,
  );
  parkedSession = setHarnessEmissionState(parkedSession, emissionState);
}

Task and channel sessions are unchanged.

Behavior

Stream events after this change (conversation-mode auth park):

session.started
turn.started
message.received
step.started
actions.requested
step.completed
authorization.required
turn.completed        ← new
session.waiting       ← new (carries the continuation token)

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

  • Extended the existing conversation-mode auth-park test in packages/eve/src/harness/tool-loop.test.ts with a regression assertion proving turn.completed and session.waiting follow authorization.required and carry the session continuation token.
  • packages/eve typecheck: clean.
  • Full src/harness unit 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

…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>
@vercel

vercel Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

@iroiro147 is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Authorization park never emits a turn boundary in conversation mode — chat clients hang at "Thinking…" forever

1 participant