[FEATURE]: Mistral Provider: Support x-affinity header for session continuation #8139

Open
opened 2026-02-16 18:09:15 -05:00 by yindo · 1 comment
Owner

Originally created by @machinekoder on GitHub (Jan 31, 2026).

Originally assigned to: @thdxr on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

The official mistral-vibe CLI uses the x-affinity header to track and continue sessions. This seems to be similar to promptCaching in the OpenAI provider for example.
The session_id passed to x-affinity is a UUID4, the session id used or promptCaching in OpenCode is a based on a timestamp, so maybe it's not compatible out of the box, but worth a try.

Here is some evidence:
https://github.com/mistralai/mistral-vibe/blob/9809cfc8315049b6f02b1865306903d92428919f/vibe/core/agent_loop.py#L587
https://github.com/mistralai/mistral-vibe/blob/9809cfc8315049b6f02b1865306903d92428919f/vibe/core/agent_loop.py#L156
https://github.com/mistralai/mistral-vibe/blob/9809cfc8315049b6f02b1865306903d92428919f/vibe/cli/textual_ui/app.py#L1242

Originally created by @machinekoder on GitHub (Jan 31, 2026). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request The official mistral-vibe CLI uses the x-affinity header to track and continue sessions. This seems to be similar to promptCaching in the OpenAI provider for example. The session_id passed to x-affinity is a UUID4, the session id used or promptCaching in OpenCode is a based on a timestamp, so maybe it's not compatible out of the box, but worth a try. Here is some evidence: https://github.com/mistralai/mistral-vibe/blob/9809cfc8315049b6f02b1865306903d92428919f/vibe/core/agent_loop.py#L587 https://github.com/mistralai/mistral-vibe/blob/9809cfc8315049b6f02b1865306903d92428919f/vibe/core/agent_loop.py#L156 https://github.com/mistralai/mistral-vibe/blob/9809cfc8315049b6f02b1865306903d92428919f/vibe/cli/textual_ui/app.py#L1242
yindo added the discussion label 2026-02-16 18:09:15 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 31, 2026):

Based on a review of existing issues, I don't see a direct duplicate of this feature request.

However, there are some related issues worth checking:

  • #10342: /compact doesn't utilize prompt caching (related to session optimization)
  • #5416: [FEATURE]: Anthropic (and others) caching improvement (similar session continuation patterns across providers)
  • #6088: [FEATURE]: Header-Based Credential Injection (broader custom header support, though focused on credentials rather than session management)

The x-affinity header for Mistral is a specific implementation of session continuation that differs from Anthropic's prompt caching approach. This seems like a new feature request that addresses Mistral's specific session continuation mechanism.

@github-actions[bot] commented on GitHub (Jan 31, 2026): Based on a review of existing issues, I don't see a direct duplicate of this feature request. However, there are some related issues worth checking: - #10342: /compact doesn't utilize prompt caching (related to session optimization) - #5416: [FEATURE]: Anthropic (and others) caching improvement (similar session continuation patterns across providers) - #6088: [FEATURE]: Header-Based Credential Injection (broader custom header support, though focused on credentials rather than session management) The x-affinity header for Mistral is a specific implementation of session continuation that differs from Anthropic's prompt caching approach. This seems like a new feature request that addresses Mistral's specific session continuation mechanism.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8139