Skip to content

chore: openai reasoning model cleanup#7529

Merged
lifeizhou-ap merged 7 commits intomainfrom
lifei/clean-deprecate-parameter
Mar 2, 2026
Merged

chore: openai reasoning model cleanup#7529
lifeizhou-ap merged 7 commits intomainfrom
lifei/clean-deprecate-parameter

Conversation

@lifeizhou-ap
Copy link
Copy Markdown
Collaborator

Summary

  • removed deprecate max_token request param in openai compatible api
  • use canonical model reasoning data to check whether model is reasoning model

Type of Change

  • Feature
  • Bug fix
  • Refactor / Code quality
  • Performance improvement
  • Documentation
  • Tests
  • Security fix
  • Build / Release
  • Other (specify below)

Testing

Unit test and manual testing

…d also use canonical model reasoning data to check whether model is reasoning model
Copy link
Copy Markdown

@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: 61efebd998

ℹ️ 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 +825 to +827
payload.as_object_mut().unwrap().insert(
"max_completion_tokens".to_string(),
json!(model_config.max_output_tokens()),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restore max_tokens for non-reasoning chat completions

This now unconditionally writes max_completion_tokens, but this formatter is shared by multiple non-OpenAI providers (for example openai_compatible, ollama, tetrate, githubcopilot, litellm, and openrouter) that still post to /chat/completions schemas expecting max_tokens; with this change, non-reasoning requests no longer include max_tokens at all, which can cause 400s or silently drop output limits on those backends. Keep max_completion_tokens for reasoning models, but preserve a max_tokens path for standard chat-completions models.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@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: 2bb0e8e9d1

ℹ️ 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 +648 to +650
payload.as_object_mut().unwrap().insert(
"max_completion_tokens".to_string(),
json!(model_config.max_output_tokens()),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve max_tokens for non-reasoning Databricks requests

create_request now always emits max_completion_tokens in the normal (non-CLAUDE_THINKING_ENABLED) path, so non-reasoning Databricks models no longer receive max_tokens. This path is used for standard Databricks chat invocations (for example llama/claude endpoints), and switching the parameter can cause provider-side 400s or ignored output limits on backends that still implement chat-completions semantics with max_tokens; keep max_completion_tokens only for reasoning-model payloads.

Useful? React with 👍 / 👎.

}

pub fn is_openai_reasoning_model(&self) -> bool {
const PROVIDER_PREFIXES: &[&str] = &["goose-", "databricks-"];
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

provider or model name? as that seems odd?

Copy link
Copy Markdown
Collaborator Author

@lifeizhou-ap lifeizhou-ap Feb 26, 2026

Choose a reason for hiding this comment

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

should be DATABRICKS_MODEL_NAME_PREFIXES

Copy link
Copy Markdown
Collaborator

@michaelneale michaelneale left a comment

Choose a reason for hiding this comment

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

much nicer but provider/model name prefix is a little confusing for me.

@lifeizhou-ap
Copy link
Copy Markdown
Collaborator Author

lifeizhou-ap commented Feb 26, 2026

much nicer but provider/model name prefix is a little confusing for me.

yes @michaelneale! I was a bit confused initially too. Looking into the code, I found the databricks provider currently is much for block databricks which we know the convention of our model names. If we want to have a general purpose databricks provider, we have to have a common schema for returning the servingpoints.

Copy link
Copy Markdown

@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: ace6b450c0

ℹ️ 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".


pub fn is_openai_reasoning_model(&self) -> bool {
const DATABRICKS_MODEL_NAME_PREFIXES: &[&str] = &["goose-", "databricks-"];
const REASONING_PREFIXES: &[&str] = &["o1", "o3", "o4", "gpt-5"];
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep o2 models classified as reasoning

is_openai_reasoning_model no longer treats o2* names as reasoning models because REASONING_PREFIXES dropped "o2". This helper now drives request shaping in both OpenAI and Databricks formatters, so o2 requests will be sent down the non-reasoning path (including temperature and without reasoning-specific handling), which can trigger 400s or behavior mismatches on endpoints that still expose o2 under o-series semantics.

Useful? React with 👍 / 👎.

* main:
  feat: add goose-powered release notes generator workflow (#7503)
* main: (46 commits)
  chore(deps): bump minimatch from 10.1.1 to 10.2.3 in /evals/open-model-gym/suite (#7498)
  chore(deps): bump swiper from 11.2.10 to 12.1.2 in /documentation (#7368)
  Better network failure error & antrhopic retry (#7595)
  feat: make the text bar persistent and add a queue for messages (#7560)
  fix: outdated clippy command in goosehints (#7590)
  chore(deps): bump hono from 4.11.7 to 4.12.1 in /evals/open-model-gym/mcp-harness (#7417)
  chore(deps-dev): bump ajv from 6.12.6 to 6.14.0 in /ui/desktop (#7437)
  chore(deps): bump ajv from 8.17.1 to 8.18.0 in /evals/open-model-gym/mcp-harness (#7491)
  chore(deps): bump hono from 4.12.0 to 4.12.2 in /ui/desktop (#7515)
  chore(deps-dev): bump rollup from 4.57.1 to 4.59.0 in /ui/desktop (#7522)
  chore(deps): bump minimatch in /ui/desktop (#7572)
  fix: validate configure probe for streaming providers (#7564)
  Dockerfile: add missing build/runtime dependencies (#7546)
  fix(claude-code): Permission routing for smart-approve (#7501)
  Add base_path field to custom provider config (#7558)
  fix(cli): avoid debug logging by default in CLI (#7569)
  fix: panic on corrupted permission.yaml instead of silently allowing all (#7432) (#7458)
  fix(openai): handle null reasoning effort in Responses API (#7469)
  Allow GOOSE_NODE_DIR override in batch file (#7422)
  feat: add analyze platform extension with tree-sitter AST parsing (#7542)
  ...
Copy link
Copy Markdown

@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: 84e1e20cd6

ℹ️ 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 47 to 50
pub const DATABRICKS_KNOWN_MODELS: &[&str] = &[
"databricks-claude-sonnet-4-5",
"databricks-claude-3-7-sonnet",
"databricks-meta-llama-3-3-70b-instruct",
"databricks-meta-llama-3-1-405b-instruct",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restore removed Databricks models in known model metadata

DATABRICKS_KNOWN_MODELS now omits databricks-claude-3-7-sonnet and databricks-dbrx-instruct, but this constant is still passed into ProviderMetadata::new(...) for the Databricks provider and is used as the static/fallback model catalog exposed to clients. Removing these entries makes still-referenced Databricks models undiscoverable in provider metadata (including UI selection/fallback flows when dynamic model fetch is unavailable), even though the codebase still treats them as valid model names in other places.

Useful? React with 👍 / 👎.

@lifeizhou-ap lifeizhou-ap added this pull request to the merge queue Mar 2, 2026
Merged via the queue into main with commit 82facd4 Mar 2, 2026
27 of 28 checks passed
@lifeizhou-ap lifeizhou-ap deleted the lifei/clean-deprecate-parameter branch March 2, 2026 15:47
wpfleger96 added a commit that referenced this pull request Mar 3, 2026
* origin/main: (27 commits)
  feat: return structured {stdout, stderr} from shell tool with output schema (#7604)
  Improve custom provider creation experience (#7541)
  fix(scheduler): schedules added via CLI showing up in UI (#7594)
  chore: openai reasoning model cleanup (#7529)
  chore(deps): bump hono from 4.12.1 to 4.12.3 in /evals/open-model-gym/mcp-harness (#7585)
  chore(deps): bump minimatch from 10.1.1 to 10.2.3 in /evals/open-model-gym/suite (#7498)
  chore(deps): bump swiper from 11.2.10 to 12.1.2 in /documentation (#7368)
  Better network failure error & antrhopic retry (#7595)
  feat: make the text bar persistent and add a queue for messages (#7560)
  fix: outdated clippy command in goosehints (#7590)
  chore(deps): bump hono from 4.11.7 to 4.12.1 in /evals/open-model-gym/mcp-harness (#7417)
  chore(deps-dev): bump ajv from 6.12.6 to 6.14.0 in /ui/desktop (#7437)
  chore(deps): bump ajv from 8.17.1 to 8.18.0 in /evals/open-model-gym/mcp-harness (#7491)
  chore(deps): bump hono from 4.12.0 to 4.12.2 in /ui/desktop (#7515)
  chore(deps-dev): bump rollup from 4.57.1 to 4.59.0 in /ui/desktop (#7522)
  chore(deps): bump minimatch in /ui/desktop (#7572)
  fix: validate configure probe for streaming providers (#7564)
  Dockerfile: add missing build/runtime dependencies (#7546)
  fix(claude-code): Permission routing for smart-approve (#7501)
  Add base_path field to custom provider config (#7558)
  ...
lifeizhou-ap added a commit that referenced this pull request Mar 3, 2026
* main: (74 commits)
  feat: return structured {stdout, stderr} from shell tool with output schema (#7604)
  Improve custom provider creation experience (#7541)
  fix(scheduler): schedules added via CLI showing up in UI (#7594)
  chore: openai reasoning model cleanup (#7529)
  chore(deps): bump hono from 4.12.1 to 4.12.3 in /evals/open-model-gym/mcp-harness (#7585)
  chore(deps): bump minimatch from 10.1.1 to 10.2.3 in /evals/open-model-gym/suite (#7498)
  chore(deps): bump swiper from 11.2.10 to 12.1.2 in /documentation (#7368)
  Better network failure error & antrhopic retry (#7595)
  feat: make the text bar persistent and add a queue for messages (#7560)
  fix: outdated clippy command in goosehints (#7590)
  chore(deps): bump hono from 4.11.7 to 4.12.1 in /evals/open-model-gym/mcp-harness (#7417)
  chore(deps-dev): bump ajv from 6.12.6 to 6.14.0 in /ui/desktop (#7437)
  chore(deps): bump ajv from 8.17.1 to 8.18.0 in /evals/open-model-gym/mcp-harness (#7491)
  chore(deps): bump hono from 4.12.0 to 4.12.2 in /ui/desktop (#7515)
  chore(deps-dev): bump rollup from 4.57.1 to 4.59.0 in /ui/desktop (#7522)
  chore(deps): bump minimatch in /ui/desktop (#7572)
  fix: validate configure probe for streaming providers (#7564)
  Dockerfile: add missing build/runtime dependencies (#7546)
  fix(claude-code): Permission routing for smart-approve (#7501)
  Add base_path field to custom provider config (#7558)
  ...
tlongwell-block added a commit that referenced this pull request Mar 4, 2026
* origin/main:
  feat: return structured {stdout, stderr} from shell tool with output schema (#7604)
  Improve custom provider creation experience (#7541)
  fix(scheduler): schedules added via CLI showing up in UI (#7594)
  chore: openai reasoning model cleanup (#7529)
  chore(deps): bump hono from 4.12.1 to 4.12.3 in /evals/open-model-gym/mcp-harness (#7585)
  chore(deps): bump minimatch from 10.1.1 to 10.2.3 in /evals/open-model-gym/suite (#7498)
  chore(deps): bump swiper from 11.2.10 to 12.1.2 in /documentation (#7368)
  Better network failure error & antrhopic retry (#7595)
  feat: make the text bar persistent and add a queue for messages (#7560)
craigwalkeruk pushed a commit to craigwalkeruk/custom-goose that referenced this pull request Mar 5, 2026
tlongwell-block added a commit that referenced this pull request Mar 5, 2026
* origin/main: (107 commits)
  Merge platform/builtin extensions (#7630)
  Clean up stale references to removed components (#7644)
  fix: scope empty session reuse to current window to prevent session mixing (#7602)
  fix: prevent abort in local inference  (#7633)
  Revert git patch for llama-cpp-2 (#7642)
  docs: update recipe usage step to reflect auto-submit behavior (#7639)
  docs: add guide for customizing the sidebar (#7638)
  docs: update Claude Code approve behavior and model list in cli-providers guide (#7448)
  fix: restore provider and extensions for LRU-evicted sessions (#7616)
  Restore goosed logging (#7622)
  feat: return structured {stdout, stderr} from shell tool with output schema (#7604)
  Improve custom provider creation experience (#7541)
  fix(scheduler): schedules added via CLI showing up in UI (#7594)
  chore: openai reasoning model cleanup (#7529)
  chore(deps): bump hono from 4.12.1 to 4.12.3 in /evals/open-model-gym/mcp-harness (#7585)
  chore(deps): bump minimatch from 10.1.1 to 10.2.3 in /evals/open-model-gym/suite (#7498)
  chore(deps): bump swiper from 11.2.10 to 12.1.2 in /documentation (#7368)
  Better network failure error & antrhopic retry (#7595)
  feat: make the text bar persistent and add a queue for messages (#7560)
  fix: outdated clippy command in goosehints (#7590)
  ...

# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	crates/goose-server/src/commands/agent.rs
#	crates/goose-server/src/main.rs
#	crates/goose-server/src/routes/reply.rs
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.

3 participants