Repository navigation
Fix routing smoke assertions: attribute agent traffic by model instead of nonexistent purpose values - #67595
Conversation
… purpose Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>
purpose values
|
✅ Ponytail Reviewer completed successfully!
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
🔍 Design Decision Gate 🏗️ is checking for design decision records on this pull request... |
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff
|
|
✅ Smoke Copilot Routed completed successfully!
|
|
✅ Smoke Pi Routed completed successfully!
|
|
✅ Smoke Copilot SDK Routed completed successfully!
|
There was a problem hiding this comment.
One removable speculative attribution layer found.
net: -20 lines possible.
Generated by ✂️ Ponytail Reviewer for #67595 · codex · gpt56 · 12 AIC · ⌖ 5.16 AIC · ⊞ 13.5K
Comment /ponytail to run again
There was a problem hiding this comment.
🟡 Changes recommended
Duplicate sub-agent models remain ambiguous and can let one request satisfy multiple S3 checks.
1 open finding
What changed in this PR
Fixes routing smoke assertions to classify real AWF traffic correctly and updates the Pi smoke configuration.
Changes:
- Attributes non-classifier requests by correlation or model.
- Adds real-shape fixtures and negative coverage.
- Restricts Pi routing candidates and recompiles its lock file.
| File | Description |
|---|---|
actions/setup/js/smoke_model_routing_assertions.cjs |
Revises request attribution and checks. |
actions/setup/js/smoke_model_routing_assertions.test.cjs |
Expands realistic assertion coverage. |
.github/workflows/smoke-pi-routed.md |
Restricts routed models to Luna. |
.github/workflows/smoke-pi-routed.lock.yml |
Regenerates the compiled workflow. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Unable to submit full review body from the sandbox.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 45.8 AIC · ⌖ 5.33 AIC · ⊞ 21.2K
Comment /review to run again
|
Ran the three routing smokes on this PR's code (
On the two open review threads:
|
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs (root-cause bug fix) and /tdd (test rebuild). The fix correctly diagnoses the root cause — AWF never writes purpose: "agent"/"subagent", only purpose: "routing_classification" for the classifier — and switches to model-based attribution with session-correlation fallback. Comprehensive negative-variant tests were rebuilt from real production fixtures (runs 38097181601/38096990663/38100426674), covering dated model IDs, query-string endpoints, empty-request failure modes, and the new C1 disjointness check.
📋 Key Themes & Highlights
Key Themes
- One actionable correctness gap: model-based attribution (
attributedinsmoke_model_routing_assertions.cjs) doesn't guard against two declared sub-agents sharing the same model — left an inline comment with a concrete fix suggestion (extend C1, or add a regression test documenting the behavior).
Positive Highlights
- ✅ Root cause correctly diagnosed against real AWF record shapes, not just symptom patched
- ✅ Test suite rebuilt against actual production fixtures rather than synthetic approximations, closing the gap that let the original bug ship
- ✅ New C1 check and empty-request failure modes (R3/R4/M1/S3) add real coverage that was previously silently passing on zero requests
- ✅ Doc comment at the top of the file clearly explains the new attribution model for future maintainers
No blocking issues; approving with one actionable suggestion for the author to consider.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 99.8 AIC · ⌖ 14.6 AIC · ⊞ 10.3K
Comment /matt to run again
Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>
|
Re-ran the three routing smokes on
Blocking (flakiness): the scheduled smoke will fail randomly whenever the model leaves out |
|
✅ Smoke Copilot SDK Routed completed successfully!
|
|
✅ Smoke Copilot Routed completed successfully!
|
|
✅ Smoke Pi Routed completed successfully!
|
…one retry Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>
Fixed in d424c96. In I left I haven't re-run the smokes on this commit. |
|
Verified
The helper's unit tests pass (46). Review threads are resolved. The earlier SDK smoke failure (the model called |

Important
Before merging, a maintainer must add the
smoke-routinglabel. That runs Smoke Copilot Routed, Smoke Pi Routed and Smoke Copilot SDK Routed on this PR's code. They have not run on it yet.All three routing smokes fail on main in the post-step only. Routing and sub-agent delegation were correct.
smoke_model_routing_assertions.cjscounted only token-usage records withpurpose: "agent"or"subagent", but AWF never writes those values. The onlypurposeAWF records isrouting_classification. As a result R3, M1 and S3 had nothing to match, and R4 passed on zero requests.Request classification (
smoke_model_routing_assertions.cjs)purpose: "routing_classification"is the classifier (R2). Every other record is agent traffic.x_initiatoris only the billing class, so it is not used.subagent.*events or a sub-agent ID on proxy records. Today there is none, so model matching is what runs.allowedModels, because model-based attribution would then be ambiguous.claude-haiku-4-5-20251001becomesclaude-haiku-4.5, and/v1/messages?beta=truebecomes/v1/messages.Records as AWF writes them (from Smoke Pi Routed):
{"model":"gpt-5.6-luna","path":"/responses","status":200,"purpose":"routing_classification","x_initiator":"agent"} {"model":"gpt-5.6-luna","path":"/responses","status":200,"x_initiator":"agent"} {"model":"claude-haiku-4-5-20251001","path":"/v1/messages?beta=true","status":200,"x_initiator":"agent"} {"model":"gpt-5.4-mini-2026-03-17","path":"/responses","status":200,"x_initiator":"agent"}These now resolve to: the classifier (R2), the main agent (R3, R4),
haiku-whoami(S3) andmini-whoami(S3).smoke-pi-routed.mdallowed-modelsand the post-stepallowedModelsare reduced to[gpt-5.6-luna], matchingsmoke-copilot-sdk-routed. The sub-agent models can no longer be routing selections, which satisfies C1. The lock file is recompiled.smoke-copilot-routed.mdandsmoke-copilot-sdk-routed.mdare unchanged.Tests
agentartifact'stoken-usage.jsonland events fromusage/aw_session.jsonl. They include:purposeagentId, with a secondsubagent.completedmarkedcancelled: true. S2 is deliberately not tightened.purposecannot satisfy R3.Scope
Only the assertion helper, its tests and the Pi smoke config change. Routing, harness, AWF configuration and audit behavior are untouched.