Every agent call names the agent that made it - #144
Merged
Conversation
The column was nullable and the response optional, with the label falling back to "Agent" — but an agent is what makes a call. The one writer is AgentCall.start(agent=self.id), and an Agent's id is either explicit or stamped from its attribute name, so nothing can produce a row without one. The migration adds the constraint with no backfill: a null here would mean a writer nobody knows about, and inventing an attribution would put it in the cost table.
An Agent built loose — never assigned to an Extension, never given an explicit id — kept the empty default, and nothing stopped it running. Its settings, its registry entry and the call it records all key on nothing, and the not-null column would have taken the blank as a name.
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.
AgentCall.agentwas nullable,AgentCallResponse.agentoptional, and theresponse's
labelfell back to the string"Agent"when it was missing.Nothing could produce that row.
The one production writer is
AgentCall.start(..., agent=self.id)(agents.py), where
selfis anAgent. Anexplicit id registers in
__post_init__; otherwise__set_name__stamps itfrom the attribute name. Even
seed_calltakesagentas a requiredpositional. So the
| None, the nullable column and the"Agent"fallbackmodelled an absence with no producer — and #142 turning
labelinto acomputed field made that dead branch read like a deliberate rule rather than
a copied default.
agent: Mapped[str], andAgentCall.start(agent: str)AgentCallResponse.agent: str;labelisget_display_label(self.agent)AgentCallSummary.agent: stringon the wire mirrora4e1f60c2b95The migration adds the constraint with no backfill. A null here would mean a
writer nobody knows about, and inventing an attribution would put it in the
cost table — the constraint should find it instead.
The blank id the constraint would have taken
Agent.iddefaults to""so__set_name__can fill it, and anAgentbuilt loose — a local, never assigned to an
Extension, never given anexplicit
id=— keeps that default.__set_name__never runs, so it neverregisters, but nothing stopped it running: it would have written
agent="",which satisfies
NOT NULLand displays as a blank timeline label.An agent with no id has no durable key — its settings overrides, its registry
entry and its calls all key on nothing — so
__call__refuses it, beside thecheck that it is inside a workflow.
Not changing
SubjectStatus.agentstaysstr | None. Its None means "no live agent call"— the driving run is parked, or has none yet — not "an unattributed call".