Skip to content

Fix/incomplete response contract - #141

Merged
hung12ct merged 2 commits into
mainfrom
fix/incomplete-response-contract
Aug 8, 2026
Merged

Fix/incomplete response contract#141
hung12ct merged 2 commits into
mainfrom
fix/incomplete-response-contract

Conversation

@hung12ct

@hung12ct hung12ct commented Aug 8, 2026

Copy link
Copy Markdown
Owner

What & why

Closes #

Changes

Testing

Checklist

  • Title is a Conventional Commit (feat:, fix:, docs:, refactor:, chore:, …)
  • gofmt -l . prints nothing
  • make lint is clean
  • make build passes
  • make test (or make test-race for concurrency changes) passes
  • Errors wrapped with a package prefix (fmt.Errorf("<pkg>: ...: %w", err))
  • CHANGELOG.md updated if this PR is cut as a release tag
  • No changes to pkg/llm/, pkg/history/, or pkg/telemetry/ without explicit maintainer approval

ErrLLMTruncated / ErrLLMContentBlocked, carried by IncompleteResponseError,
so a cut-off response stops surfacing as a decode error against the caller's
schema. Blocked stops are non-retryable; the retry content gate now also
covers the first attempt, so a truncation never replays its own stream.
Gemini never read FinishReason and OpenAI never read finish_reason, so a
cap or content filter returned a valid prefix as a success; Anthropic only
emitted a cap event. All three now return IncompleteResponseError, with the
partial content and usage still on the result.
@hung12ct
hung12ct merged commit 229f84d into main Aug 8, 2026
2 checks passed
@hung12ct
hung12ct deleted the fix/incomplete-response-contract branch August 8, 2026 03:54
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