Skip to content

fix(runner): surface Pi provider errors instead of "The agent produced no output" - #5317

Merged
mmabrouk merged 1 commit into
big-agentsfrom
fix-pi-swallowed-provider-errors
Jul 14, 2026
Merged

fix(runner): surface Pi provider errors instead of "The agent produced no output"#5317
mmabrouk merged 1 commit into
big-agentsfrom
fix-pi-swallowed-provider-errors

Conversation

@mmabrouk

@mmabrouk mmabrouk commented Jul 14, 2026

Copy link
Copy Markdown
Member

Context

Any Pi harness provider failure (bad API key, out of quota, model 404) reached the end user as the generic message "The agent produced no output." The real provider error was discarded, so users had no idea what actually went wrong.

Root cause: commit 42075a5e9f moved Pi session transcripts from the Pi agent dir to <cwd>/agents/sessions/pi/ (via PI_CODING_AGENT_SESSION_DIR), but did not update the caller of findSwallowedPiError. The callsite still passed the old Pi agent dir, which no longer contains any transcript, so the helper found nothing and the generic "no output" fallback won.

Changes

findSwallowedPiError now takes the run cwd and derives the transcript location from piSessionWorkspaceDir, the same shared helper configurePiSessionWorkspace uses to point Pi at it, so the reader and the writer can never construct the path independently again.

Before: on a provider failure the user saw

The agent produced no output.

After: the user sees the real error, for example

Incorrect API key provided.

Tests / notes

  • pnpm test in services/runner: all pass. pnpm run typecheck: clean.
  • The tests in sandbox-agent-pi-error.test.ts now write transcripts through piSessionWorkspaceDir too (flat layout, as Pi does with an explicit session dir), so they pin the shared-helper contract rather than a hand-built path.
  • No formatter runs on services/runner/** (the pre-commit prettier hook is scoped to web/), so this is tsc + tests only.

https://claude.ai/code/session_01Hyn9365BLPXDmNZShrQkmH

@dosubot dosubot Bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Jul 14, 2026
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Jul 14, 2026 7:12pm

Request Review

@dosubot dosubot Bot added the bug Something isn't working label Jul 14, 2026
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 42cb5299-a9ab-459a-a5a2-048fc6fcc064

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-pi-swallowed-provider-errors

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mmabrouk

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Preview URL https://gateway-production-aecb.up.railway.app/w
Image tag pr-5317-6361c37
Status Failed
Railway logs Open logs
Logs View workflow run
Updated at 2026-07-14T19:35:19.472Z

@mmabrouk
mmabrouk changed the base branch from main to big-agents July 14, 2026 19:01
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Jul 14, 2026
…d no output"

Commit 42075a5 moved Pi session transcripts to <cwd>/agents/sessions/pi
via PI_CODING_AGENT_SESSION_DIR, but findSwallowedPiError was still passed the
Pi agent dir, which no longer holds the transcript. The helper found nothing,
so every provider failure (bad key, quota, model 404) fell back to the generic
"The agent produced no output." message.

findSwallowedPiError now takes the run cwd and derives the transcript location
from piSessionWorkspaceDir, the same shared helper configurePiSessionWorkspace
uses to point Pi at it, so the reader and the writer can never disagree again.

Claude-Session: https://claude.ai/code/session_01Hyn9365BLPXDmNZShrQkmH
@mmabrouk
mmabrouk force-pushed the fix-pi-swallowed-provider-errors branch from e8c0669 to 145a662 Compare July 14, 2026 19:10
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jul 14, 2026

@mmabrouk mmabrouk left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mmabrouk
mmabrouk merged commit c757f67 into big-agents Jul 14, 2026
35 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant