Every agent call names the model that ran it - #146
Merged
Conversation
The column was nullable on the grounds that a call may be recorded before its model is resolved. It can't: the model is resolved fifty lines earlier than the row is written, and the harness is chosen from it — an empty one never gets that far. Two tests pinned the unresolved case. The usage panel's real requirement is in its own comment — model ids churn on deploys, so a call can carry an id no harness claims any more — and that half stays; the layout test's point is that the layout is the same whichever harness ran the call.
czpython
force-pushed
the
agent-call-names-its-model
branch
from
July 28, 2026 17:53
3eb4f39 to
7196a52
Compare
czpython
enabled auto-merge (squash)
July 28, 2026 17:53
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.
The sibling of #144.
AgentCall.modelwas nullable on stated grounds:It can't be.
_runresolvesmodel = self.get_model_name()— typed-> str—and the next line picks the harness from it, which would raise on an empty one.
AgentCall.start(model=model)is fifty lines further on, past provisioning. Sothe row is only ever written once the model is known, and
Agent.modelis arequired field with no default.
model: Mapped[str], andAgentCall.start(model: str)c71b3d95e802, no backfill for the same reasonagenthad none:a guessed model would land in the cost breakdown
seed_callandseed_note_agent_runtakemodel: strTwo tests pinned the case that can't happen
test_usage_today_counts_calls_whose_model_isnt_a_current_harnessseeded both"claude-opus-4-5"andNone. Its own comment states the real requirement —model ids churn on deploys, so a call finished earlier today can carry an id no
harness claims any more — and that half stays, along with the
unattributedbucket it lands in. The
Nonehalf went.test_agent_call_artifact_layoutseededmodel=Noneto show "the layout holdswith the model unresolved". The layout's actual rule is that it is the same
whichever harness ran the call, which is what it now says.
The usage panel keeps its
unattributedbucket either way: a pinned or churnedid that no picker list claims is a real case, and money spent must not vanish
from the display.