The local trace file burned through its whole 100 MB rotation window in
10-36 minutes, which made incident audits impossible: by the time a
slow-PR-badge report came in, the relevant spans were already rotated
away. Two sources dominated: the terminal subprocess poller (~40% of
bytes: pgrep + up to three ps spawns per session per second, each a full
process-table enumeration) and sql.execute spans (~28%).
Write less:
- One shared ps/powershell process-table snapshot per poll tick serves
every running terminal; per-session inspection is now pure lookup.
This also removes 50-75 process spawns/sec on busy hosts.
- The poll tick runs untraced; an explicit
terminal.subprocessActivityChanged span fires only on a real state
flip.
- Tail policy in the local file tracer: failures, interruptions, spans
with events, and slow spans always persist; fast successes are
rate-limited per span name (50 per 30s). OTLP delegate still sees
every span. T3CODE_TRACE_KEEP_ALL_SPANS=true restores full fidelity.
- Dropped constant db.name/service.name attributes from every
sql.execute span.
Keep more:
- Rotated trace backups are gzipped (measured 10.6x on real span data)
and T3CODE_TRACE_MAX_FILES now defaults to 30, so the same disk
budget covers hours.
- TraceDiagnostics reads backups one file at a time (instead of
slurping every rotation into memory) and transparently gunzips .gz
backups; plain legacy backups still age along the chain.
Co-Authored-By: Claude Fable 5 <[email protected]>
Bugbot flagged that clients collapse only adjacent lifecycle rows, so
dropping a superseded update separated by an interleaved parallel call
diverges from full-history rendering. Measured on a real database: 1.5%
of dropped rows (553/36,581), all pure in-flight state whose final result
the retained completion still shows, and zero dropped rows carry a
client-merged payload field their completion lacks (verified across all
49,515 update rows). Documents the tradeoff and adds a test pinning it.
Co-Authored-By: Claude Fable 5 <[email protected]>
A tool.updated row is the in-flight snapshot of a call; once the call
completes, the tool.completed row carries the final state and both
clients fold every matching update into it. Shipping the updates buys
nothing: 47k such rows exist in one real database, and a single thread
carries 3,291 of them.
Filter them out of thread snapshots, mirroring the existing
context-window dedup. Matching is per turn and only against a LATER
completion, so a revert that discards the completing turn cannot leave
a call unrepresented, and a later update under the same identity (the
next call, still in flight) survives. Live events are untouched.
Rows are matched on the same identity the clients collapse by: an
explicit data.toolCallId when the adapter emits one, otherwise the
itemType/title/detail triple. No tool lifecycle row in the real db
carries a toolCallId, so the fallback does the work.
Co-Authored-By: Claude Fable 5 <[email protected]>
A pending update in the launcher state is not proof a replacement
server is coming: `t3 service uninstall` or `systemctl stop` during
the pending window also tears the server down, permanently. The
launcher now writes a stop marker before signalling its child on an
explicit stop and clears it on the next start; the shutdown tunnel
release keeps the tunnel only for pending updates without the marker.
Co-Authored-By: Claude Fable 5 <[email protected]>
Measured on a live update: the server was back in ~9s but stayed
unreachable for ~96s, because releasing the tunnel on shutdown forces
the replacement tunnel's hostname route through 1-2 minutes of edge
propagation. An update handoff always brings a server right back
(new version or rollback), so the tunnel is never orphaned; skip the
release when the launcher state file records a pending update. The
next boot respawns the connector from the stored config against the
same tunnel and is reachable as soon as it connects.
Co-Authored-By: Claude Fable 5 <[email protected]>