Skip to content

Fix Claude 2.1.220 modelUsage identity metadata validation - #33

Open
wunitb wants to merge 1 commit into
Cjbuilds:mainfrom
wunitb:fix/model-usage-metadata-strings
Open

wunitb wants to merge 1 commit into
Cjbuilds:mainfrom
wunitb:fix/model-usage-metadata-strings

Conversation

@wunitb

@wunitb wunitb commented Jul 26, 2026

Copy link
Copy Markdown

Change summary

Claude Code 2.1.220 adds optional string-valued canonicalModel and provider
fields to each modelUsage entry. The bridge treated every inner value as a
numeric usage counter, so otherwise valid Fable Planner and Advisor calls failed
with Runtime metadata has a malformed modelUsage value.

This change:

  • accepts reviewed Fable primary alias/canonical pairs and exact helper/Opus
    canonical identities;
  • requires provider to be exactly firstParty;
  • preserves the outer model allowlist and reviewed-primary requirement;
  • still requires at least one nonnegative finite numeric usage field;
  • rejects unknown strings, primary/helper cross-mappings, non-first-party
    providers, malformed values, and unknown models;
  • bumps the plugin identity to 0.9.4.

Validation

  • TDD regression reproduced the original malformed modelUsage value failure
    before the implementation.
  • python3 scripts/preflight.py full: all available local gates passed,
    including Ruff, focused tests, release identity, full tests, and lifecycle.
    Hosted Python 3.11/3.13, Windows portability, and CodeQL remain authoritative.
  • Live patched-bridge smoke on Claude Code 2.1.220 returned PLAN_DRAFT for
    claude-fable-5 at xhigh and confirmed used_models=["claude-fable-5"].
  • Fresh independent review approved exact head
    8b4ccae38e13cb843c2bd7eb8c0916f628fda173; the reviewer also ran the focused
    suite (66/66) and full local preflight.

Review attestation

{
"schema": 1,
"risk_tier": "security-state",
"repository": "Cjbuilds/Codex-Orchestration",
"base_branch": "main",
"reviewed_head_sha": "8b4ccae38e13cb843c2bd7eb8c0916f628fda173",
"reviewer_identity": "GPT-5.6 Sol high via Codex code reviewer",
"reviewer_route": "agents.spawn_agent model=gpt-5.6-sol reasoning_effort=high fork_turns=none",
"threat_model": {
"assets": [
"Authentic runtime model identity at the Fable and Opus bridge boundary",
"Confidentiality of model-authored output rejected before authorization"
],
"threats": [
"New valid identity metadata could make every bundled Claude call unavailable",
"Unreviewed canonical identities or providers could bypass runtime model authorization",
"Identity-only entries could bypass the numeric usage-shape requirement"
],
"mitigations": [
"Constrain canonical identities to reviewed primary aliases or the exact helper and Opus identities",
"Require provider=firstParty while preserving the outer allowlist and reviewed-primary check",
"Require numeric usage and reject malformed or unknown metadata with content-free errors"
]
},
"negative_test_evidence": [
{
"category": "regression",
"evidence": "A Claude Code 2.1.220-shaped modelUsage payload now passes the real bridge validation path."
},
{
"category": "negative",
"evidence": "Tests reject non-first-party providers, unknown string fields, and primary/helper or Opus identity mismatches."
},
{
"category": "malformed",
"evidence": "Tests reject identity-only entries and retain rejection of negative, non-finite, boolean, empty, and nonnumeric usage values."
}
],
"findings_disposition": "REVIEW_APPROVED on exact head 8b4ccae after F-001 and F-002 were incorporated and re-tested."
}

@wunitb
wunitb requested a review from Cjbuilds as a code owner July 26, 2026 10:47
@wunitb

wunitb commented Jul 26, 2026

Copy link
Copy Markdown
Author

GitHub marked both CI and CodeQL as action_required because this is a first-time contribution. Please approve the workflow runs when convenient. The PR body includes the exact-head review attestation, full local preflight, and a live Claude Code 2.1.220 bridge smoke.

@ilyaedevp

Copy link
Copy Markdown

Independent verification from an affected Claude Code 2.1.220 environment: PASS on exact head 8b4ccae38e13cb843c2bd7eb8c0916f628fda173 against 2c0a4b83f1d12618c5452333962393ab6412dedc.

The review confirmed the narrow canonicalModel / provider=firstParty contract, reviewed Fable alias mapping, exact Opus identity, numeric-usage requirement, fail-closed unknown/malformed paths, and authorization-before-content ordering. Focused, release, lifecycle, and adversarial checks passed. No live Claude call was made during this additional review. The aggregate hook-test caveat on this host is environmental: Git 2.25.1 inherits core.hooksPath=global-hooks; isolated affected tests and lifecycle pass.

Additional reviewer: GPT-5.6 Sol high via Codex independent read-only verification worker; route accepted as agents.spawn_agent model=gpt-5.6-sol reasoning_effort=high fork_turns=none (runtime model identity was not independently exposed).

The PR workflows are still action_required for a first-time contributor; maintainer approval of the hosted checks would unblock the authoritative CI evidence.

@wunitb

wunitb commented Jul 26, 2026

Copy link
Copy Markdown
Author

@Cjbuilds could you please approve the first-time-contributor CI and CodeQL runs for this PR? The bug blocks every configured Fable Planner call on Claude Code 2.1.220; exact-head local, live, and independent review evidence is included above.

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.

2 participants