fix(events): give agent events distinct types instead of collapsing them (#1116) - #1136
Conversation
…hem (#1116) The bridge classified every agent event with a substring test: AGENT_STEP_STARTED if "started" in event_type else AGENT_STEP_COMPLETED So a skipped file, a failed step and a completed step all arrived as AGENT_STEP_COMPLETED. One run produced 192 such console lines, and three consecutive lines for the same path in the same second were three different underlying events. The worst part is not the noise: verification_failed, execution_failed and step_failed were all reported as COMPLETED. A failure showing up as a success in the log QUICKSTART tells users to consult when a run fails. - New EventTypes AGENT_STEP_SKIPPED, AGENT_STEP_FAILED, and AGENT_EVENT for anything unmapped. An unknown event is not a completed one. - _agent_event_to_event_type classifies on the outcome suffix rather than an exhaustive table: the agent vocabulary is consistently <thing>_<outcome> (step_*, planning_*, verification_*, self_correction_*, iterations_*), so all 20 real names classify correctly and a new one will too without this list being maintained. blocker_created / escalation_blocker_created are explicit overrides onto BLOCKER_CREATED. - The console now prints the real agent event type. It was in the payload as `agent_event` the whole time, but print_event whitelists which payload keys it renders and that key was not in the list — which is why the terminal could not tell the three same-path lines apart. 30 tests, including every known agent event name and one asserting that no known failure event can read as a completion. Full suite: 6381 passed, 49 skipped — nothing depended on the old collapse.
|
Claude finished @frankbria's task in 5m 10s —— View job GLM precision bug-hunt review — PR #1136Scope: logic errors, crash/null paths, security, data loss/races, breaking contract changes, resource leaks. (Style, architecture, naming, coverage are covered by the other reviewer.) ✅ GLM review: no defects found. What I verified against the checked-out code, not just the diff:
The one behavioral change worth naming (not a defect): names that previously collapsed to |
ReviewGood fix for the core bug: However, the classifier misses part of the real vocabulary emitted by the legacy 1. 2. Both of these are pre-existing Other notes
Nothing here blocks the merge — the PR is a clear improvement over the substring test it replaces — but the two gaps above mean the "no failure event reads as completed" guarantee isn't quite as complete as the PR description claims, and |

Closes #1116.
The classifier was one substring test
Everything that was not "started" was "completed" — 192
AGENT_STEP_COMPLETEDconsole lines in one run, three of them for the same path in the same second
representing three different events.
The noise is not the worst part.
verification_failed,execution_failedand
step_failedwere all reported asAGENT_STEP_COMPLETED— a failure showingup as a success in the event log
docs/QUICKSTART.mdtells users to consult whena run fails. There is now a test asserting no known failure event can read as a
completion.
Suffix classification, not a lookup table
The agent vocabulary is consistently
<thing>_<outcome>:So classifying on the outcome suffix gets all 20 right, and a new event name
classifies correctly without anyone remembering to update a table — which is the
failure mode a hard-coded map would have.
blocker_createdandescalation_blocker_createdare explicit overrides onto the existingBLOCKER_CREATED.Unmapped names get the new
AGENT_EVENT. An unknown event is not a completedone, and pretending otherwise is exactly what hid the failures.
The console fix was elsewhere
The real type was in the payload as
agent_eventall along.print_eventwhitelists which payload keys it renders and that key was not in the list, so the
terminal genuinely could not distinguish the lines. Adding it makes the reported
output readable:
Acceptance criteria
EventTypes (started / completed / skipped / failed), not a substring test30 tests.
ruffclean. Full suite: 6381 passed, 49 skipped — nothingdepended on the old collapse.
Note
AGENT_STEP_SKIPPED,AGENT_STEP_FAILEDandAGENT_EVENTare new values on theEventTypeconstant class. They are additive — no existing value changed meaning— but anything consuming the event stream and matching on
AGENT_STEP_COMPLETEDwill now see fewer of them and some new names. That is the point of the change,
and the web UI reads
event_typegenerically rather than matching thesespecific values.