Skip to content

runtime: pi one-shot (-p) dies with 'Uncaught (in promise) undefined' before first output; node completes full API 401 round-trip — pi wall #8 #6660

Description

@proggeramlug

Wall #8 of the pi bring-up (tracker #6564). GATE 1 passed (#6659: --help/--version byte-identical to node). Gate 2a differential (one-shot prompt with a deliberately bogus API key, isolated HOME):

node (bundle + assets): prints model-not-in-catalog warning + deprecation notice to stdout, then the real API round-trip result:

401 {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key","request_id":"req_011Cd..."}}

rc=1. Full fetch/TLS path to api.anthropic.com works under node with the undici-shim bundle.

perry (pi-native, same args): stdout EMPTY, rc=1, stderr:

Uncaught (in promise) undefined

Dies before the first stdout write of the -p flow (before the model warning), with the rejection REASON lost (undefined).

Repro:

cd secret-tests/pi-target/dist
HOME=$(mktemp -d) ./pi-native -p --provider anthropic --model claude-3-5-haiku-latest \
  --api-key sk-ant-bogus-differential "say exactly: hi"

(node baseline: same args with node pi-bundle.mjs; bundle assets now live at dist/dist/... next to the bundle.)

Notes for diagnosis:

  • Init is proven fine (gate 1 byte-identical), so the divergence is inside the -p flow between arg parse and the first model-warning print: settings load, model catalog resolution, session setup, agent init, or the provider client construction.
  • "reason=undefined" means either perry's unhandledRejection reporting loses the real Error, or something genuinely throws/rejects literal undefined under perry (e.g. an error-classification path reading a property off a value that's undefined only under perry).
  • History rhymes: claude-code's fix(transform): try/catch inside an async generator never caught anything #6331 (async-generator try/catch never caught → killed API-error classification) produced adjacent symptoms. That fix is on main — but pi's code shape may hit a sibling gap.
  • pi-target/dist/pi-native-dbg is a debug-symbols build; pi-native.preNNNN ladder exists for contrast.
  • The projected runtime: new Blob(x) where x is an Array subclass stringifies the constructor instead of iterating elements #6232 dynamic-new-builtin-subclass wall (gaxios) did NOT fire here — anthropic provider path. It presumably still awaits on the google-provider path (pi's default provider is google, so it WILL matter for gate parity later).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed defect or regressionparityCompatibility gap with Node.js, ECMAScript, or the supported ecosystem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions