Skip to content

fix(chart,python,file): apply the configured reasoning effort to inner agents - #1520

Merged
yileicn merged 1 commit into
SciSharp:masterfrom
yileicn:fix/inner-agent-reasoning-effort
Nov 26, 2026
Merged

yileicn merged 1 commit into
SciSharp:masterfrom
yileicn:fix/inner-agent-reasoning-effort

Conversation

@yileicn

@yileicn yileicn commented Nov 26, 2026

Copy link
Copy Markdown
Member

Problem

PlotChartFn, PyProgrammerFn and FileInstructService.SelectFiles build an inner agent whose LlmConfig has MaxOutputTokens and ReasoningEffortLevel but no Provider / Model. The provider and model are passed to CompletionProvider.GetChatCompletion separately.

The OpenAI (and Google AI) chat providers only take the effort from agent.LlmConfig when _model == agent.LlmConfig.Model. With Model left null that never matches, so ChartHandler:ChartPlot:ReasoningEffortLevel, Coding:CodeGeneration:ReasoningEffortLevel and Conversation:FileSelect:ReasoningEffortLevel are silently ignored and the model's default from LlmProviders is used instead.

PlotChartFn and PyProgrammerFn also default the effort to a hardcoded "minimal", which newer models that do not offer minimal would reject once the value is actually sent.

Changes

  • Set Provider / Model on the inner agent's LlmConfig in all three places, using the same provider/model the completion is created with.
  • Drop the hardcoded "minimal" default in PlotChartFn and PyProgrammerFn.

Behavior

  • Effort configured: it now applies (previously ignored).
  • Effort not configured: the model's Reasoning.Parameters.EffortLevel.Default in LlmProviders applies, the same as before.
  • A conversation state reasoning_effort_level still takes precedence.

Note for existing deployments: a configured ReasoningEffortLevel that the configured model does not support used to be ignored and will now be sent, so the request will fail. Check these three sections when upgrading.

Testing

Build-verified (BotSharp.Core, BotSharp.Plugin.ChartHandler, BotSharp.Plugin.PythonInterpreter). Not exercised at runtime.

Follow-up to #1515.

🤖 Generated with Claude Code

…r agents

Chart plotting, python code generation and file select built their inner agent's
LlmConfig without a model, so the provider never matched it against the request
model and ignored the configured ReasoningEffortLevel. Pass the provider and
model in, and drop the hardcoded "minimal" default, which models such as
gpt-6-luna reject. Without a configured effort, the model's default in
LlmProviders applies, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@qodo-code-review

Copy link
Copy Markdown
Contributor

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@yileicn
yileicn merged commit 5387492 into SciSharp:master Nov 26, 2026
4 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