Repository navigation
refactor: one cancellation check for every screen - #1790
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
[Medium impact] The PR appears safe to merge.
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
927ccaa to
6470745
Compare
Linked issue
Fixes #1782
What changed
Nine screens each kept their own "is this error a cancellation" check, and the copies didn't agree. On a Hermes server, a cancelled "Load more" in Archived Sessions showed "This action is no longer current. Refresh the conversation." because
BotClientthrowsBotFailure.stale, notCancellationError, when the reading task is cancelled.All nine now use one
Error.isCancellationinAPIError.swift. It matchesCancellationErrorandURLError.cancelled, either on its own or wrapped inAPIError.network. Sites whose old copy also checkedTask.isCancelled(both Kanban states and the link preview) still check it inline.How each site handles
BotFailure.stale:ArchivedSessionsViewModel.loadMore. It now drops a failure when its task was cancelled, the same checkloadHermesalready makes. It still showsstaleif the task is still running, because that means the client has gone dead. Hiding that case would leave a "Load more" button that does nothing.CronJobEditorConfigurationLoader. It keeps hidingstale, as before.stale:loadHermesalready ignores cancelled tasks, and astalewhile running closes and reports the dead client.staleonly means the connection was retired. Hiding it would leave a spinner or an empty screen.stale: profile picker, link preview, and the webui paths in SessionList.The link preview gains the
APIError.networkunwrap. It never receives anAPIError, so nothing changes there.The decision is recorded in
docs/adr/0130-hermes-session-actions.md.How it was tested
HermesSessionActionsTests.testACancelledPageReadShowsNoError. It fails on the base with the "no longer current" message and passes with this change. The old profile-picker classifier test now targets the shared property (APIClientConfigurationTests.testCancellationDetection).scripts/test-sim <udid> --onlyruns, all passing:HermesSessionActionsTests,APIClientConfigurationTestsandSessionListMutationTests: 112 passed.CronJobEditorConfigurationTests,FileBrowserViewModelTests,GitDiffFileJumpTests,HermesSessionListTests,KanbanCardDetailStateTests,KanbanFeatureStateTests,TranscriptLinkPreviewTestsandSessionNavigationStateTests: 204 passed.HermesSessionActionsTestsandAPIClientConfigurationTests: 38 passed.ci/check_comments.py,ci/check_test_waits.pyandpython3 -m unittest discover -s ci -p 'test_*.py'pass.Checklist
scripts/test-sim <assigned-simulator-udid>with the tests required byAGENTS.md§ Verifying; the selection and results are recorded aboveCodablemodels decode tolerantly (optionals for fields the server might add or rename)AGENTS.mdis locked)Reviewed with sol-loop: 2 rounds with gpt-6.2-sol. Sol verdict: approved
Created with Claude Opus 5.5 in Claude Code (T3 Code).
🤖 Generated with Claude Code