fix(client): preserve cursor on reconnect exhaustion - #619
Conversation
|
@iroiro147 is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
b5b2ed5 to
e251b7b
Compare
|
Rebased this onto current |
Signed-off-by: iroiro147 <sarthak.singh@juspay.in>
e251b7b to
eceb150
Compare
|
Rebased onto latest
|
|
Attempted rebase onto current Upstream landed two feature PRs that rewrote the exact stream-read loops this change touches: Rather than guess at the intended composition, flagging for author: how should the reconnect-exhaustion cursor carry over the new |
Description
Fixes #134.
When a message stream ends before the current turn reaches
session.waiting,session.completed, orsession.failedand the reconnect budget is exhausted,ClientSessionnow preserves the resumable cursor and throwsStreamReconnectExhaustedErrorinstead of resetting to a fresh session state.This also keeps
EveAgentStoreinerrorfor that path, so frontend bindings do not reportreadyand the next ordinary send does not silently start a new conversation. Manualsession.stream()reattaches from the preserved cursor; an empty reattach leaves the cursor unchanged.This PR also adds client/API/store regression coverage, docs for the catch-and-persist pattern, and a patch changeset.
How did you test your changes?
node -v(v24.14.0)git diff --cached --checkpnpm --filter eve exec vitest run --config vitest.unit.config.ts src/client/session.test.ts src/vue/use-eve-agent.test.ts test/client.test.ts(52 passed)pnpm --filter eve exec vitest run --config vitest.unit.config.ts src/client test/client.test.ts src/react/use-eve-agent.test.ts src/vue/use-eve-agent.test.ts src/svelte/use-eve-agent.test.ts(96 passed)pnpm --filter eve run typecheckpnpm --filter eve exec oxlint src/client/session.ts src/client/session-utils.ts src/client/session-errors.ts src/client/session.test.ts src/vue/use-eve-agent.test.ts test/client.test.ts --deny-warningspnpm exec oxfmt --check packages/eve/src/client/session.ts packages/eve/src/client/session-utils.ts packages/eve/src/client/session-errors.ts packages/eve/src/client/index.ts packages/eve/src/client/session.test.ts packages/eve/src/vue/use-eve-agent.test.ts packages/eve/test/client.test.ts docs/guides/client/streaming.mdx docs/guides/frontend/overview.mdx .changeset/client-reconnect-exhaustion.mdpnpm docs:checkpnpm guard:invariantspnpm changeset status --since origin/mainPR Checklist
CONTRIBUTING.mdevepackagegit commit --signoff)