Repository navigation
fix(providers): preserve prompt cache tokens and salvage terminal streams - #306
Merged
Merged
Conversation
…eams Normalize cache_read_tokens / prompt_cache_hit_tokens / prompt_tokens_details across Trae, Qoder, and WorkBuddy, and emit [DONE] when an upstream stream already finished with a terminal finish_reason. Classify Devin expired-session and Connect auth denials as auth, and surface login_required instead of cooling.
5 tasks done
1 task done
shenyushun
pushed a commit
to shenyushun/cli2api
that referenced
this pull request
Oct 19, 2026
The user-facing change landed via caigee-cmd#306 after caigee-cmd#293 could not be merged as-is. Keep the original contributor on the unreleased note so the next release credits the work that started in caigee-cmd#293.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Takes the user-facing fixes from #293 onto current
main, without the host-specific docker-compose change.cache_read_tokens,prompt_cache_hit_tokens,prompt_tokens_details) across Trae, Qoder, and WorkBuddy in both streaming and non-streaming responses.finish_reasonbut omitted literal[DONE], so downstream clients no longer see a fake 502 incomplete stream.permission_denied+ internal-error shapes as auth, while keeping MCP configuration denials as invalid_request.login_requiredfrom in-process probe and pool state when the last error is auth, instead of treating it as cooling.This is a fresh branch from current
main. It does not include thedeploy/docker-compose.ymlhost network from #293.Test plan
go test ./...go vet ./...gofmt -lon the touched Go filespython3 scripts/release-notes.py validatechangelog/unreleased/prompt-cache-and-stream-salvage.mdwith backticks