Skip to content

fix(peer): improve directory picking and recover transient disconnects - #2893

Merged
bobleer merged 3 commits into
GCWing:mainfrom
bobleer:bob/fix-peer-directory-picker
Sep 8, 2026
Merged

fix(peer): improve directory picking and recover transient disconnects#2893
bobleer merged 3 commits into
GCWing:mainfrom
bobleer:bob/fix-peer-directory-picker

Conversation

@bobleer

@bobleer bobleer commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fix Peer Device Mode directory picking and recovery from transient connectivity failures.

  • Start the project directory picker in the controlled host's user home and keep the address field permanently editable at a consistent width. Enter navigates; Escape restores the current path.
  • Keep the selected peer surface and adapter during presence gaps or RPC outages. Show a reconnecting notice with a manual return-to-local action, retry with backoff capped at 15 seconds, and restore healthy status only after the event attachment is acknowledged.
  • Separate ordinary command failures from connection health accounting and serialize recovery probes so concurrent errors do not trigger competing reconnects.

Type and Areas

Type: bug fix / UI/UX

Areas: Web UI, Peer Device Mode, shared system service, desktop/Tauri and CLI system-info adapters, locales, architecture documentation.

Motivation / Impact

Opening a project on a peer previously started in an existing workspace or a filesystem root, and clicking its address replaced the full-width display with a short input. The picker now uses the peer's home directory and one stable input.

A brief absence from relay presence, or several failed product RPCs, could previously switch the UI back to the local device. Transient failures now retain the remote context while recovery continues; explicit disconnect, switching device, and logout retain their existing behavior.

Verification

Passed focused checks:

pnpm --dir src/web-ui run test:run src/infrastructure/peer-device/PeerDirectoryBrowser.test.tsx src/infrastructure/peer-device/PeerDirectoryPickerHost.test.tsx src/infrastructure/peer-device/peerDirectoryPath.test.ts
pnpm --dir src/web-ui run test:run src/infrastructure/peer-device/PeerConnectionManager.test.ts src/infrastructure/peer-device/PeerDeviceSurfaceController.test.ts src/infrastructure/peer-device/PeerConnectionStatus.test.tsx src/infrastructure/api/adapters/peer-device-adapter.test.ts
pnpm --dir src/web-ui run test:run src/app/services/sessionSceneLifecycle.test.ts src/flow_chat/services/sessionActivation.test.ts src/flow_chat/services/storeSync.test.ts src/app/stores/sceneStore.test.ts src/flow_chat/services/flow-chat-manager/PeerSessionRefreshModule.test.ts
cargo test -p openbitfun-services-core --no-default-features --features process-runtime --lib system::info::tests
cargo test -p openbitfun-desktop --lib system_info_home_contract
cargo test -p openbitfun-cli --bin openbitfun system_info_home_contract
pnpm run fmt:rs
pnpm run check:web
pnpm --dir src/web-ui exec eslint src/infrastructure/peer-device/PeerConnectionManager.ts
pnpm run i18n:audit
git diff --check upstream/main...HEAD
node scripts/check-git-object-sizes.mjs --base upstream/main --head HEAD
  • Directory picker: 17 frontend tests and 4 shared-service/desktop/CLI tests passed, including legacy system-info payload compatibility.
  • Recovery: 92 manager/controller/status/adapter tests and 61 session lifecycle/refresh tests passed. Coverage includes a 2.3-second presence gap, outages beyond the former failure threshold, concurrent command failures, event-attach ordering, stale callbacks, explicit disconnect, and logout.
  • Browser QA with the real components and simulated peer RPCs confirmed unchanged address-field dimensions during editing and retained peer context/draft through outage and recovery. No screenshots are attached.
  • The contributor reported successful manual testing of the pushed branch before requesting this PR. Agent-run remote verification used simulated Peer Device Mode; no live two-device test was performed by the agent. Remote workspace, mobile/bot remote control, and detached dispatch were not exercised.
  • Broad builds and platform matrices are left to CI.
  • The first CI run found a callback forward-reference lint error. The callback now checks adapter identity to retain stale-connection isolation; focused ESLint, all 25 connection-manager tests, and check:web passed after the fix.

Reviewer Notes

The shared system service supplies an optional home directory through existing desktop and CLI get_system_info responses. Older peers without this field get an explicit unavailable hint and can still navigate by entering a path; the picker never falls back to the controller's filesystem. Recovery uses the existing ping and attach protocol without new wire requirements or persisted state changes.

AI-assisted contribution. Testing level: fully tested for the focused behavior described above; cross-platform and other remote-scenario coverage is limited as noted.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

@bobleer
bobleer merged commit 4acae91 into GCWing:main Sep 8, 2026
13 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.

1 participant