Skip to content

fix(ui): surface session loading failures#582

Merged
shantur merged 5 commits into
NeuralNomadsAI:devfrom
pascalandr:fix/session-list-load-errors
Jul 17, 2026
Merged

fix(ui): surface session loading failures#582
shantur merged 5 commits into
NeuralNomadsAI:devfrom
pascalandr:fix/session-list-load-errors

Conversation

@pascalandr

@pascalandr pascalandr commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve and display detailed OpenCode errors when the session list cannot be loaded instead of failing silently
  • share error extraction and retry UI with per-session message loading while keeping each error scoped correctly
  • continue instance hydration after list failures and ignore stale overlapping list responses
  • show loading feedback during retries and localize the new states for every supported locale

Closes #543.

Validation

  • bun test --conditions=browser packages/ui/src/stores/session-list-error.test.ts packages/ui/src/stores/session-tree.test.ts
  • npm run typecheck --workspace @codenomad/ui
  • npm run build --workspace @codenomad/ui
  • git diff --check upstream/dev...HEAD

Show detailed OpenCode errors and retry actions when the session list or a known session's messages cannot be loaded, instead of presenting an empty state or relying only on logs. Other instance data continues hydrating when the list request fails.

Share error extraction and error-state rendering across list and message loading while keeping their state scoped by instance and session. Request IDs prevent stale overlapping list requests from replacing newer results, and retries without cached sessions display loading feedback.

Add localized copy for all supported locales and tests for nested SDK errors, fallback messages, structured bodies, cyclic causes, and session-list error state. Validated with targeted Bun tests, UI typecheck, production build, and diff checks.
@github-actions

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/29174942286

Artifacts expire in 7 days.
Artifacts:

  • pr-582-2f2882906b2feb98d4be140d0b6acd4e08e7ac38-tauri-macos
  • pr-582-2f2882906b2feb98d4be140d0b6acd4e08e7ac38-electron-macos
  • pr-582-2f2882906b2feb98d4be140d0b6acd4e08e7ac38-tauri-windows
  • pr-582-2f2882906b2feb98d4be140d0b6acd4e08e7ac38-tauri-linux
  • pr-582-2f2882906b2feb98d4be140d0b6acd4e08e7ac38-tauri-macos-arm64
  • pr-582-2f2882906b2feb98d4be140d0b6acd4e08e7ac38-electron-windows
  • pr-582-2f2882906b2feb98d4be140d0b6acd4e08e7ac38-electron-linux

@pascalandr

Copy link
Copy Markdown
Contributor Author

Gatekeeper review: REQUEST CHANGES

I reviewed the latest PR head 2f288290 against dev and found two blocking issues.

Blocking findings

  1. Cold-start retry can permanently lose pending permission/question indicators.

    hydrateInstanceData() now continues to synchronize permissions and questions after fetchSessions() fails. With no sessions in the store, setSessionPendingPermission() and setSessionPendingQuestion() cannot update anything. If the user later retries the session list successfully, the newly loaded sessions never reconcile the already-populated interruption queues, so affected sessions and instance indicators remain idle until another event or full rehydration.

    Expected fix: add one deterministic pending-state reconciliation step and invoke it after session-list success and queue synchronization.

  2. The new test does not run in the default Bun test environment.

    session-list-error.test.ts imports the full session-state.ts graph, which reaches solid-toast and throws Client-only API called on the server side under bun test packages/ui/src/stores/session-list-error.test.ts. The PR command passes only because it adds --conditions=browser.

    Expected fix: move getOpencodeErrorMessage() coverage into a focused opencode-api.test.ts with no UI-store dependency, and test session-list state through a client-safe module or the project's browser-capable harness.

Non-blocking improvements

  • Clear per-instance request counters and list errors during instance teardown.
  • Avoid storing localized fallback text so changing locale updates an already-visible fallback.
  • Add controlled out-of-order request tests for older-success/newer-failure and older-failure/newer-success.
  • Add coverage for cold-start failure followed by Retry.

Implementation assessment

The shared LoadErrorState component and opencode-api.ts extraction boundary are appropriate. The latest-request guards and Retry loading state are improvements over the first revision. A single reconcileSessionPendingState(instanceId) helper is the simplest robust fix for hydration-order independence.

Verification

  • UI typecheck: passed
  • Production UI build: passed
  • Recursive session tree/pagination tests: passed
  • git diff --check: passed
  • Default execution of the new test: failed before assertions

I would not merge this state until both blocking findings are resolved.

@github-actions

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/29189026755

Artifacts expire in 7 days.
Artifacts:

  • pr-582-2f2882906b2feb98d4be140d0b6acd4e08e7ac38-tauri-macos
  • pr-582-2f2882906b2feb98d4be140d0b6acd4e08e7ac38-tauri-linux
  • pr-582-2f2882906b2feb98d4be140d0b6acd4e08e7ac38-electron-macos
  • pr-582-2f2882906b2feb98d4be140d0b6acd4e08e7ac38-tauri-windows
  • pr-582-2f2882906b2feb98d4be140d0b6acd4e08e7ac38-tauri-macos-arm64
  • pr-582-2f2882906b2feb98d4be140d0b6acd4e08e7ac38-electron-windows
  • pr-582-2f2882906b2feb98d4be140d0b6acd4e08e7ac38-electron-linux

Restore pending permission and question indicators when interruption queues hydrate before a failed session list is retried. Reconcile the queue-derived state after list and queue synchronization so recovery no longer depends on another SSE event.

