Repository navigation
Merged
Conversation
…t its environment (#465) Under REMEMBER_SUMMARIZER=auto, a default-configured Codex session still routed to `claude -p` -- #464's CODEX_SESSION_ID/CODEX_THREAD_ID fixture was captured from a Codex tool shell, not the SessionEnd hook process that actually spawns the summarizer, and a live capture from inside that hook (env dumped, CLAUDE_CODE_* stripped, codex-cli 0.150.1) shows neither variable survives into it. pipeline.haiku._choose_summarizer_provider() now reads REMEMBER_TRANSCRIPT_PATH and sniffs the transcript's own first line (pipeline.extract.sniff_file_envelope(), #443) instead -- what the host wrote, not what it exported. Verified against a live, default- configured `codex exec` session: SessionEnd now logs `provider: codex`. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…ed sniff failure Explore (reviewer) found pipeline/host.py's module docstring still described the summarizer as "chosen by detect_host()", directly contradicting the AMBIGUOUS-comment update three commits' worth of prose below it -- both now describe the real #465 mechanism. oss:auditor found _choose_summarizer_provider() silently collapsed "the transcript is genuinely Claude Code" and "the transcript could not be sniffed" (unreadable, deleted mid-race, or an unrecognised shape) into the same unlogged "claude" result -- indistinguishable to an operator debugging a wrongly-billed session. It now warns (via the existing _warn()) only on the "could not sniff" branch, never on the ordinary "no transcript at all" path, with positive/negative tests for both. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
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.
Closes #465
Under
REMEMBER_SUMMARIZER=auto(the default), a default-configured Codex session still summarized viaclaude -p-- exactly the outcome #460 was filed to remove, and unfixed by #463's own env-signature repair. #464's fixture (CODEX_SESSION_ID/CODEX_THREAD_ID) was captured from a Codex tool shell; the summarizer runs in a different child, the SessionEnd hook process (pipeline/haiku.py<-scripts/save-session.sh<-scripts/session-end-hook.sh). A live env dump from inside a real SessionEnd hook (CLAUDE_CODE_*stripped, codex-cli 0.150.1) shows neither variable reaches that process -- onlyPLUGIN_ROOT/CLAUDE_PLUGIN_ROOTsurvive.pipeline.haiku._choose_summarizer_provider()no longer asks the environment for a Codex signature underauto. It readsREMEMBER_TRANSCRIPT_PATH(already exported by every hook since #407) and sniffs the transcript's own first parseable line for a Codex- or Claude-Code-shaped envelope (pipeline.extract.sniff_file_envelope(), existing since #443) -- a fact the host wrote, not a promise it exported and could later withdraw.pipeline.host.detect_host()itself is unchanged and still directly tested (env-based host identification remains a correct, real fact about a process); it is simply no longer the mechanism this one call site uses.Verified live and end to end: two default-configured (
REMEMBER_SUMMARIZERunset)codex execsessions against the branch installed into the live Codex plugin cache both logged[haiku] SKIP (provider: codex) -- position -> 16-- the release condition (a default-configured Codex session logsprovider: codex) is met. Both SKIPped on trivial content (the summarizer's own judgment threshold, unrelated to detection, see #461); a live non-SKIP (appended) transition on the Codex route was not forced in this session -- see the worktree note for the gap.Self-review (Explore + oss:auditor, both run against the first commit) found two real issues, both fixed in the follow-up commit:
pipeline/host.py's module docstring still said the summarizer was "chosen bydetect_host()", directly contradicting the updated AMBIGUOUS-comment block ~120 lines below it in the same file._choose_summarizer_provider()silently collapsed "genuinely Claude Code" and "transcript unreadable/unrecognised" into the same unloggedclauderesult; it now warns (via the existing_warn()) only on the genuine "could not sniff" branch, with a positive/negative test pair.Below-bar, not filed: Explore also flagged that README.md:483 ("the summarizer,
pipeline/haiku.py, is Claude-Code-coupled by design and not touched") is stale -- true since #460 shipped provider dispatch, predates this diff, and sits next to text this diff did edit. Judged below-bar rather than filed: it is a real inaccuracy but not reachable by anything scoped to #465's own footprint without turning into a general README audit unrelated to this issue.Tests
tests/test_codex_hook_transcript_465.py-- positive control (real Codex transcript, zero Codex env signature present, resolvescodex), negative control (CODEX_SESSION_IDalone, no transcript, resolvesclaude-- the exact Codex detection still fails in the hook process: the route works under an explicit override but auto resolves to claude #465 regression), no-transcript-at-all, unusable-transcript, explicit-override-wins, plus the follow-up commit's warn/no-warn pair.tests/test_summarizer_routing_460.py(four tests' "Codex host" simulation switched fromCODEX_SESSION_IDtoREMEMBER_TRANSCRIPT_PATHpointing at the existingtests/fixtures/codex-rollout.jsonlfixture, since the env var alone no longer selects codex -- that is now itself a regression pin),tests/test_codex_signature_463.py(docstring only, notingdetect_host()is unchanged and still correctly tested but no longer this call site's mechanism).python3 .oss/assemble_changelog.py --check: ok.Docs
README.md'sREMEMBER_SUMMARIZERrow updated to describe the transcript-based mechanism.changelog.d/465.fixed.mdadded.Generated with Claude Code