Skip to content

fix(cloud): every cloud chat hears where heavy work belongs, not only brand-new ones - #196

Merged
andrewcai8 merged 1 commit into
mainfrom
fix/cloud-note-every-session
Oct 7, 2026
Merged

andrewcai8 merged 1 commit into
mainfrom
fix/cloud-note-every-session

Conversation

@andrewcai8

Copy link
Copy Markdown
Owner

A disk census of 11 awake cloud chats (73 GB disks) found the 4 recent chats at about 31 GB with one worktree each. The 7 long-running chats that started before the cloud machine note existed sat at 36 to 61 GB, with 5 to 20 worktrees, up to 17 GB under ~/.t3/worktrees, up to 13 GB in /tmp, and 20 to 71 node_modules directories. They run a build that has the note, but it went only to the first turn of a brand-new native conversation, so they never got it. A long chat can also lose turn-1 context to compaction.

The note now goes on the first turn of each provider session for a native thread. That covers a new chat, a wake, an upgrade restart, an account switch, and a session reopened after 30 idle minutes. cloudMachineNoteFor records which native threads each live session runtime has told, in a WeakMap keyed by the runtime object that ProviderSessionManager.open returns. A new session gets a new runtime object and hears the note again, and the record is dropped along with the session. The other gates are unchanged: cloud box only, never subagents, and the forks sentence only with MCP tools off darwin. The note also gains one sentence asking the agent to remove worktrees, installs and /tmp data it created once it no longer needs them. lowDiskNote is unchanged.

Tests: DiskHeadroom.test.ts checks that a session hears the note on its first turn but not its second, that the session's other native threads and a new session hear it again, and that subagents never do. ProviderTurnStartService.test.ts checks that a native thread that already has turns hears the note when a new session starts. Both failed before the change.

Claude Opus 5.5 (1M context), Claude Code

🤖 Generated with Claude Code

… brand-new ones

The cloud machine note went only to the first turn of a brand-new native
conversation, so chats that began before it existed, or lost it to
compaction, never heard it. It now goes on the first turn of each provider
session for a native thread, tracked per live session runtime, and also
asks the agent to remove worktrees, installs and /tmp data it no longer
needs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@andrewcai8
andrewcai8 enabled auto-merge (squash) October 7, 2026 15:35
@github-actions github-actions Bot added size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Oct 7, 2026
@andrewcai8
andrewcai8 merged commit d677a5a into main Oct 7, 2026
25 checks passed
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 4.9 KiB 5.0 KiB +23 B (+0.5%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB +23 B (+1.9%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 20.8 KiB 20.9 KiB +41 B (+0.2%) 29.3 KiB ✅
Codex Live turn messages 1 2 +1 (+100.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB −24 B (−0.5%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB −24 B (−2.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB −41 B (−0.2%) 29.3 KiB ✅
Claude Live turn messages 2 1 −1 (−50.0%) 8 ✅

Baseline: bc068c7 · PR result: 33f9226 · 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: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

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

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.

1 participant