Skip to content

fix: recover stale thread state and transferred sessions - #52

Draft
jimprince wants to merge 120 commits into
mainfrom
fix/refresh-pending-thread-recovery-v2
Draft

fix: recover stale thread state and transferred sessions#52
jimprince wants to merge 120 commits into
mainfrom
fix/refresh-pending-thread-recovery-v2

Conversation

@jimprince

Copy link
Copy Markdown
Owner

What changed

  • recover stale approval and user-input response failures after a refresh instead of leaving the thread session stuck in running
  • share the recovery path so session readiness, active turn state, error details, and failure activity stay consistent
  • make route recovery use the explicit client runtime import
  • discard non-portable provider resume cursors during cross-machine thread moves while preserving Claude cursors only when their session transcript was transferred
  • add regression coverage for stale pending responses and provider cursor portability

Why

A response could become stale while the client was disconnected. On refresh, the server recorded the failure activity but left the session running indefinitely. Separately, a moved Codex thread retained the source machine's rollout id, so the first target-side follow-up failed with no rollout found even though the UI warned that native provider context would start fresh.

Impact

Refreshed threads now recover to a usable ready state with an actionable error, and cross-machine moves can continue on the target with a fresh provider session when native context is not portable.

Validation

  • vp check (passes with 10 pre-existing warnings)
  • vp run typecheck
  • focused route recovery, provider reactor, and thread transfer tests
  • real Mac → Linux smoke test: transferred branch/history, tracked patch, and untracked file; completed a new target-side Codex turn; archived the source only after success

The root vp test run was also exercised: 4,847 tests passed; 7 unrelated baseline/root-runner failures remained (isolated affected suites pass where applicable).

github-actions Bot and others added 30 commits July 12, 2026 13:24
Upstream added a `relay_public_config` job + artifact-based relay client
tracing to release.yml, with infra/relay/scripts/deploy.test.ts asserting
it. The fork ships a minimal release.yml that intentionally omits relay
observability (it does not deploy the managed T3 Connect relay), so the
upstream assertion cannot hold. Narrow that test to the part that applies
to the fork — guard against the insecure masked cross-job token output —
and drop the requirement for upstream's artifact mechanism. Add the test
to the fork-owned auto-resolve allowlist so future upstream syncs keep the
fork's version instead of re-conflicting.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
`re-probes when settings change the codex binaryPath` polled the injected
spawner while advancing TestClock, which can drive additional background
provider-refresh probes under slower CI scheduling. The exact
`spawnedCommands` deepStrictEqual was therefore non-deterministic (CI saw
3-4 spawns vs the expected 2), failing the CI Test job and the Release
preflight. Assert the observable settings-change behavior — boot probes the
original binary and the changed binaryPath is re-probed afterward — and rely
on the dedicated boot-refresh tests for the no-extra-refresh guarantee.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The fork's signed macOS path requires an Associated Domains provisioning
profile + Clerk passkey config that isn't set up (and isn't needed for
personal-use builds). Require the profile/team id for the signed path and
otherwise fall back to an unsigned macOS artifact instead of failing the
release.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Jul 13, 2026
@jimprince
jimprince force-pushed the main branch 11 times, most recently from bb56335 to b7e622c Compare July 20, 2026 03:24
@jimprince
jimprince force-pushed the main branch 17 times, most recently from 9a392a2 to 49e8b59 Compare July 28, 2026 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant