Skip to content

fix(mistral): capture new request params and streamed logprobs - #926

Merged
Abhijeet Prasad (AbhiPrasad) merged 2 commits into
mainfrom
abhi/mistral-request-params-9067952b
Oct 13, 2026
Merged

Abhijeet Prasad (AbhiPrasad) merged 2 commits into
mainfrom
abhi/mistral-request-params-9067952b

Conversation

@AbhiPrasad

@AbhiPrasad Abhijeet Prasad (AbhiPrasad) commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Mistral 3.2.0 exposes sampling and probability parameters that currently disappear from Braintrust span metadata. Capture all seven parameters for chat and agents calls, and retain completion and prompt probabilities when accumulating streamed choices.

Fixes #922.

Changes

  • Add logprobs, top_logprobs, prompt_logprobs, top_prompt_logprobs, min_tokens, repetition_penalty, and top_k to both metadata allowlists.
  • Extend three existing VCR tests and replace only their latest recordings. Latest tests use zai-glm-5-3, which accepts the new parameters; older SDK versions keep their existing model and recordings. Non-streaming chat and agents tests check both probability fields. Streaming checks completion probabilities because the hosted model rejects prompt probabilities with streaming.
  • Consolidate speech, transcription, and setup tests while preserving all 40 cases. Restore all methods and patch markers after setup cases, and remove three duplicate conversation setup recordings.

Validation

  • Red: reproduced missing request metadata before the allowlist fix. With real probability recordings, removing the stream aggregation fix makes the streaming regression fail with missing output logprobs.
  • Green: all supported Mistral sessions pass in replay-only mode, including auto-instrument coverage.
Mistral version Replay result
3.2.0 (latest) 40 passed
2.10.1 40 passed
1.12.4 38 passed, 2 expected skips: speech API unavailable

Run from py/: mise exec -- nox -R -s 'test_mistral(latest)' 'test_mistral(2.10.1)' 'test_mistral(1.12.4)' -- --vcr-record=none.

The cassette usage runner completed successfully across the entire matrix and reported no unused recordings. Pre-commit, stale cassette detection, lockfile validation, and git diff --check pass. Inspected the three new recordings: they contain only successful responses and filtered authorization headers.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T15:36:32.752226Z 1fe41f1 PR opened
ℹ️ About Codex in GitHub

Your 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.

@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) force-pushed the abhi/mistral-request-params-9067952b branch from 1fe41f1 to 0047103 Compare October 13, 2026 15:35
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) merged commit 3d46921 into main Oct 13, 2026
83 checks passed
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) deleted the abhi/mistral-request-params-9067952b branch October 13, 2026 16:07
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.

Mistral: log new chat/agents request params (logprobs, top_k, min_tokens, ...)

1 participant