Skip to content

Preserve AWF model inventories with null endpoints and live reasoning metadata (G-7) - #70013

Merged
pelikhan merged 5 commits into
mainfrom
copilot/g-7-preserve-awf-model-inventories
Oct 19, 2026
Merged

pelikhan merged 5 commits into
mainfrom
copilot/g-7-preserve-awf-model-inventories

Conversation

Copilot AI commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

The unified session collector rejected a whole AWF /reflect snapshot whenever any endpoint had routing_models: null. Unconfigured endpoints therefore discarded the configured endpoint's live model list, and the collector recorded invalid_model_inventory with no model.inventory event. All six sampled smoke runs show this. When the collector did accept a snapshot, the projection lost information:

  • a null model list became [];
  • configured was dropped;
  • reasoning-effort and context-window metadata were discarded.

Normalizer (unified_session_payload.cjs)

  • Null lists are unknown, not empty. A null or absent models or routing_models is now omitted, and the rest of the inventory is kept.
    • A null models is accepted only on an endpoint that supplies a boolean configured, so the { provider }-only inputs that were malformed before are still rejected.
    • A supplied empty array stays empty.
  • No top-level fallback for an explicit null. An endpoint-local routing_models: null does not inherit the top-level routing list. Only an absent endpoint field does, as before.
  • New fields kept:
    • endpoint configured (both true and false);
    • routing supportedReasoningEfforts: identifier tokens matching ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$;
    • routing contextWindowTokens: positive safe integers only, and omitted when null.
  • Still rejected: wrong collection types, non-string or blank model IDs, a non-boolean configured, and invalid efforts or context windows. Each still produces invalid_model_inventory and no event.
  • Idempotent: the projection accepts its own output and survives a JSON round trip. It remains an allowlist, so URLs, credentials, pricing, source and candidate_metadata_complete are excluded.

Recorded run 38995410124 now projects as:

{ "endpoints": [
    { "provider": "openai", "configured": false },          // previously: whole snapshot rejected
    { "provider": "anthropic", "configured": false },
    { "provider": "copilot", "configured": true, "models": [/* 40 */],
      "routingModels": [{ "modelId": "claude-haiku-5.5",
        "supportedEndpoints": ["/v1/messages", "/chat/completions"],
        "supportedReasoningEfforts": ["low", "medium", "high", "xhigh", "max"],
        "contextWindowTokens": 1000000 } /* … 40 */] },
    { "provider": "gemini", "configured": false },
    { "provider": "vertex", "configured": false } ],
  "modelsFetchComplete": true }

Contract

  • ModelInventoryData in types/unified_session.d.ts is updated, and unified-session.schema.json is regenerated. Endpoint models is no longer required.
  • The spec moves to 2.0.0 with new requirement T-UAS-075, a compliance row and a change-log entry. It is a major bump because endpoint models is now optional, which removes an existing reader guarantee. session.format stays at 1.

Fixtures and tests

  • actions/setup/js/test_data/awf_reflect/ holds byte-exact, SHA-pinned recorded reflections, with provenance in its README. They are added to .prettierignore so make fmt cannot rewrite them.
    • run-38995410124-awf-reflect.json is the primary fixture from the issue.
    • run-29812420778-legacy-awf-reflect.json comes from an older AWF version without routing_models.
  • unified_session_payload.test.cjs adds the five named acceptance tests, plus malformed-capability variants. The existing null-model expectations that encoded the lossy [] output are updated.

