You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On current master (99f6f02fec, the rc.7 merge), an OpenAI-compatible streaming provider can terminate a response with the normalized error text stream_read_error. dsh-llm-pi-ai currently falls through to PI_AI_ERROR, so the default LLM retry policy treats a transient mid-stream transport truncation as permanent and ends the turn without retrying.
I searched the current Discussions for stream_read_error, stream read error, pi-ai transport classification, and retry handling and did not find an existing report for this exact case.
Why this is a transport failure
The failure occurs after streaming has started but before a valid terminal response event. It is the same failure family as the truncation wordings the classifier already maps to TRANSPORT, such as a stream ending before or without its terminal event.
The distinction matters because the default retryable codes include TRANSPORT, but not the generic PI_AI_ERROR. Making all PI_AI_ERROR values retryable would be too broad; classifying this specific normalized wording is the narrower fix.
Suggested fix
In packages/llm/llm-pi-ai/src/stream.ts, recognize the common underscore, space, and hyphen variants:
This should stay beside the existing pre-terminal stream-truncation classifications rather than widening the catch-all retry policy.
Upstream limitation
The pi-ai path currently reduces the original caught error to message text before the Harness classifier sees it, so the adapter cannot reliably inspect the original code or cause. Text classification is therefore a compatibility workaround. If pi-ai later preserves structured error metadata, the durable fix would be to route on that metadata and retire the wording heuristic.
Validation
I have a local rc.7 implementation with focused classifier coverage for all three variants. The relevant test, typecheck, and build checks pass. Since this repository currently does not accept external pull requests, I am posting the minimal change here and can provide a patch in the format maintainers prefer.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Summary
On current
master(99f6f02fec, the rc.7 merge), an OpenAI-compatible streaming provider can terminate a response with the normalized error textstream_read_error.dsh-llm-pi-aicurrently falls through toPI_AI_ERROR, so the default LLM retry policy treats a transient mid-stream transport truncation as permanent and ends the turn without retrying.I searched the current Discussions for
stream_read_error,stream read error, pi-ai transport classification, and retry handling and did not find an existing report for this exact case.Why this is a transport failure
The failure occurs after streaming has started but before a valid terminal response event. It is the same failure family as the truncation wordings the classifier already maps to
TRANSPORT, such as a stream ending before or without its terminal event.The distinction matters because the default retryable codes include
TRANSPORT, but not the genericPI_AI_ERROR. Making allPI_AI_ERRORvalues retryable would be too broad; classifying this specific normalized wording is the narrower fix.Suggested fix
In
packages/llm/llm-pi-ai/src/stream.ts, recognize the common underscore, space, and hyphen variants:Suggested focused cases:
This should stay beside the existing pre-terminal stream-truncation classifications rather than widening the catch-all retry policy.
Upstream limitation
The pi-ai path currently reduces the original caught error to message text before the Harness classifier sees it, so the adapter cannot reliably inspect the original
codeorcause. Text classification is therefore a compatibility workaround. If pi-ai later preserves structured error metadata, the durable fix would be to route on that metadata and retire the wording heuristic.Validation
I have a local rc.7 implementation with focused classifier coverage for all three variants. The relevant test, typecheck, and build checks pass. Since this repository currently does not accept external pull requests, I am posting the minimal change here and can provide a patch in the format maintainers prefer.
All reactions