Repository navigation
Stream live span operations directly to routes and reclaim delivered payloads - #218
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Stephen Belanger (Qard)
requested review from
Abhijeet Prasad (AbhiPrasad) and
Andrew Kent (realark)
October 26, 2026 17:53
Abhijeet Prasad (AbhiPrasad)
approved these changes
Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Long coding-agent sessions could retain delivered trace payloads and per-span metadata indefinitely. This change shares live span data across routes, removes stored payloads after every route reports them, and releases completed tool and origin metadata. Completed-span and late-merge IDs stay in a disk index so resident memory tracks pending work instead of session history.
Delivery batches collect for up to 30 seconds or 256 KiB. Turn-end flushes, explicit flushes, and shutdown bypass the timer. Shutdown keeps shared storage open until every route finishes and releases each route's sink before returning.
New destinations receive retained and future operations. Use transcript import for history already reclaimed. SQLite reuses freed payload space; event journals and transcripts continue recording session history.
Matched ten-session, ten-minute profiles completed 1,001 turns each: tool-correlation allocations fell from 39.45 to 0.06 MiB and direct ledger allocations from 3.93 to 0.03 MiB, with no failed hooks or retained SpanOps. A separate transcript-driven cache probe processed 788 turns; its late live heap stayed near 10 MiB and RSS near 39 MiB. Higher hook rates can still outpace translation and accumulate durable input; those overloaded runs do not establish a memory plateau.
Validation: 593 daemon tests pass locally with four test threads, with five optional agent tests ignored. Real Claude and Codex CLI tests also pass against local mock inference and ingestion. Strict Clippy and formatting pass. Recovery, failed index writes, legacy upgrades, cross-process deduplication, and shutdown ownership are covered; the previously failing retirement test passed 15 consecutive runs after the shutdown fix.