1. run.ts: differentiate error message by stopReason — use rate-limit
message only for "toolUse", generic message for "error" stop reason
2. run.ts: exclude deterministic approval-prompt turns from incomplete
turn detection via !attempt.didSendDeterministicApprovalPrompt guard
3. agent-runner-execution.ts: prioritize metaErrorMsg (raw upstream error)
over errorPayloadText to avoid self-matching on pre-formatted "⚠️"
messages from run.ts
4. agent-runner-execution.ts: skip already-formatted payloads (startsWith
"⚠️") so tool-specific 429 errors are preserved rather than overwritten
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>