Repository navigation
Conversation
The TUI mounted the blocking "Session location unavailable" recovery prompt after any failed location sync, even when the folder was still there. The sync fans out to a dozen catalog endpoints under one Promise.all, so a single transient failure failed the whole sync and the TUI offered to move the session to another directory. Only the server's typed LocationNotFoundError proves the folder is gone, so the location state now separates `missing` from `error`, and a failed sync is retried before it is reported. The missing directory is compared with sameDirectory, and the duplicated location read is dropped.
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
Contributor
|
Thanks for the thorough write-up and the end-to-end tests, @ggrabarz! I think this duplicates #55940, which is still open and makes the same core change:
Your additions are worth raising there: retrying with backoff, keeping other failures visible as |
3 of 6 tasks
3 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #55250
Type of change
What does this PR do?
The TUI replaced the composer with the blocking "Session location unavailable — Choose another directory to continue this session." prompt after any failed location sync, even when the folder was still there.
LocationProvider.sync(packages/tui/src/context/location.tsx) set the location error on every sync rejection. The sync fans out to a dozen catalog endpoints under onePromise.all(packages/client/src/solid/data.ts,location.sync), so one transient failure fails the whole sync. Under load the server answersGET /api/modelwith503 ServiceUnavailableError: Location plugins did not finish activating(the 5sawaitPluginsbudget inpackages/server/src/location.ts), the sync rejects, and the TUI claims the directory is gone and offers to move the session somewhere else.Only the server's typed
LocationNotFoundErrorproves the folder is missing. The web client already gates on it (packages/app/src/workspaces/location.tsx); the TUI did not.This change:
missing(the server'sLocationNotFoundError) anderror(anything else), so only a genuinely missing directory mounts the recovery prompt;sameDirectory, so a Windows path that differs only in case still matches;A transient failure stays visible as
location.errorinstead of being swallowed.How did you verify your code works?
packages/tui/test/session-location-unavailable.test.tsxdrives the real app: a transient/api/model503 is retried and the composer stays usable, a persistent 503 keeps the composer usable, and aLocationNotFoundErrorstill shows the recovery prompt. Reverting the source change fails the first two and reproduces the reported screen verbatim.packages/tui/test/cli/tui/location-provider.test.tsx: a missing location is asked exactly once (retrying cannot succeed until the folder changes), while any other failure is retried and lands inerror, never inmissing.cd packages/tui && bun test --timeout 60000 test/session-location-unavailable.test.tsx test/cli/tui/location-provider.test.tsx test/cli/tui/prompt-move.test.tsx test/cli/tui/data.test.tsx test/context/session-tabs.test.tsx test/component/session-tabs-status.test.tsx test/session-dialog-resync.test.tsx-> 103 pass / 0 fail. With the source change reverted: 99 pass / 4 fail (the four new cases; no other test changes state).bun run typecheckandoxlintare clean.Screenshots / recordings
No visual change for a genuinely missing folder. The recovery prompt no longer appears for a folder that is present.
Related
packages/server/src/location.ts, which is a separate change.Checklist