Repository navigation
Conversation
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Test against a Context Mill branch:
Add Results will be posted here when complete. |
|
✅ Security review complete — No findings above the confidence threshold, in 5 min. Add the |
f71f52d to
9222e91
Compare
johncwaters
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
See inline comments.
Automated review by Glimmervoid. Not written by a human
| const idleMs = | ||
| turnStartedAt > 0 ? Math.max(0, now() - lastActivityAt) : 0; | ||
|
|
||
| if (msg.stopReason === 'error') { |
There was a problem hiding this comment.
[convergent: boundary + architecture] HIGH
This reports a drop Pi is about to retry as a final failed, so a drop Pi recovers from looks like a real stall in the dashboard.
Pi's auto-retry is on by default (settings-manager.js:673, retry?.enabled ?? true) and we don't turn it off. Its retryable pattern in pi-ai/dist/utils/retry.js matches terminated, socket hang up, connection.?lost and timed? out, the same strings classifyStreamStallError maps to upstream_closed, connection_reset and deadline_exceeded. Pi emits them in this order: message_end with stopReason: 'error', then agent_end (with willRetry), then auto_retry_start from _handlePostAgentRun (agent-session.js:1426). This branch sets turnState = 'failed' and sends report('failed') before auto_retry_start arrives. The auto_retry_start / auto_retry_end pause branches only run from waiting, so they never fire here, and no recovered follows when the retry works.
The tests at stream-stall.test.ts:318-331 and :399-405 send auto_retry_start right after turn_start with no message_end. Pi never sends that order, which is why they pass.
Suggested fix: on an error message_end, hold the report until agent_end. With willRetry: false, report failed. With willRetry: true, wait for auto_retry_end: success: false reports failed, and a later successful message_end reports recovered. Reading Pi's own willRetry also keeps this from drifting when a ~1.1.x bump changes Pi's retry regex. Then rewrite those two tests in Pi's real order.
This also overlaps #1363, which sends agent turn retried from the same auto_retry_start. Worth picking one owner for Pi retry telemetry, or giving both events a shared turn id so they can be joined.
Automated review by Glimmervoid. Not written by a human
There was a problem hiding this comment.
Fixed in 32614a1.
stream-stall.ts now holds stall errors on message_end until agent_end reports willRetry.
willRetry: falseemitsfailedonce.willRetry: truemoves toretryingwithout emittingfailed, keepssilentReportedacross the retryturn_start, emitsrecoveredif a silent turn finishes on retry, and emitsfailedonce on retry exhaustion or cancelled backoff (auto_retry_endwithsuccess: false).- Updated
stream-stall.test.tsandstructured-run.test.tsto match Pi's real event order and cover retry recovery, retry exhaustion, and cancelled backoff.
Problem
4 of 10
gpt-6.2-solorchestrator runs in #1617 stalled mid-stream untilai-gateway's600sdeadline killed them. Early user cancels look like normal ones, and there's no PostHog event to track stalls in prod.Changes
wizard: agent stream stalledwhen a Pi model turn goes silent for120sor fails mid-stream on a deadline or drop. Redact secrets fromerror_message.recoveredorabortedevent if a silent turn finishes or gets cancelled.Test plan
pnpm typecheck,pnpm test src/agent/runner/harness/pi/,pnpm lint, andpnpm buildpass.