Repository navigation
fix(ingest): keep the model Codex reports, and stop calling it OpenAI - #390
Merged
Merged
Conversation
The Codex hook sent the model as a nested `model` object that ExternalIngestBody did not declare, so pydantic dropped it over HTTP and the event recorded `codex` as both model and provider. On the dogfood machine that was 4,175 Codex events against 130 with a real name. The spool replay skips that route, so the same call could record different values depending on whether the receiver was up. The roundtrip guard missed it because it only ran the Claude mapper, which sends no model. This is the fourth field lost this way. The hook also hardcoded provider "openai", which fixing the drop alone would have spread: Codex can use any endpoint, so a GLM model would have been labelled OpenAI. It now states no provider, and model.provider falls back to the source app as it does for other agents. A `model` of the wrong shape is ignored rather than refused, because the field was ignored while undeclared and declaring it must not start losing events. The length bound sits in external.py, which both paths reach. Fixes #389. model.id and model.provider are read by AiSOC's template. They are not renamed or moved, but Codex values change, so announce this there before release. Inferred approval events still carry no model, and older records are not rewritten. Fingerprint unchanged at 15846a0915769d4a. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #389.
What was wrong
The Codex hook reads the reported model and sends it as a nested
modelobject.ExternalIngestBodydid not declaremodel, so it was dropped over HTTP and the event recordedcodexas both model and provider. The spool replay skips that route, so the same call could record different values depending on whether the receiver was up.The hook also hardcoded
provider: "openai". Codex can use any endpoint, so fixing the drop alone would have labelled a GLM model as OpenAI.What changed
glm-5.3{"id": "codex", "provider": "codex"}{"id": "glm-5.3", "provider": "codex"}{"id": "glm-5.3", "provider": "openai"}{"id": "glm-5.3", "provider": "codex"}ExternalIngestBodydeclaresmodel. A wrong-shaped value is ignored rather than refused, because the field was ignored while undeclared.map_codex_hookstates no provider, andmodel.providerfalls back to the source app as it does for other agents.external.py, so the cap covers both paths.codexthere means "not reported", and neither field shows what actually served the request.Consumers
AiSOC's template reads
model.idandmodel.provider. They are not renamed or moved, but the values change for Codex events, so the schema doc's promise means announcing this in the AiSOC discussion before it ships. That has not been posted. Tenzir's listed fields do not include them.Not in this PR
codex_inferred) are generated without a model and still saycodex.model.idcan still hold an agent's name.Checks
Run locally on this branch, before a final edit to one code comment. After that edit, the two changed test files and ruff were rerun.
CLAUDE.mdlists for the dogfood machine:test_arguments_sent_as_a_json_string_are_enriched,test_the_cli_rotates_lists_and_verifiesand the README count (2125 expected, 2127 collected locally). Their messages match, but they were not re-run with.envmoved aside, so CI is the check on those.15846a0915769d4a, unchanged. No frozen file is touched.drain_spool.🤖 Generated with Claude Code