Skip to content

fix(desktop): replace stale local client sessions on restart - #322

Merged
rynfar merged 1 commit into
pylonfrom
upstream/2026-09-06-desktop-session-replacement
Sep 6, 2026
Merged

rynfar merged 1 commit into
pylonfrom
upstream/2026-09-06-desktop-session-replacement

Conversation

@rynfar

@rynfar rynfar commented Sep 6, 2026 •

Copy link
Copy Markdown
Collaborator

Restarting the desktop server could leave another stale local desktop client in Connections. A new local desktop bootstrap now replaces previous bearer sessions for the same subject and method in one transaction, while paired clients and browser sessions remain authorized.

Ports upstream eb77683e5544e071db74831bae052bbd8a7d5f88. If insertion fails, rollback keeps the previous credential valid. Session change events are emitted after persistence succeeds.

Validation: 182 focused EnvironmentAuth, SessionStore, and server router tests; server typecheck; changed-file lint. Includes simultaneous bootstrap, preservation of paired clients, and a forced insert failure.

Model: GPT-6 Astra. Harness: Codex.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.7 KiB 13.7 KiB −81 B (−0.6%) 15.1 KiB ✅
Codex Thread snapshot wire 7.1 KiB 7.1 KiB +4 B (+0.1%) 7.3 KiB ✅
Codex Live turn WebSocket wire 6.6 KiB 6.6 KiB −85 B (−1.2%) 7.8 KiB ✅
Codex Live turn WebSocket decoded 57.3 KiB 56.5 KiB −822 B (−1.4%) 66.4 KiB ✅
Codex Live turn messages 8 8 0 (0.0%) 21 ✅
Claude Total thread wire 13.6 KiB 13.8 KiB +171 B (+1.2%) 15.1 KiB ✅
Claude Thread snapshot wire 7.1 KiB 7.1 KiB −8 B (−0.1%) 7.3 KiB ✅
Claude Live turn WebSocket wire 6.5 KiB 6.7 KiB +179 B (+2.7%) 7.8 KiB ✅
Claude Live turn WebSocket decoded 57.3 KiB 58.2 KiB +928 B (+1.6%) 66.4 KiB ✅
Claude Live turn messages 8 10 +2 (+25.0%) 21 ✅

Baseline: 44b632a · PR result: cc81eca · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 111.2 KiB
  • Claude decoded thread snapshot: 111.9 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Replace stale local desktop sessions in one transaction. Preserve paired clients and browser sessions, and keep the previous credential valid if replacement fails.

Closes pingdotgg/t3code#6283.

Original implementation by seeb1337. Reviewed and verified with GPT-6 Astra (preview) in Codex.

Co-authored-by: seeb1337 <63622047+seeb1337@users.noreply.github.com>
Co-authored-by: Theo Browne <me@t3.gg>
(cherry picked from commit eb77683e5544e071db74831bae052bbd8a7d5f88)
@rynfar
rynfar force-pushed the upstream/2026-09-06-desktop-session-replacement branch from 88dd518 to cc81eca Compare September 6, 2026 16:55
@rynfar
rynfar merged commit c145a1b into pylon Sep 6, 2026
18 checks passed
@rynfar
rynfar deleted the upstream/2026-09-06-desktop-session-replacement branch September 6, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 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.

2 participants