Skip to content

fix(customchat): send cause-less finish reasons again as model faults - #158

Merged
deLiseLINO merged 1 commit into
mainfrom
fix/customchat-other-finish
Nov 26, 2026
Merged

deLiseLINO merged 1 commit into
mainfrom
fix/customchat-other-finish

Conversation

@deLiseLINO

Copy link
Copy Markdown
Owner

Why

Some chat upstreams end a turn with finish_reason: "other" and no output. prism failed the turn with upstream finish reason "other" is not representable. The client showed it as a final error and did not retry, though the same request usually succeeds when sent again.

Scope

  • internal/providers/customchat: other, unknown, unspecified and finish_reason_unspecified count as model faults. prism sends the request again once while the client has received nothing, as it already does for malformed responses.
  • A model-fault failure now reads upstream provider returned error finish reason "X". Clients classify that wording as a transient upstream error and retry it.

Verification

  • go test ./internal/providers/customchat/ ./internal/routing/ ./internal/server/: ok.
  • New cases in TestModelFaultFinishIsSentAgainOnce: other then success makes 2 requests and finishes; other twice fails with the new message.

Model: claude-opus-5-5

A chat upstream that ends a turn with finish_reason "other", "unknown",
"unspecified" or "finish_reason_unspecified" failed it as not
representable. Treat these as model faults: prism sends the request again
once before any output, and the failure reads "provider returned error" so
clients retry it as a transient upstream error.
@deLiseLINO
deLiseLINO merged commit ede12d1 into main Nov 26, 2026
3 checks passed
@deLiseLINO
deLiseLINO deleted the fix/customchat-other-finish branch November 26, 2026 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant