Skip to content

fix(client): distinguish location sync failures - #45601

Open
opencode-agent[bot] wants to merge 1 commit into
v2from
location-45592
Open

fix(client): distinguish location sync failures#45601
opencode-agent[bot] wants to merge 1 commit into
v2from
location-45592

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

Summary

location.sync() loads location info and then hydrates multiple independent resources. Previously, any rejected request could make the TUI replace the prompt with “Session location unavailable,” even when the directory existed and its info had loaded successfully.

  • Add LocationSyncError with the requested location, failed resource, original cause, and a classification that distinguishes directory, transport, lookup, and resource failures. Successful reads remain cached; failed reads remain retryable.
  • Return a structured LocationDirectoryError only after checking the requested placement's filesystem. Check before booting location services so initialization failures are not mistaken for missing directories. Follow directory symlinks and keep authorization intact.
  • Reserve directory recovery for explicit directory errors. Other sync failures show a resource-specific error toast with a working Retry action, without replacing the session prompt. Preserve stale-request and reconnect guards.
  • Regenerate the client from the updated protocol.

This covers the false-positive warning path discussed in #45592 and overlaps with the narrower mitigation in #45148. The reporter's exact trigger remains unconfirmed.

Validation

  • Client: bun test test/solid-location.test.ts test/solid-data.test.ts — 25 passed.
  • Server: bun test test/location.test.ts test/fetch.test.ts test/handler-policy.test.ts test/config.test.ts test/workerd.test.ts --timeout 30000 — 17 passed.
  • TUI: bun test test/cli/tui/data.test.tsx test/context/session-tabs.test.tsx test/component/session-tabs-status.test.tsx test/cli/tui/composer-keymap.test.tsx --timeout 30000 — 88 passed.
  • GOMAXPROCS=4 bun typecheck passed in client, protocol, server, and TUI.
  • bun run generate completed in client; git diff --check passed.

Regression coverage includes every resource in the combined sync, original-cause retention, retry/cache behavior, transport and server failures, real rendered TUI Retry clicks, directory recovery after reconnect, absent/restored/deleted directories, files, symlinks, initialization failures, authorization, and placement-specific filesystem errors. Workspace filesystem tests use an in-memory Workspace.connect adapter; real remote provisioning and bare-location workerd behavior were not exercised by those tests.

Requested by: @jlongster (James via Slack)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant