fix(browserbase): handle optional command output - #1970
Conversation
NathanFlurry
commented
Sep 10, 2026
- Assert command output is present before parsing the Browserbase response.
- Restore the browserbase example typecheck under strict TypeScript settings.
Co · session: Fix agentos main CI (clippy 1.98 + browserbase types)
|
|
🚅 Environment agentos-pr-1970 in rivet-frontend has no services deployed. |
| }); | ||
|
|
||
| const page = JSON.parse(stdout) as { statusCode: number; content: string }; | ||
| const page = JSON.parse(stdout!) as { statusCode: number; content: string }; |
There was a problem hiding this comment.
🟠 Medium · Capture the JSON response before parsing stdout
process.exec defaults to output.capture: "none"; the sidecar therefore returns stdout as undefined unless the caller opts in to capture it. The non-null assertion only hides that contract from TypeScript, and JSON.parse(stdout!) still throws whenever this example is run.
Pass output: { capture: "all" } with env for this call and the matching direct-client call (then retain an explicit assertion or guard as appropriate).
There was a problem hiding this comment.
Fixed in 4f02710. Both Browserbase client examples now request output: { capture: "all" } and fail clearly if the command still returns no stdout. pnpm --dir examples/browserbase check-types passes.