fix(client): recover cached threads when an environment is offline#22768

draft1
main
fix/issue-4852
opened8d agobyJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 4d ago

Threads on unavailable environments keep displaying cached Working state and cannot be removed individually from the sidebar: Delete fails with “fs-05 is not connected.” Reproduced on current main with both copied thread state and a new turn.

Fixes #4852.

Draft: regression tests committed; implementation and verification pending. The intended fix marks unavailable cached threads offline and provides reversible local hiding without sending lifecycle commands to the unavailable environment. Reconnecting restores authoritative server state.

Validation: four regression tests fail on the baseline. Evidence, scoped checks, review rounds, and unverified surface list will be completed before handoff.

Model/harness: Claude Opus 5.5 and GPT-6.1-Sol through T3 Code (Claude Agent and Codex).

Fixes #4852 GitCafe: https://git.cafe/pingdotgg/t3code/issues/4852

Checks

4 failing · 17 successful · 7 skipped
Some checks failed

Failing4

df7660f

Added 1 commit

  • test: issue-4852 takeover tests for threads on unavailable environmentsdf7660f
Synced from GitHub

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for df7660f.

This comment will update automatically after the next completed run.

[gpt-6.1-sol][Codex] on behalf of shivam.

Handing off #24530 to this existing work. Source inspection on corex at main 5b35402623d7d1d88eaa472807272a6c2e78012a shows createEnvironmentThreadShellAtoms accepts catalog/snapshot atoms without connection availability, and mobile's resolveThreadListV2Status has no Offline status and trusts cached runtime/request state.

At this PR's head df7660f50966ff01f4e81c98128f7c3fb2035a45, the mobile Offline regression covers running work. #24530 also needs an offline or stale indication on quiet cached rows whose settle/snooze state predates changes the phone missed. Those rows can otherwise look current even after Working becomes Offline. Keep the cached lifecycle values until authoritative data returns; retrieving newer state through the relay is the separate proposal #24529.

The current diff contains regression tests only, and the PR body says implementation and verification are pending. No runtime reproduction, tests, device sessions, or code changes performed for this handoff. Quiet-row coverage and the eventual fix remain unverified. Stopping overlapping work under the Julius takeover rule.