Repository navigation
Record failed model.resolution for Pi sub-agents whose model fails the /reflect check - #70385
Conversation
…eflect availability Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Design Decision Gate 🏗️Outcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
There was a problem hiding this comment.
Review summary
No actionable blocking issues found in the changed lines. The new failure-recording path consistently replaces prior sub-agent resolution records, handles routed and unrouted execution, and the added tests cover live, unavailable, mixed, and shared-model cases. Static review only; tests were not run.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · 2.86 AIC · ⌖ 0.489 AIC · ⊞ 1.6K
Comment /review to run again
|
Verification at
Ready for review. |
There was a problem hiding this comment.
🔵 Needs a closer look
Required end-to-end smoke evidence confirming session records and U3 failure reporting remains pending.
No open issues 🎉
What changed in this PR
Corrects Pi sub-agent model-resolution reporting when /reflect rejects a model, addressing #70384.
Changes:
- Marks every role sharing the unavailable model as failed before rethrowing.
- Adds regression coverage for routed/unrouted runs, live models, declaration order, and shared models.
- Adds the recorded
/reflectfixture from run 39325995892.
| File | Description |
|---|---|
actions/setup/js/pi_models_json.test.cjs |
Tests sub-agent resolution records across availability scenarios. |
actions/setup/js/pi_models_json.cjs |
Replaces successful resolution records when availability validation fails. |
actions/setup/js/fixtures/awf-reflect-pi-routed-39325995892.json |
Supplies the recorded model catalogue for regression tests. |
Review effort: Max
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /tdd and /codebase-design on the two changed hunks in pi_models_json.cjs and the new sub-agent test suite. The fix is correctly scoped (replaces the stale exact record via the existing engine+role dedupe in recordModelResolution, and correctly omits the !routingRequired guard that the main-model path has, since routed sub-agent records should still be written). One test-coverage gap and one maintainability concern below; both are fixable without redesigning the change.
📋 Key Themes & Highlights
Key Themes
-
Untested fallback branch: the
failed.declaredModel ||${nativeProvider}/${modelId}`` fallback inpi_models_json.cjs:545(used when a sub-agent inherits the parent model) has no covering test — all four new cases pin `declaredModel` explicitly. -
Re-derived value instead of reused value: that same fallback reconstructs a string (
${nativeProvider}/${modelId}) thatpreparePiSubagentsalready computed once asrequested/parentModel, but never attached to the returned agent object. Reusing it instead of re-deriving it would remove a source of future drift.
Positive Highlights
- ✅ Correctly reuses the existing
engine+rolereplace-not-append semantics inrecordModelResolution, so themodel.resolution“one event per role” contract (T-UAS-074 in the unified-session spec) still holds. - ✅ Deliberately diverges from the main-model path by omitting the
!routingRequiredguard, with a clear rationale in the PR description and inline comment, and the routed case (run 39325995892) is exactly the real-world scenario it fixes. - ✅ "Mark every sub-agent sharing the dead model failed" and "only the dead one, not the live one" are both tested, closing the gap the PR description calls out explicitly.
- ✅ Good provenance: the recorded
/reflectfixture and run links give concrete evidence for the pinned-model-retirement scenario.
Note on scope
The PR description flags the end-to-end smoke-pi-routed run as not yet done. That's a reasonable gap to leave for a follow-up since the unit tests already exercise the exact recorded fixture from the failing run, but it's worth confirming before merge per the author's own checklist.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 139.8 AIC · ⌖ 15.1 AIC · ⊞ 10.2K
Comment /matt to run again
Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>
Done in 12ef285. The fallback is now
|
|
@copilot address the following outstanding work in one pass:
Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI. Sous-chef state: f98fb736bd61b24beaebe622171e52e768ab0e9ecd8581ff966470699c020b18
|
…-model-resolution Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Merged latest main using |
When a Pi sub-agent's model fails the
/reflectliveness check, Pi aborts startup. However, the session'smodel.resolutionstill says the model resolved (exact). This was seen in run 39325995892, wheremini-whoamiis pinned to the retiredcopilot/gpt-5.4-mini.preparePiSubagentsrecords the resolution before the liveness check runs, and the sub-agent loop never replaced that record when the check failed. The main-model path already handles this case.Change (
actions/setup/js/pi_models_json.cjs)ModelAliasResolutionErrorfromvalidatePiModelAvailabilitynow recordsfailedfor the role, then rethrows:configured_modelas the earlier record, sorecordModelResolutionreplaces theexactrecord instead of adding a second one.!routingRequiredguard. Sub-agent records are written in routed runs too, and run 39325995892 was routed.modelIdmatches the failing id is markedfailed. The loop checks each model id only once (seen), so without this a second role on the same dead model would keepexact.exactmeaning are unchanged.Tests (
pi_models_json.test.cjs)fixtures/awf-reflect-pi-routed-39325995892.jsonis the realsandbox/firewall/awf-reflect.jsonfrom that run's agent artifact, reformatted withjq .. Content is unchanged:models_fetch_complete: true, and 36 Copilot models with nogpt-5.4-mini.failed/model_unavailable, in routed and unrouted runs.claude-haiku-4.5) staysexact.failed, in both declaration orders. The order is set by the test (pinnedreaddirSync), because directory order depends on the filesystem.failed.Not yet done
smoke-pi-routedstill needs to be run on this branch, and the run URL added here. Expected result: startup fails,mini-whoamiisfailed/model_unavailable, and U3 fails with that cause.