The presence of `process.argv[1]` in the current invocation does not
imply that the current `pi` process is being invoked as a script.
Specifically, in the case of a bun compiled binary, `process.argv[1]`
will be the virtual path `/$bunfs/root/pi`, which is not a real file on
the filesystem. This causes the subagent extension to inject this path
into the child `pi` invocation, which is interpreted as part of the
prompt, which confuses the subagent.
This change uses the script only if it is not a bunfs virtual script
Co-authored-by: nathyong <nathyong@noreply.github.com>
* fix(coding-agent): surface models.json load errors on stderr in --list-models
When models.json has validation errors, --list-models silently
discarded custom models and overrides without any user-visible
feedback. Now prints the error to stderr via chalk.yellow warning
before listing available models.
* fix(coding-agent): allow custom models for built-in providers in models.json
Built-in providers (openrouter, anthropic, etc.) already have api and
baseUrl on every model, and auth comes from env vars / auth storage.
Relax validation so custom models under built-in providers don't need
redundant baseUrl, apiKey, or api fields. Inherit them from the first
built-in model for that provider.
fixes#2921
---------
Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
Previously, getLatestNpmVersion() hardcoded a fetch to
registry.npmjs.org, which 404s for packages on alternate
registries (private, Verdaccio, GitHub Packages, etc.).
The error was silently swallowed, so users never saw update
notifications for these packages.
Replace the direct fetch with
via the existing runCommandCapture helper. This uses the same
registry resolution as npm install (reads .npmrc config chain),
respects the npmCommand setting, and runs with this.cwd for
correct .npmrc lookup.