Fix: opencodego provider requires new mandatory header on each request - #1
Draft
kevincojean wants to merge 3 commits into
Draft
kevincojean wants to merge 3 commits into
kevincojean wants to merge 3 commits into
Conversation
…131) 1. **Leading `<think>` Tag Stripping**: Added `_strip_think_tags()` with `_LEADING_THINK_TAG_PATTERN` in `codex_provider.py` to remove leading reasoning tags from assistant history without modifying subsequent text, mid-sentence tags, or whitespace. 2. **Responses API Schema Uniformity**: Explicitly serialized assistant input items with `"type": "message"`. 3. **Collision-Free Deterministic Tool IDs**: Replaced random `uuid.uuid4()` with request-scoped `call_gen_{global_tool_idx}_{content_hash}` for tool calls lacking an ID. 4. **Cache Routing & Session ID Propagation**: - Injected `context.session_id` into `kwargs["session_id"]`. - Forwarded `prompt_cache_key`, `session_id`, and `conversation_id` in `responses_compat.py`. - Extracted `prompt_cache_key` with fallback to `session_id` in `codex_provider.acompletion()` for cluster cache affinity. - Injected unique per-request `x-client-request-id` to avoid upstream request deduplication bugs. 5. **Feature Ledger & Tests**: - Appended entry to `.fork/features/codex.md`. - Added 16 unit tests in `tests/test_codex_prompt_caching.py` (all 50 tests passing).
Co-authored-by: claw-io <273482092+claw-io@users.noreply.github.com>
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.
Fix: opencodego provider requires new mandatory header on each request