Repository navigation
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bb8e36e818
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "dashscope" | ||
| if format == LlmRequestFormat::ChatCompletions && dashscope_explicit(config) => | ||
| { | ||
| split_first_message(body, format, false); |
There was a problem hiding this comment.
Preserve history caching for multi-turn DashScope requests
For multi-turn requests to supported Qwen models, including selection Q&A through chat_completion_history_streaming, this branch enables explicit caching but marks only the static system prefix. DashScope documents that explicit and implicit caching are mutually exclusive, so the repeated selection and conversation history after that marker lose the implicit-cache eligibility they had before this change. Long conversations consequently reprocess that history on every turn, increasing input costs and latency. Preserve implicit caching when conversation history is present, or add an explicit breakpoint covering the completed history as the Anthropic policy does.
Useful? React with 👍 / 👎.
Changing the foreground app previously rewrote the start of the entire system prompt, preventing reuse of otherwise identical style rules. Stable rules now precede per-request app/cursor context across polish, translation, QA and multimodal composition; text envelopes and injection defenses are preserved.
Cache policy uses verified HTTPS service origins, API formats and known model capabilities: OpenAI routing and supported Responses breakpoints, Anthropic stable blocks, OpenRouter sticky routing/history caching, selected DashScope models, and Ark Seed routing hints. DeepSeek and other implicit-cache services keep stable prefixes without incompatible vendor parameters. Existing caller controls, store/TTL choices and all prompt text are preserved. Multi-turn requests retain history reuse.
Usage records now snapshot service/protocol and canonical inclusive/additive cache accounting. The UI shows token-weighted cache share and comparable-report counts per service/channel/model/protocol. Unknown legacy reports stay unknown. No rate guarantee or live-provider improvement is claimed; full native Gemini/Codex/attempt accounting remains tracked separately.
Validation: 1,469 Core library tests passed before the final focused history-policy additions; all 17 cache-policy tests and the request-conversion/header integration test passed, as did all-targets strict Clippy. Frontend helper tests, production build, Chromium/WebKit Usage checks and a populated WebKit fixture passed. Isolated iOS Core preparation passed. The macOS arm64 app/DMG build, codesign checks and disk-image verification passed on final commit 7caeb87. Remote macOS CI 42579132960 and iOS CI 42579095750 both passed on that same commit, including the iPhone device build.
Stacked on #1420. See docs/prompt-cache-policy.md for the maintained contract and official sources.