Repository navigation
Let agents compact their own thread, and keep what T3 knows across it #39106
mikenrafter
started this conversation in
Ideas
Replies: 1 comment 2 replies
|
Strong +1 Coming from Claude Code where community self-compact / handoff-compact mods are super useful, having this natively in T3 Code would be a huge win, especially for Antigravity (and other providers) that don't have an in-process mod ecosystem like Claude Code. Two small additions that would make this work great across all providers:
Having this once in T3's orchestration layer instead of relying on per-CLI mods would solve the problem cleanly for every provider. |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
An agent running a long task knows better moments to compact than the context window does: between two steps, once every decision is written to a file. Auto-compaction cuts wherever the window fills, often mid-step. Idle compaction (#37519) and compaction before a usage limit (#27742) cover a thread that is waiting, not a busy agent that sees a good moment coming.
Today an agent does this by sending two messages to its own thread with
t3_thread_sendinqueuemode:/compact <focus>, then a resume message, because a compaction does not start a new turn. That works, but it breaks in known ways:/compactdrops the queued resume message, and the thread stays idle ([Bug]: A /compact cut by a server restart never resumes, and the message queued behind it never starts #30206)./compact <instructions>sent with the Compact chip on runs two compactions, and the first ignores the instructions ([Bug]:/compact <instructions>sent with the Compact chip on runs two compactions, and the first one ignores the instructions #20222).Proposal:
t3_thread_compactAn MCP tool an agent calls during its turn:
When the turn ends, T3 compacts the thread steered by
focus, then starts a turn withresume. The two are one queued operation, so a restart resumes or retries both rather than dropping the second. The resume turn is told whether the compaction succeeded.Re-inject what T3 already knows
The summary is written by the model and drops what it didn't know mattered. T3 holds some of that state itself, so it could add it to the first turn after any compaction (agent-driven, idle or automatic), the way it re-delivers its own instructions to some providers (#21036, #38602, #24740):
t3_thread_send, passing thedelegate-task:…task id it had in its notes. It gotthread_not_foundand concluded the child was unreachable. The child was running underthread:delegated-task:….Smaller fix in the same area
When a
t3_thread_sendort3_thread_readtarget matches a delegated task id,thread_not_foundcould name the task's child thread, the same way #31946 points agents at linked environments. This one could also be a bug report on its own.Happy to send a PR for any part of this.
All reactions