Skip to content

feat: Enhanced sampling with modelPreferences (MCP 2025-11-25)#86

Merged
simonx1 merged 5 commits intomainfrom
feature/sampling-enhancements
Feb 15, 2026
Merged

feat: Enhanced sampling with modelPreferences (MCP 2025-11-25)#86
simonx1 merged 5 commits intomainfrom
feature/sampling-enhancements

Conversation

@simonx1
Copy link
Owner

@simonx1 simonx1 commented Feb 14, 2026

Adds modelPreferences (hints, costPriority, speedPriority, intelligencePriority) and systemPrompt handling.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9a4ad74006

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +846 to +847
@sampling_handler.call(messages, model_preferences, system_prompt, max_tokens,
{ 'includeContext' => include_context, 'temperature' => temperature,

Choose a reason for hiding this comment

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

P1 Badge Preserve optional-arity handlers when dispatching sampling args

The new arity dispatch treats every non-0..4 handler as "5+" and always passes an extra hash, but Ruby lambdas with optional arguments report negative arity (for example ->(messages, prefs, prompt, max_tokens = nil) { ... } has arity -4). Those handlers now fall into this else branch and receive 5 arguments, raising ArgumentError (expected 3..4) and causing sampling requests to fail at runtime; before this change they received 4 arguments and worked.

Useful? React with 👍 / 👎.

@simonx1 simonx1 force-pushed the feature/sampling-enhancements branch 6 times, most recently from d90bfab to 1c98f4b Compare February 15, 2026 00:25
@simonx1 simonx1 force-pushed the feature/sampling-enhancements branch from 1c98f4b to 5406135 Compare February 15, 2026 00:43
@simonx1 simonx1 merged commit 02329ba into main Feb 15, 2026
3 checks passed
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.

1 participant