GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: add mistral session affinity header by machinekoder · Pull Request #11474 · anomalyco/opencode

Conversation

@machinekoder

@machinekoder machinekoder commented Jan 31, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Summary

  • add deterministic Mistral x-affinity header based on session ID
  • bump affinity after compaction to reset session affinity
  • add tests for affinity generation and Mistral detection

Testing

  • I tested the development build server with the Mistral provider and it works as expected.
  • Unit tests have been added for the x-affinity header and cleanup of Mistral affinity id.

Fixes #11466

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Copilot AI review requested due to automatic review settings January 31, 2026 14:39
Copilot started reviewing on behalf of machinekoder January 31, 2026 14:39
View session
@github-actions

github-actions Bot commented Jan 31, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot AI reviewed Jan 31, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Mistral session affinity support by attaching a deterministic x-affinity header derived from the session ID and rotating that affinity after session compaction.

Changes:

  • Add ProviderTransform.mistralAffinity() + bumpMistralAffinity() and a shared isMistral() helper.
  • Send x-affinity header on LLM requests when the selected model is detected as Mistral.
  • Bump affinity after compaction and add unit tests for affinity generation + Mistral detection.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/opencode/src/provider/transform.ts Introduces Mistral detection helper and deterministic affinity UUID generation with bump state.
packages/opencode/src/session/llm.ts Conditionally injects x-affinity header for Mistral requests.
packages/opencode/src/session/compaction.ts Bumps affinity counter after compaction completes.
packages/opencode/test/provider/transform.test.ts Adds tests for affinity determinism, bump behavior, and Mistral detection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/opencode/src/session/compaction.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Copilot AI reviewed Jan 31, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

machinekoder reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@machinekoder
machinekoder requested a review from Copilot January 31, 2026 15:35
Copilot started reviewing on behalf of machinekoder January 31, 2026 15:35
View session
Copilot AI reviewed Jan 31, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/opencode/src/session/llm.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Copilot AI reviewed Jan 31, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
loxone-possal added 4 commits February 1, 2026 14:50
@loxone-possal @machinekoder
feat: add mistral session affinity header
a9c5c2c
@loxone-possal @machinekoder
fix: guard affinity bump to mistral models
a1516dd
@loxone-possal @machinekoder
feat: clear mistral affinity on session cleanup
8944087
@loxone-possal @machinekoder
test: add mistral affinity header test
d734335
@machinekoder
machinekoder force-pushed the feature/mistral-affinity branch from 92da98a to d734335 Compare February 1, 2026 13:50
@github-actions github-actions Bot mentioned this pull request Feb 10, 2026
feat: send x-session-id and x-parent-session-id headers in LLM API requests #12932
Closed
4 tasks
@github-actions github-actions Bot mentioned this pull request Mar 1, 2026
feat(opencode): send x-opencode-session header for all providers #15520
Closed
@sdroege

sdroege commented Mar 30, 2026

Copy link
Copy Markdown

What's preventing this from being merged? I'm using this since a while without problems.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@opencode-agent
opencode-agent Bot force-pushed the dev branch from 2f2ed11 to 9f201d6 Compare April 16, 2026 21:55
@rekram1-node

rekram1-node commented May 15, 2026

Copy link
Copy Markdown
Member

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rekram1-node rekram1-node closed this May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

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

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@machinekoder @sdroege @rekram1-node @loxone-possal
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.