Skip to content

fix(session): mark recovered assistant turns as aborted#26

Closed
dzianisv wants to merge 1 commit into
devfrom
issue-24-recover-assistant-abort
Closed

fix(session): mark recovered assistant turns as aborted#26
dzianisv wants to merge 1 commit into
devfrom
issue-24-recover-assistant-abort

Conversation

@dzianisv

Copy link
Copy Markdown
Owner

Summary

When the server restarts during an in-flight session turn, Session.recover() already converts running tool parts into server restarted errors and force-completes unfinished assistant messages. The missing piece was that those assistant messages were still stored as successful completions with error: null.

This patch marks recovered orphaned assistant messages as MessageAbortedError so the UI renders the turn as interrupted instead of looking like a silent dead-end or stuck session.

Closes #24

Changes

  • load assistant message data during startup recovery
  • mark recovered orphaned assistant messages as MessageAbortedError if they do not already carry an error
  • preserve the recovered time.completed behavior
  • add a regression test covering orphaned assistant + running tool recovery

Testing

  • bun test test/session/session.test.ts
  • bun typecheck
  • browser-visible isolated E2E with a seeded orphaned session on a patched local server: page renders Interrupted plus the server restarted tool error and no stale active session state

@github-actions

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

Copy link
Copy Markdown

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant