Repository navigation
Conversation
Codex has no SessionEnd, so a Codex trace was only ever closed by the stale sweep: at the next Codex session start, at least an hour after the session was last seen, with spans that end then. The Rius receiver now refuses a span it gets more than an hour after its end (argus-core #677), so every Codex root would stay pending for good. The heartbeat pinger already watches the Codex process. When it sees it exit, it now closes the trace at once (exporter.close_exited_codex): it reads what the rollout holds past the last hook, so a Stop export that has not taken the lock yet loses nothing, then closes every open span ending at the exit, as a Claude Code trace ends at its SessionEnd. Only traces opened with the key in force are touched, as in the sweep. The sweep stays for a session no pinger watched.
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.
Why
Codex has no SessionEnd, so a Codex trace is closed only by the stale sweep. The sweep runs at the next Codex session start, at least an hour after the session was last seen, and sends spans that end at that last-seen time.
The Rius receiver now refuses a span it receives more than an hour after the span ended (glassflow/argus-core#677). Every Codex closing span arrives later than that, so every Codex root span would stay pending for good, and the trace never counts as finished.
What
exporter.close_exited_codex.Tests
heartbeat.py --agent codexprocess watching a stand-in Codex process, against a local OTLP receiver, after a real Stop export.codex sessionand subagent roots arrived immediately, ending 0.08s after the exit.python -m pytest -qon 3.12 gives 2176 passed, 1 skipped.