Notes for review

  • Case 3 fixture differs from the issue. Every AWF /reflect version (gh-aw-firewall Add OIDC authentication with API key fallback - enabled by default for Claude #2253 onward) supplies configured, so a recorded reflection without it does not exist. The golden source runs are private or expired; run 37886511291 returns 404.
    • Case 3 instead uses the oldest retained public reflection, from run 29812420778. It has no routing_models.
    • It is pinned against the pre-change projection. The only differences are the intended ones: unconfigured endpoints now omit models instead of reporting [], and configured is retained.
  • Goldens unchanged. None of the model-routing golden cases has an inventory source, so there are no golden or expected*.json diffs.
  • No Go reader changes. No pkg/cli code consumes model.inventory events. audit_model_availability.go reads the raw reflection file and already treats a nil models as unknown.
  • Known unrelated test interaction. awf_reflect_summary.test.cjs can fail when it runs in the same vitest invocation as the copilot_harness and awf_reflect tests, because they share /tmp/gh-aw. It passes on its own and does not use the changed code.

…data

Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix AWF model inventories with null endpoints Preserve AWF model inventories with null endpoints and live reasoning metadata (G-7) Oct 18, 2026
Copilot AI requested a review from SivaKesava1 October 18, 2026 21:45
@SivaKesava1
SivaKesava1 marked this pull request as ready for review October 18, 2026 23:42
Copilot AI max review requested due to automatic review settings October 18, 2026 23:42
@SivaKesava1 SivaKesava1 added the smoke-routing Run the model-routing smoke workflows on this PR label Oct 18, 2026
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Copilot Routed Steering completed successfully!

Generated by Smoke Copilot Routed Steering for #70013

@github-actions github-actions Bot removed the smoke-routing Run the model-routing smoke workflows on this PR label Oct 18, 2026
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

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.

Generated from Test Quality Sentinel · haiku45 · 5.18 AIC · ⌖ 7.91 AIC · ◇ 2.48 AIC · ⊞ 9.2K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Copilot Routed Claude completed successfully!

Generated by Smoke Copilot Routed Claude for #70013

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Generated by Ponytail Reviewer for #70013

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Copilot SDK Routed Claude completed successfully!

Generated by Smoke Copilot SDK Routed Claude for #70013

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Pi Routed Claude completed successfully!

Generated by Smoke Pi Routed Claude for #70013

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One opportunity to reduce test-only complexity.

net: -190 lines possible.

Generated by ✂️ Ponytail Reviewer for #70013 · codex · gpt56 · 12 AIC · ⌖ 6.35 AIC · ⊞ 14.6K
Comment /ponytail to run again

Comment thread actions/setup/js/unified_session_payload.test.cjs
@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-10-18T23:47:21.139+00:00
review_event: REQUEST_CHANGES
top_themes:
  - semver signal does not match breaking model.inventory contract change
  - published schema diverges from implementation for contextWindowTokens validation
files_reviewed:
  - .changeset/preserve-awf-model-inventory-null-endpoints.md
  - actions/setup/js/unified_session_payload.cjs
  - actions/setup/js/unified_session_payload.test.cjs
  - actions/setup/js/types/unified_session.d.ts
  - actions/setup/js/unified_session.test.cjs
  - docs/public/schemas/unified-session.schema.json
  - docs/src/content/docs/specs/unified-agent-session-specification.md
comment_count: 2

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 41.3 AIC · ⌖ 6.04 AIC · ⊞ 12.7K · ◷
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request changes

This patch ships two blocking contract regressions: the release marker says patch even though the PR intentionally removes the old model.inventory guarantee, and the regenerated schema no longer enforces the positive-safe-integer constraint for contextWindowTokens.

Themes
  • release semantics no longer match the documented 2.0.0 / breaking contract change
  • published schema diverges from the normalizer and T-UAS-075, so downstream validators can accept payloads the collector rejects

Static review only; I did not run code or tests under this workflow.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 41.3 AIC · ⌖ 6.04 AIC · ⊞ 12.7K
Comment /review to run again

@@ -0,0 +1,5 @@
---
"gh-aw": patch

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking this changeset as patch understates a breaking model.inventory contract change, so downstream consumers can absorb a schema break without any semver warning.

💡 Why this blocks

The PR explicitly removes the old guarantee that every endpoint publishes models and even bumps the spec to 2.0.0. Releasing that under a patch version means automated upgraders and release notes will advertise a non-breaking update while parsers that still require models can fail at runtime.

Suggested fix:

---
"gh-aw": major
---

If this repo uses another release channel for breaking changes, use that instead of patch, but the current marker is inconsistent with the change being shipped.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 4010fc3. I renamed the changeset to .changeset/major-preserve-awf-model-inventory-null-endpoints.md and changed it to "gh-aw": major. The body now says that model.inventory endpoint models/routingModels may be absent, meaning unknown, and that readers must not treat absence as an empty list (unified session specification 2.0.0).

"modelId": { "type": "string" },
"supportedEndpoints": { "type": "array", "items": { "type": "string" } },
"supportedReasoningEfforts": { "type": "array", "items": { "type": "string" }, "description": "Identifier-shaped reasoning efforts; absent means unknown; a supplied empty array stays empty." },
"contextWindowTokens": { "type": "number", "description": "Positive context window size in tokens; absent means unknown." }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

contextWindowTokens is documented and implemented as a positive safe integer, but the published JSON schema now accepts any number, so downstream validators will bless payloads this collector rejects.

💡 Why this blocks

The normalizer rejects 0, 1.5, strings, and values above Number.MAX_SAFE_INTEGER, and T-UAS-075 says this field is a positive safe integer. With "type": "number" here, generated validators still accept fractional or oversized values, which reintroduces a contract mismatch between the shipped schema and the code.

Suggested fix:

"contextWindowTokens": {
  "type": "integer",
  "minimum": 1,
  "maximum": 9007199254740991,
  "description": "Positive context window size in tokens; absent means unknown."
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 4010fc3. I added @asType integer, @minimum 1 and @maximum 9007199254740991 to contextWindowTokens in unified_session.d.ts and regenerated with make session-schemas. The schema now emits "type": "integer", "minimum": 1 and "maximum": 9007199254740991, and make check-session-schemas passes. I also added a schema-validation test: it accepts 1 and MAX_SAFE_INTEGER and rejects 0, 1.5 and 9007199254740992. Against the old number schema, that test fails.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /tdd and /grill-with-docs. No actionable issues found — approving.

📋 Verification performed
  • Manually traced normalizeModelInventoryData against ~20 cases (null-vs-empty model/routing inheritance, configured validation, reasoning-effort regex, context-window bounds, providers-map path) — all match the documented semantics.
  • Verified SHA-256 digests of both recorded AWF fixtures against the README provenance table — exact match.
  • Confirmed no secrets in fixtures ("Bearer" is a scheme name, not a token value).
  • Confirmed idempotency: the normalizer accepts its own output and survives a JSON round trip on the real 40-model fixture.
  • Confirmed the 2.0.0 major spec bump is correctly justified: endpoint models moves from required to optional, which is a genuine reader-guarantee removal per this repou2019’s breaking-change rules.
  • Test coverage is strong: acceptance tests, malformed-variant tests, a golden-case non-regression test, and legacy-fixture pinning are all present and consistent with the implementation.

Positive Highlights

  • ✅ Careful distinction between “unknown” (omitted) and “empty” ([]) inventories, directly fixing the reported bug (#69754) without weakening validation elsewhere.
  • ✅ Byte-exact, SHA-pinned fixtures with clear provenance documentation — excellent reproducibility.
  • ✅ Spec (T-UAS-075), schema, and changelog are all updated in lockstep with the code change.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 130 AIC · ⌖ 13.8 AIC · ⊞ 10.1K
Comment /matt to run again

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The incompatible session-output contract needs maintainer sign-off, with schema constraints and release guidance still unresolved.

1 open issue
What changed in this PR

Preserves AWF model inventories in unified sessions when endpoints report unknown model lists, while retaining live capability metadata.

Changes:

  • Omits null lists without discarding valid endpoints.
  • Retains configuration, reasoning efforts, and context windows.
  • Updates contracts and adds recorded-fixture regression coverage.
File Description
docs/​src/​content/​docs/​specs/​unified-agent-session-specification.md Defines the 2.0.0 inventory contract.
docs/​public/​schemas/​unified-session.schema.json Adds capability fields and optional model lists.
actions/​setup/​js/​unified_session.test.cjs Updates collector acceptance and rejection cases.
actions/​setup/​js/​unified_session_payload.test.cjs Adds projection and recorded-inventory regressions.
actions/​setup/​js/​unified_session_payload.cjs Preserves unknown lists and capability metadata.
actions/​setup/​js/​types/​unified_session.d.ts Updates inventory payload declarations.
actions/​setup/​js/​test_data/​awf_reflect/​run-38995410124-awf-reflect.json Adds the primary recorded reproduction.
actions/​setup/​js/​test_data/​awf_reflect/​run-29812420778-legacy-awf-reflect.json Adds a legacy compatibility fixture.
actions/​setup/​js/​test_data/​awf_reflect/​README.md Records fixture provenance and digests.
.prettierignore Protects byte-exact fixture formatting.
.changeset/​preserve-awf-model-inventory-null-endpoints.md Adds a release note.

Review effort: Max

Comment on lines +1 to +5
---
"gh-aw": patch
---

Keep AWF model inventories in unified sessions when an unconfigured endpoint reports null `models` or `routing_models`. Null lists are now omitted as unknown instead of becoming empty arrays or rejecting the whole snapshot, and endpoint `configured`, routing `supportedReasoningEfforts`, and `contextWindowTokens` are retained (unified session specification 2.0.0).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in 90677d8. The changeset is marked major and now states that omitted model lists are unknown while an explicit [] remains a known-empty inventory, with reader guidance not to treat absence as empty.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in 90677d8. The changeset is marked major and now states that omitted model lists are unknown while an explicit [] remains a known-empty inventory, with reader guidance not to treat absence as empty.

…chema to positive safe integer

Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (.changeset/preserve-awf-model-inventory-null-endpoints.md:5): This removes the previously required models field from some model.inventory endpoints, as the specification's incompatible 2.0.0 change notes. Readers that iterate endpoint.models without checking for it can now fail. The output-format rules in .github/skills/developer-release/SKILL.md:253–287 require a major changeset and migration guidance for removed output guarantees; scripts/changeset.js:327–350 instead puts this patch under "Bug Fixes." Mark the changeset as major and explain that an absent list means unknown, while an explicit empty array remains empty. - Preserve AWF model inventories with null endpoints and live reasoning metadata (G-7) #70013 (comment)

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 head: 4010fc3
Sous-chef work: d423cc1712f0dfa0999e6aa81d4c2df3b9a0ab440303e92cbc51dfad91d98ec6
Sous-chef state: 56c603368fd1e5ca2c28925eefc87c4a9f704ecbba70252604cbb4ae445ea760

Generated by 👨‍🍳 PR Sous Chef · pi · haiku45 · 4.96 AIC · ⌖ 6.72 AIC · ⊞ 1.1K · ◷
Comment /souschef to run again

Copilot AI and others added 2 commits October 19, 2026 01:10
…awf-model-inventories

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>
Copilot AI requested a review from gh-aw-bot October 19, 2026 01:22
@pelikhan
pelikhan merged commit ca77456 into main Oct 19, 2026
16 checks passed
@pelikhan
pelikhan deleted the copilot/g-7-preserve-awf-model-inventories branch October 19, 2026 01:44
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.92.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preserve AWF model inventories with null endpoints and live reasoning metadata (G-7)

5 participants