Skip to content

fix: recover failed sessions and streamline bootstrap - #452

Open
geier wants to merge 1 commit into
mainfrom
fix/session-bootstrap-recovery
Open

fix: recover failed sessions and streamline bootstrap#452
geier wants to merge 1 commit into
mainfrom
fix/session-bootstrap-recovery

Conversation

@geier

@geier geier commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • discard persisted model selections that are no longer available after provider catalog changes
  • stop stale pending indicators when the server no longer reports a running session
  • reuse synced session metadata for the sidebar instead of requesting it twice
  • remove the unused provider catalog download from sync bootstrap

Verification

  • bun run typecheck
  • bun test tests/ (349 passed)
  • bun run build

Notes

  • Session message histories remain lazy-loaded when a session is opened.
  • Targeted lint reports only existing ref-assignment and console findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves session bootstrap and recovery behavior by centralizing sidebar session data on the sync context, removing redundant provider bootstrap work, and ensuring “processing” UI state is cleared when a session stops unexpectedly.

Changes:

  • Stop stale “pending” indicators and show a clearer error when a session halts before an assistant response is finalized.
  • Reuse SyncProvider session metadata for the sidebar (removing duplicate session list requests and event-driven reload logic).
  • Drop provider catalog bootstrap from sync and purge persisted model selections that no longer exist or aren’t connected.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
app-prefixable/src/pages/session.tsx Stops processing state on failed/ended sessions and surfaces a retry-oriented error.
app-prefixable/src/pages/layout.tsx Switches session sidebar loading to useSync() state and uses sync.refresh() for retry.
app-prefixable/src/context/sync.tsx Removes provider bootstrap/state from sync and simplifies bootstrap to session listing only.
app-prefixable/src/context/providers.tsx Clears persisted agent model selections when provider/model is no longer valid/connected.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1162 to 1166
createEffect(() => {
const error = sync.bootstrapError;
if (!sync.ready && !error) return;
if (error) {
setSessions([]);
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.

2 participants