GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||
GeezerVison is showing github.com — fix(tui): only flag session location missing on LocationNotFoundError by agustif · Pull Request #55940 · anomalyco/opencode Conversation
|
|
The following comment was made by an LLM, it may be inaccurate: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This works. Using opencode-drive with the simulated model, I made one request of the TUI's location sync fail with a 500 while the folder still existed (a test-only server patch, applied in both checkouts). The base replaced the session prompt with the false Session location unavailable dialog; with this PR the prompt stays. Screenshots are below.
The new test fails on the base and passes here. prompt-move and the test/context suites pass (94/94), and typecheck in packages/tui is clean. A missing folder still shows the dialog: location.get returns the server's typed LocationNotFoundError, which keeps its _tag through the TUI's location sync, matching how the web app already decides this.
The public API is unchanged.
One small point: unlike the web app, a failure that isn't LocationNotFoundError is now dropped and never retried. If it doesn't clear, the session can run with partly missing location data until the next reconnect or location change, with nothing shown to the user. That's still better than a false blocking dialog. #55258 adds a bounded retry for the same symptom, and the two touch the same code, so they could be combined.
Also see the inline note on the test's fixed sleep.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| fixture.location.set({ directory }) | ||
| await fixture.app.waitFor(() => fixture.reads.includes(directory)) | ||
| // Let the sync rejection settle through LocationProvider's catch. | ||
| await new Promise((resolve) => setTimeout(resolve, 100)) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This 100ms sleep is a timing guess: if the rejection takes longer to reach the catch, the test passes without checking anything. Could you wait until the sync has actually settled instead? For example, have the fixture record when the 503 response is served and await a microtask after that, or wait on a condition the way the not-found test does with waitFor.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Good catch — replaced the fixed 100ms sleep with await Bun.sleep(0) after the request is observed. Yielding to the event loop guarantees the full microtask queue (fetch decode → sync rejection → provider catch) has drained before asserting, so the test can't pass vacuously. Red-green re-verified: fails on the pre-fix file, passes with the fix. Pushed as a2c34b9.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that addresses it. I ran the updated test against the base (pre-fix) code three times: the transient-failure case failed every time. So with Bun.sleep(0) after the request is seen, the assertion runs after the rejection is handled and still catches the bug.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Picking up the bot's suggestion from #57532 (auto-closed as a duplicate of this PR). This PR and #55258 each cover one half of the problem. #55258 documents its own limitation: "a location that stays unreachable past the retry window (~1.5s) still surfaces the recovery prompt, and a genuinely missing directory takes that long to report." Combining both halves — and splitting the location state into Two smaller things that belong with it:
Regression tests:
If a single combined PR is preferred, the implementation is on |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Merged PR #57594 supersedes this one — it landed the same behaviour (only the server's typed Two things are worth adding on top of it, both of which are now open:
No need to reconcile these with anything here — they are additive and touch different files. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
tui: false "Session location unavailable" prompt after network reconnect tui: agent keeps running while user is trapped in false location-unavailable modal
There was an error while loading. Please reload this page.