Clear per-instance request state during teardown and use a monotonic request generation to keep late responses stale even if an instance ID is reused. Move error extraction coverage out of the client-only store graph and add server-safe tests for pending-state reconciliation.

Validated with focused Bun tests, UI typechecking, the production UI build, and git diff checks.
@pascalandr

Copy link
Copy Markdown
Contributor Author

Gatekeeper follow-up: PASS

Resolved both blocking findings in 822c4f44:

  • Session-list success now reconciles pending permission and question state from the interruption queues, including cold-start failure followed by Retry.
  • Error extraction tests no longer import the client-only store graph and run under default Bun conditions.
  • Added server-safe coverage for queue state arriving before sessions and for stale pending flags.
  • Instance teardown now clears session-list error/loading/request state. Request IDs use a monotonic generation so late responses remain stale even if an instance ID is reused.

Validation:

  • 12 focused tests passed
  • UI typecheck passed
  • Production UI build passed
  • git diff --check passed
  • Independent gatekeeper re-review: PASS

@pascalandr

Copy link
Copy Markdown
Contributor Author

@shantur LGTM

@github-actions

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/29205577941

Artifacts expire in 7 days.
Artifacts:

  • pr-582-822c4f44164121cf88fd5ef01783b69fc922e5ea-tauri-windows
  • pr-582-822c4f44164121cf88fd5ef01783b69fc922e5ea-electron-macos
  • pr-582-822c4f44164121cf88fd5ef01783b69fc922e5ea-tauri-macos-arm64
  • pr-582-822c4f44164121cf88fd5ef01783b69fc922e5ea-tauri-linux
  • pr-582-822c4f44164121cf88fd5ef01783b69fc922e5ea-electron-windows

@github-actions

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/29206152730

Artifacts expire in 7 days.
Artifacts:

  • pr-582-6d9ca68754e3cfc849ddbd59a1d3da4703c4843d-tauri-macos
  • pr-582-6d9ca68754e3cfc849ddbd59a1d3da4703c4843d-tauri-windows
  • pr-582-6d9ca68754e3cfc849ddbd59a1d3da4703c4843d-electron-macos
  • pr-582-6d9ca68754e3cfc849ddbd59a1d3da4703c4843d-tauri-linux
  • pr-582-6d9ca68754e3cfc849ddbd59a1d3da4703c4843d-electron-linux
  • pr-582-6d9ca68754e3cfc849ddbd59a1d3da4703c4843d-tauri-macos-arm64
  • pr-582-6d9ca68754e3cfc849ddbd59a1d3da4703c4843d-electron-windows

1 similar comment
@github-actions

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/29206152730

Artifacts expire in 7 days.
Artifacts:

  • pr-582-6d9ca68754e3cfc849ddbd59a1d3da4703c4843d-tauri-macos
  • pr-582-6d9ca68754e3cfc849ddbd59a1d3da4703c4843d-tauri-windows
  • pr-582-6d9ca68754e3cfc849ddbd59a1d3da4703c4843d-electron-macos
  • pr-582-6d9ca68754e3cfc849ddbd59a1d3da4703c4843d-tauri-linux
  • pr-582-6d9ca68754e3cfc849ddbd59a1d3da4703c4843d-electron-linux
  • pr-582-6d9ca68754e3cfc849ddbd59a1d3da4703c4843d-tauri-macos-arm64
  • pr-582-6d9ca68754e3cfc849ddbd59a1d3da4703c4843d-electron-windows

@github-actions

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/29335999227

Artifacts expire in 7 days.
Artifacts:

  • pr-582-561493614cbe860b39cfd139758137802f22d1c0-tauri-macos
  • pr-582-561493614cbe860b39cfd139758137802f22d1c0-electron-macos
  • pr-582-561493614cbe860b39cfd139758137802f22d1c0-tauri-macos-arm64
  • pr-582-561493614cbe860b39cfd139758137802f22d1c0-tauri-windows
  • pr-582-561493614cbe860b39cfd139758137802f22d1c0-tauri-linux
  • pr-582-561493614cbe860b39cfd139758137802f22d1c0-electron-linux
  • pr-582-561493614cbe860b39cfd139758137802f22d1c0-electron-windows

@shantur

shantur commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

@pascalandr - Needs to resolve conflicts

Integrate the current dev restoration and runtime-authority lifecycle with the session-list failure handling from this branch.

Keep session loading failures visible in UI state without aborting the remaining instance hydration. Preserve both request-state cleanup and the newer attachment, selection, deletion-authority, and lifecycle cleanup when instances are removed.

Validated with the UI typecheck and production build, six focused PR tests, and eleven instance runtime-authority assertions under SolidJS browser conditions.
@github-actions

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/29406565575

Artifacts expire in 7 days.
Artifacts:

  • pr-582-107a2a891b49e961a185df303a8a4900714734bc-tauri-macos
  • pr-582-107a2a891b49e961a185df303a8a4900714734bc-tauri-macos-arm64
  • pr-582-107a2a891b49e961a185df303a8a4900714734bc-electron-macos
  • pr-582-107a2a891b49e961a185df303a8a4900714734bc-tauri-windows
  • pr-582-107a2a891b49e961a185df303a8a4900714734bc-tauri-linux
  • pr-582-107a2a891b49e961a185df303a8a4900714734bc-electron-linux
  • pr-582-107a2a891b49e961a185df303a8a4900714734bc-electron-windows

@shantur
shantur merged commit f6cf6c5 into NeuralNomadsAI:dev Jul 17, 2026
11 checks passed
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.

[Bug]: Corrupted time_archived in SQLite causes HTTP 400 on session list — zero sessions shown

2 participants