Skip to content

Fix: opencodego provider requires new mandatory header on each request - #1

Draft
kevincojean wants to merge 3 commits into
kevincojean:fix/provider-opencodego-required-headerfrom
b3nw:dev
Draft

kevincojean wants to merge 3 commits into
kevincojean:fix/provider-opencodego-required-headerfrom
b3nw:dev

Conversation

@kevincojean

Copy link
Copy Markdown
Owner

Fix: opencodego provider requires new mandatory header on each request

b3nw and others added 3 commits August 28, 2026 12:42
…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>
kevincojean added a commit that referenced this pull request Sep 7, 2026
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.

2 participants