Read PR description, comments, commits, and changed files.
UnderstandIdentified and reviewed linked issues.
UnderstandAnalyzed PR diff and relevant code files.
UnderstandChecked CHANGELOG, README, and test files.
VerifyPosted detailed comment on PR in user's tone.
EditYou are given one or more GitHub PR URLs: https://github.com/badlogic/pi-mono/pull/762
For each PR URL, do the following in order:
packages/*/CHANGELOG.md files. Report whether an entry exists. If missing, state that a changelog entry is required before merge and that you will add it if the user decides to merge. Follow the changelog format rules in AGENTS.md. Verify:
### Breaking Changes, ### Added, ### Fixed, etc.)Fixed foo ([#123](https://github.com/badlogic/pi-mono/pull/123) by [@user](https://github.com/user))### Breaking Changes, not just ### FixedOutput format per PR: PR: Changelog:
If no issues are found, say so under Bad and Ugly.
Now let me check the current CHANGELOG and README on main, and verify the test file:
Let me check the docs directory to see if any documentation updates are needed:
PR: https://github.com/badlogic/pi-mono/pull/762
packages/coding-agent/CHANGELOG.md under ### Added- API keys in `models.json` can now be retrieved via shell command using `!` prefix (...) ([#762](https://github.com/badlogic/pi-mono/pull/762) by [@cv](https://github.com/cv))pkg:coding-agent labelresolveApiKeyConfig()undefined, allowing auth to fall back to other methods! prefix approach matches conventions from other tools (vim codecompanion, etc.)models.json).package-lock.json changes (removing peer: true from several deps) are unrelated lock file drift, likely from merging with main. This is benign.packages/coding-agent/src/core/model-registry.ts: Extended resolveApiKeyConfig() to detect ! prefix and execute the remainder as a shell command via execSync, returning trimmed stdout. Includes 10s timeout and graceful error handling.packages/coding-agent/test/model-registry.test.ts: Added 9 new tests for API key resolution covering all execution paths.packages/coding-agent/README.md: Updated "API key resolution" section to document the three formats: !command, env var name, and literal value.packages/coding-agent/CHANGELOG.md: Added changelog entry (needs format fix).model-registry.test.ts:
apiKey with ! prefix executes command and uses stdoutapiKey with ! prefix trims whitespace from command outputapiKey with ! prefix handles multiline output (uses trimmed result)apiKey with ! prefix returns undefined on command failureapiKey with ! prefix returns undefined on nonexistent commandapiKey with ! prefix returns undefined on empty outputapiKey as environment variable name resolves to env valueapiKey as literal value is used directly when not an env varapiKey command can use shell features like pipespackages/coding-agent/README.md: Updated appropriately with the new feature.packages/coding-agent/docs/*.md: No updates needed. The sdk.md mentions models.json but only in the context of file paths and model discovery, not API key resolution specifics.absolutely no bad shit? like, invoking bash on every api key get? error handling?
continue
You're right. I missed significant issues:
Updated Review - Bad:
No caching - command executes on EVERY API key lookup:
getApiKey() is called on every LLM request (lines 633, 1049, 1090, 1120, 1259, 1447, 2076 in agent-session.ts)!security find-generic-password command spawns a new shell process each timeSilent error handling is a UX problem:
undefined silently!command in models.json is the problemThe fix needed:
customProviderApiKeys map already exists but stores the config not the resolved valueExample of what happens now with a typo:
{ "apiKey": "!security find-generic-pasword -ws 'anthropic'" } // typo: paswordUser sees: "Error: No API key for provider my-provider" with no hint about the failed command.
Ugly:
ok, leave a comment on the pr in my tone
- API keys in `models.json` can now be retrieved via shell command using `!` prefix (...) ([#762](https://github.com/badlogic/pi-mono/pull/762) by [@cv](https://github.com/cv)){ "apiKey": "!security find-generic-pasword -ws 'anthropic'" } // typo: pasword