Skip to content

fix(pi-coding-agent): accept optional reasoning and inputModalities model fields - #11

Merged
mogul merged 2 commits into
mainfrom
fix/neutral-catalog-capability-fields
Nov 12, 2026
Merged

mogul merged 2 commits into
mainfrom
fix/neutral-catalog-capability-fields

Conversation

@mogul

@mogul mogul commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

pi --list-models was empty in a sandbox using the usai provider. The pi renderer rejects any model field outside its allowlist, and the upstream neutral catalog gained two optional ones (reasoning, inputModalities) that the real usai snapshot uses.

 renderModel(model)
-  rejectUnknownFields(model, {id, name, contextWindow, maxOutputTokens, cost, costAbove200kContext})
+  rejectUnknownFields(model, {…same…, reasoning, inputModalities})
+  reasoning        -> must be boolean; validated, NOT emitted
+  inputModalities  -> must be non-empty, unique, in {text,image,audio,video,pdf}
+                      emit models[].input = [text,image] ∩ list (omit if empty)
pi-coding-agent/          renderer + tests + README/ADR 0002/TROUBLESHOOTING
opencode-go-provider/     vendored catalog schema refreshed (no code change)
claude-code, codex,       regression test only: their loaders already ignore
antigravity/              the new fields, now locked in

Why reasoning is not emitted: reasoning: true makes pi send thinking parameters. The neutral flag only says the gateway supports reasoning, not that pi's request shape is accepted.

Evidence

  • Before: real usai snapshot, in a sandbox

    $ node pi-coding-agent-render-models.mjs
    pi-coding-agent: model for 'usai' contains unsupported field 'inputModalities'
    exit=1                      # no models.json written
    $ pi --list-models
    No models available. Use /login to log into a provider ...
    

    New tests against the old renderer: 4 fail (capability fields: inputModalities maps…, capability fields fail closed…, a usai-shaped catalog…, renderer field allowlists match the vendored neutral schemas).

    After: same sandbox, recreated from this branch

    $ pi --list-models | head -4
    provider  model                 context  max-out  thinking  images
    usai      claude_4_5_haiku      200K     64K      no        no
    usai      claude_4_6_sonnet     1M       128K     no        yes
    usai      claude_4_7_opus       1M       128K     no        yes
    $ ls ~/.pi/agent/models.json
    /home/agent/.pi/agent/models.json
    

    The same 4 tests pass.

  • Verification transcript (make lint validate test, exit 0):

    Check Result
    ruff check / ruff format --check / shellcheck pass
    validate-kits.py (Patterns a290d5d) All 6 acq-kits valid.
    pi-coding-agent node --test 28 pass, 0 fail
    opencode-go-provider node --test 29 pass, 0 fail
    scripts/tests 69 pass
    claude-code 28 pass, 3 skipped (live)
    codex, antigravity pass, including the new capability test in each
    pi / personal scripts/verify offline gate passed

    make security (pip-audit, gitleaks) was not run locally: gitleaks is not installed in the sandbox. CI covers it.

    An adversarial sub-agent review found no blockers. Its non-blocking notes (modality list not checked against the schema, ADR placement, doc drift, renderer naming) are addressed in this PR.

Also in this PR: personal plugin results (docs only)

Second commit. On Paseo 0.15.0, five of six plugins installed and reported running. agent-office was refused by the daemon (requires Paseo >=0.15.2. Your daemon is 0.15.0) while the other five were unaffected. After upgrading the CLI to 0.15.4 and re-running ~/paseo-plugins-install.sh, it installed. Updated personal/README.md, personal/TROUBLESHOOTING.md (new "Agent Office needs a newer Paseo" entry) and the root README status row. personal/scripts/verify: 30 pass, 0 fail. The paseo kit pin fix is GSA-TTS/agentic-coding-patterns#592.

Merge Danger

Door: two-way. Revert the single commit.

Rollback: git revert <merge commit>, then recreate sandboxes (kit files are applied at sandbox creation only).

Security impact: none. This relaxes a field allowlist for two validated, non-secret metadata fields. Malformed values still fail the render closed. No credentials, network, auth, or data handling changes.

Blast Radius: pi kit

Existing sandboxes keep the old renderer until recreated.

Known gap, not fixed here: the vendored catalog schema is now ahead of the Patterns release pinned in scripts/validate-kits.py and CI (a290d5d), which does not know the new fields. Bumping the pin currently fails because the newer validator rejects the flow-style command: [...] in the codex and antigravity spec.yaml. That needs its own change.

AI-assisted: written with an OpenCode agent (Claude). Needs human review before merge.

mogul and others added 2 commits November 12, 2026 19:54
…odel fields

The pi renderer failed closed on `inputModalities`, so a real `usai`
snapshot never rendered ~/.pi/agent/models.json and `pi --list-models`
was empty. The upstream neutral catalog schema gained optional
`reasoning` and `inputModalities` model fields.

- pi: validate both fields; map inputModalities to pi `input` (text/image
  only, others dropped); validate reasoning but do not emit it
- refresh the vendored neutral catalog schema (pi, opencode-go-provider)
- add regression tests for pi, plus claude-code, codex and antigravity,
  whose loaders already tolerate the fields
- docs: README mapping table, ADR 0002, TROUBLESHOOTING, root README

Co-authored-by: OpenCode Agent <noreply@opencode.ai>
… requirement

On Paseo 0.15.0 five of six plugins installed; agent-office was refused with
"requires Paseo >=0.15.2". Upgrading the CLI to 0.15.4 and re-running the
installer installed it. Add a TROUBLESHOOTING entry and update the status text.

Co-authored-by: OpenCode Agent <noreply@opencode.ai>
@mogul
mogul merged commit 8442cdb into main Nov 12, 2026
10 checks passed
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.

1 participant