Skip to content

Send max output tokens when the OpenAI Compatible checkbox shows ticked - #2684

Open
SoccerField24x7 wants to merge 1 commit into
Zoo-Code-Org:mainfrom
SoccerField24x7:fix/2230-include-max-tokens-default
Open

SoccerField24x7 wants to merge 1 commit into
Zoo-Code-Org:mainfrom
SoccerField24x7:fix/2230-include-max-tokens-default

Conversation

@SoccerField24x7

Copy link
Copy Markdown
Contributor

Related GitHub Issue

Closes: #2230

Credit

This PR continues #2231 by @scriptxyz. The shared default, the Kimi Code opt-in, and the base tests come from that PR. The bot closed #2231 because the author was inactive. @scriptxyz is a co-author of the commit.

Description

The "Include max output tokens" checkbox shows an unset value as checked (?? true). The request builders sent a limit only for an explicit true. Thus a profile that never toggled the checkbox showed it as ticked but sent no limit. Some gateways then used a low default limit. For example, a gateway default of 4096 tokens let reasoning use the full budget. The turn then stopped with finish_reason: "length" and no output.

This PR makes the UI and the request builders use the same default:

  1. Shared default. DEFAULT_OPEN_AI_INCLUDE_MAX_TOKENS = true in packages/types. The checkbox in OpenAICompatible.tsx reads it.
  2. One resolver. The new resolveOpenAiCompatibleMaxTokens() in src/api/providers/utils/openai-compatible-max-tokens.ts decides the limit. An unset or null value follows the default. Only an explicit false opts out. The resolver returns the first positive value from modelMaxTokens, then modelInfo.maxTokens.
  3. Both request builders use the resolver. Chat Completions (addMaxTokensIfNeeded() sends max_completion_tokens) and the Responses API (buildResponsesRequest() sends max_output_tokens) cannot drift apart again.
  4. Positive-value guard. Before fix: update openai sane-default parameter values for custom models #1847, openAiModelInfoSaneDefaults had maxTokens: -1. Profiles saved before fix: update openai sane-default parameter values for custom models #1847 can still store openAiCustomModelInfo.maxTokens: -1. fix: update openai sane-default parameter values for custom models #1847 removed -1 because Fireworks returns 400 max_tokens must be non-negative. The resolver skips values that are not positive, so these profiles still send no limit.
  5. Kimi Code stays opt-in. Kimi Code has no checkbox. It now passes includeMaxTokens: options.includeMaxTokens === true to the base handler. A value left in the profile by OpenAI Compatible does not opt it in.

Changes since #2231:

  1. The Responses API path from [Fix] Reasoning with tool use fails on OpenAI Compatible endpoints that require the Responses API #2498 now uses the same default. [Fix] Reasoning with tool use fails on OpenAI Compatible endpoints that require the Responses API #2498 merged after [Fix] Send max output tokens when the OpenAI Compatible checkbox shows ticked #2231, and its gate had the same === true problem.
  2. The guard changes from if (maxTokens) to positive values only. if (maxTokens) lets a legacy -1 through.
  3. One resolver replaces the two separate gates.

Other subclasses do not change. DeepSeek passes includeMaxTokens: true and uses its own logic. MiMo passes includeMaxTokens: false. Moonshot overrides addMaxTokensIfNeeded(). DeepSeek, MiMo, Moonshot, and Kimi Code all pass openAiUseResponsesApi: false, so none of them can reach buildResponsesRequest().

Roadmap area: Reliability First (support more AI providers and models).

Reviewer callouts:

  • Intended change: an OpenAI Compatible profile with an unset includeMaxTokens and a positive max output token value now sends the limit. This matches what the checkbox shows.
  • No change: profiles without a max output token value, profiles with an explicit false, legacy -1 profiles, DeepSeek, MiMo, Moonshot, and Kimi Code.
  • Risk: some users can have a value that is larger than their gateway accepts. Before this fix, the value had no effect because Zoo Code did not send it. After this fix, those requests can fail until the user lowers the value. This is the correct behavior, but reviewers must know about it.

Test Procedure

New and changed tests (35 new test cases, 1 replaced, net +34):

File Cases Coverage
openai-compatible-max-tokens.spec.ts (new) 24 includeMaxTokens of undefined, null, true, false, each with 6 limit pairs: (456, 1000), (undefined, 1000), (0, 1000), (undefined, -1), (-1, 1000), (undefined, undefined)
openai.spec.ts, Chat Completions 4 (replace 1) Unset, true, false, and unset with legacy -1. Each case checks streaming, non-streaming, and completePrompt
openai.spec.ts, Responses API 2 An unset value sends max_output_tokens from createMessage and from completePrompt
openai-compatible-responses.spec.ts 2 added, 1 changed The unset row now expects the limit. New rows for model: -1 and custom: -1
kimi-code.spec.ts 3 undefined, false, and true give false, false, and true

When I restore the old request builder code, 6 of the new tests fail. The new resolver and openai-compatible-responses.ts have 100% line and branch coverage.

The existing OpenAICompatible.spec.tsx tests already check that an unset value and a null value show the checkbox as checked. They pass without changes.

Commands:

cd src && npx vitest run \
  api/providers/utils/__tests__/openai-compatible-max-tokens.spec.ts \
  api/providers/utils/__tests__/openai-compatible-responses.spec.ts \
  api/providers/__tests__/openai.spec.ts \
  api/providers/__tests__/kimi-code.spec.ts \
  api/providers/__tests__/deepseek.spec.ts \
  api/providers/__tests__/moonshot.spec.ts \
  api/providers/__tests__/mimo.spec.ts
# 7 files passed, 825 tests passed, 1 skipped

cd webview-ui && npx vitest run src/components/settings/providers/__tests__/OpenAICompatible.spec.tsx
# 26 tests passed

pnpm test                     # 14/14 tasks passed
pnpm --dir src run check-types
pnpm --dir webview-ui exec tsc --noEmit
pnpm knip
pnpm knip:production

ESLint passes on all changed files. No suppression count in src/eslint-suppressions.json changes.

Manual evidence: before the fix, an OpenAI Compatible gateway with reasoning_effort: high used its default limit of 4096 tokens. Reasoning used the full budget, and the turn ended with finish_reason: "length" and no output. After a toggle of the checkbox, Zoo Code sent max_completion_tokens: 32000 and the turn completed.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Listing Discussion (new provider or MCP server only): Not applicable.
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I reviewed my own code with care.
  • Writing Style: The PR title and description use Simplified Technical English (ASD-STE100): short sentences, plain words, active voice, one idea per sentence, no contractions.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Test Helpers (test changes only): Shared test helpers (src/test-utils/, @/utils/test-utils) are used only for mechanical duplication. Test intent and scenario-specific mocks remain visible.
  • Visual Snapshot (UI changes only): Not applicable. The checkbox looks the same. Only the source of its default value changes.
  • Documentation Impact: I checked if my changes need documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I read and agree to the Contributor Guidelines.

Visual Snapshots

Not applicable. The rendered UI does not change.

Videos (interaction / animation only)

Not applicable.

Documentation Updates

  • No documentation updates are required.

Additional Notes

Out of scope (possible follow-up issues):

  • Send max_tokens together with max_completion_tokens for gateways that ignore the newer field.
  • Show a UI hint when the checkbox is ticked but no max output token value exists.
  • Add a migration that removes stored maxTokens: -1 values. The resolver guard makes this unnecessary for correctness.

AI assistance: I used an AI coding assistant to help write the code and tests. I reviewed each change, and I ran the tests on my computer.

@taltas, please review this PR. @p12tic, you approved #2231. This PR keeps that design.

Get in Touch

CodeNja

The "Include max output tokens" checkbox shows an unset value as checked.
The Chat Completions and Responses request builders sent a limit only for
an explicit true. Both builders now use one resolver with the shared
DEFAULT_OPEN_AI_INCLUDE_MAX_TOKENS default. Only an explicit false opts out.
The resolver returns only positive limits. Profiles saved before Zoo-Code-Org#1847
with maxTokens: -1 do not send a negative limit. Kimi Code stays opt-in.

This continues Zoo-Code-Org#2231 by @scriptxyz.

Closes Zoo-Code-Org#2230

Co-authored-by: scriptxyz <11991772+scriptxyz@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • OpenAI-compatible providers now use the model’s configured output-token limit by default for chat and completion requests. Setting the limit off still omits it, and invalid limits are handled without sending an unusable value.
    • Kimi Code includes the output-token limit only when explicitly enabled.

OpenAI-compatible settings now share a default for including output token limits. A resolver selects a positive custom or model limit for Chat Completions and Responses requests. Kimi Code continues to include the limit only when explicitly enabled.

Changes: OpenAI-compatible token limits

Layer / File(s) Summary
Shared default and settings UI
packages/types/src/providers/openai.ts, packages/types/src/provider-settings.ts, webview-ui/src/components/settings/providers/OpenAICompatible.tsx
The default is exported as true. The settings checkbox uses this default when includeMaxTokens is unset.
Resolve limits for OpenAI requests
src/api/providers/utils/openai-compatible-max-tokens.ts, src/api/providers/openai.ts, src/api/providers/utils/openai-compatible-responses.ts, src/api/providers/utils/__tests__/*, src/api/providers/__tests__/openai.spec.ts
The shared resolver returns no limit when inclusion is false. Otherwise, it selects the first positive custom or model limit. Chat Completions and Responses requests use the resolver, with tests covering default, opt-out, and limit selection cases.
Preserve Kimi Code opt-in behavior
src/api/providers/kimi-code.ts, src/api/providers/__tests__/kimi-code.spec.ts
Kimi Code passes includeMaxTokens as true only when the option is exactly true. Tests cover omitted, false, and true values.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

  • Zoo-Code-Org/Zoo-Code#2231: It addresses the same unset-setting behavior. This change also applies shared resolution to Responses API requests.
Merge Risk: Minimal · up to 33ef2

OpenAI Compatible profiles with the checkbox showing checked now send the configured output token limit, matching the UI. Kimi Code and the other providers behave as before. No merge-blocking risk was found.

Pre-merge checks: Passed 8

Check name Status Explanation
Title check Passed The title says the PR sends max output tokens when the OpenAI Compatible checkbox shows ticked. The change does this: an unset value now follows the checked default, and the request builders send the …
Description check Passed The description follows the template well. It links issue #2230 with 'Closes: #2230', and it has a detailed Description covering the how, the trade-offs, and reviewer callouts. The Test Procedure sect…
Linked Issues check Passed [#2230] Requires max_completion_tokens when the checkbox shows checked (unset includeMaxTokens) and a max output token value exists. At head, resolveOpenAiCompatibleMaxTokens() in src/api/providers/ut…
Out of Scope Changes check Passed The changes stay within #2230 and the closed context issue #2231. The shared default constant and OpenAICompatible.tsx checkbox change align the UI with the request builders. The resolver implements t…
Regression Evidence Passed The changed behavior has test coverage at the unit or handler layer that matches each change. 1. Shared resolver (openai-compatible-max-tokens.ts): The new spec `openai-compatible-max-tokens.spec.ts…
Security Boundaries Passed The changed paths were inspected in the reviewed diff (refs/coderabbit/pre-merge-check/base..head). The change makes the OpenAI Compatible "Include max output tokens" default consistent across the set…
Persistence Integrity Passed The changed files do not touch any persistence write path. The diff changes request builders (src/api/providers/openai.ts, utils/openai-compatible-responses.ts, new `utils/openai-compatible-max-to…
Lifecycle Resource Cleanup Passed The check fails only when a changed lifecycle path can leak a listener, watcher, provider, timer, task, or other resource, or can duplicate work after cancellation, disposal, or restart. The PR change…
Full details: Title check

Explanation

The title says the PR sends max output tokens when the OpenAI Compatible checkbox shows ticked. The change does this: an unset value now follows the checked default, and the request builders send the limit. The title covers the main change, though it does not mention the shared default or the Responses API path. The title is short, uses plain words, and has no contractions.

Full details: Description check

Explanation

The description follows the template well. It links issue #2230 with 'Closes: #2230', and it has a detailed Description covering the how, the trade-offs, and reviewer callouts. The Test Procedure section lists the new and changed tests, the commands run, and manual evidence. The checklist is complete, with visual snapshot and listing discussion marked not applicable with reasons. Minor defects: the 'Get in Touch' section only lists a Discord-style name, and the description uses some contractions-free but long sentences that go against the ASD-STE100 style. The Credit section and the 'Changes since #2231' section add useful context. Overall the description is mostly complete.

Resolution

Optional improvements: shorten a few long sentences in the Description, such as the one about the gateway default of 4096 tokens, to match the ASD-STE100 style the template asks for. Confirm the 'Get in Touch' entry is the correct contact.

Full details: Linked Issues check

Explanation

[#2230] Requires max_completion_tokens when the checkbox shows checked (unset includeMaxTokens) and a max output token value exists. At head, resolveOpenAiCompatibleMaxTokens() in src/api/providers/utils/openai-compatible-max-tokens.ts applies DEFAULT_OPEN_AI_INCLUDE_MAX_TOKENS (true) when includeMaxTokens is null or undefined. Only an explicit false returns undefined. It returns the first positive value from modelMaxTokens, then modelInfo.maxTokens. openai.ts imports this resolver. The PR summary states that addMaxTokensIfNeeded() uses it. The truncated read of openai.ts did not reach addMaxTokensIfNeeded(), so that wiring is taken from the summary and the reported tests, not from the read source. The Responses API path (buildResponsesRequest) also uses the resolver. Kimi Code passes includeMaxTokens only when the value is exactly true, which keeps its opt-in behavior. Tests reported in the PR cover unset, true, false, and legacy -1 cases. [#2231] is closed and is context only; its requirements are not applied. Repository evidence for the diff of openai.ts was unavailable.

Full details: Out of Scope Changes check

Explanation

The changes stay within #2230 and the closed context issue #2231. The shared default constant and OpenAICompatible.tsx checkbox change align the UI with the request builders. The resolver implements the unset-default rule and the positive-value guard for legacy maxTokens -1 profiles. Applying the same rule to buildResponsesRequest() is a directly related extension, and the PR states the reason (#2498 used the same explicit true gate). The KimiCodeHandler change keeps existing behavior after the default changes. Tests cover the changed paths. DeepSeek, MiMo, and Moonshot are not changed in behavior. No unrelated change was found in the inspected files.

Full details: Regression Evidence

Explanation

The changed behavior has test coverage at the unit or handler layer that matches each change. 1. Shared resolver (openai-compatible-max-tokens.ts): The new spec openai-compatible-max-tokens.spec.ts is a table test. It covers includeMaxTokens values undefined, null, true, and false. It covers custom and model limits of 456, 0, -1, and undefined. The -1 and 0 cases guard the positive-value rule. The false opt-out is covered. The test calls the real function and does not copy its logic. 2. Chat Completions (openai.ts addMaxTokensIfNeeded): The it.each in openai.spec.ts covers unset, true, false, and unset with legacy maxTokens: -1. It checks the streaming path, the non-streaming path, and completePrompt. The old test that expected no limit for an unset value was replaced. The negative and legacy cases are present. 3. Responses API (openai-compatible-responses.ts): openai-compatible-responses.spec.ts now expects the limit when the value is unset. It adds a negative model limit row and a negative custom limit row. openai.spec.ts checks unset max_output_tokens through both createMessage and completePrompt. 4. Kimi Code (kimi-code.ts): kimi-code.spec.ts checks undefined, false, and true. The test reads the forwarded options.includeMaxTokens value. It does not assert the outgoing request body. This is a weaker layer than ideal, but it catches removal of the === true gate. 5. UI (OpenAICompatible.tsx): The change swaps a literal true for a constant with the same value. The checkbox looks the same. The existing OpenAICompatible.spec.tsx covers unset and null rendering as checked. No snapshot is required because no visible UI change occurs. 6. Unchanged providers (DeepSeek, MiMo, Moonshot): These are not changed in the diff. No test is required for them. No concrete test gap at the lowest valid layer was found for the changed behavior. The Kimi request-body assertion is the only area where a stronger test could exist. This does not meet the failure condition.

Full details: Security Boundaries

Explanation

The changed paths were inspected in the reviewed diff (refs/coderabbit/pre-merge-check/base..head). The change makes the OpenAI Compatible "Include max output tokens" default consistent across the settings UI and the Chat Completions and Responses API request builders. I checked the security categories in the custom check: - Exposed secrets or personal data: None. The diff adds no logging, storage, or transmission of credentials or personal data. The Kimi Code change only narrows includeMaxTokens to === true. - Trusted or executed unvalidated input: The new resolveOpenAiCompatibleMaxTokens() in src/api/providers/utils/openai-compatible-max-tokens.ts accepts only typeof value === "number" &amp;&amp; value &gt; 0 for modelMaxTokens and modelInfo.maxTokens. Non-numeric, NaN, zero, and negative values are rejected. The value is a numeric request parameter (max_completion_tokens or max_output_tokens), not code or a command. The input is the user's own profile configuration. - Bypassed approval or allowlist controls: None. No approval, allowlist, or permission gate is removed or altered. The changed behavior sends a token limit by default when a positive limit is configured. This is a behavior and cost or availability change, not a security boundary bypass. No changed path has a concrete security defect that matches the stated failure conditions. The functional risk described in the PR (a limit larger than a gateway accepts causing request failures) is not a security boundary issue under this check.

Full details: Persistence Integrity

Explanation

The changed files do not touch any persistence write path. The diff changes request builders (src/api/providers/openai.ts, utils/openai-compatible-responses.ts, new utils/openai-compatible-max-tokens.ts), the Kimi Code handler option mapping, a shared default constant in packages/types, and the checkbox default in OpenAICompatible.tsx. A search of the changed files found no writeFile, globalState.update, secrets.store, or profile-save calls. The new default is applied when the value is read. The UI checkbox and both request builders now call the same resolver or constant, so the default reaches every consumer that reads includeMaxTokens. Stored profiles keep their unset values, so no state is lost or overwritten. Other providers that read includeMaxTokens (DeepSeek, MiMo, Mistral, OpenCode Go) are unchanged. The PR has no write-without-await, non-atomic write, or rollback concern in its changed paths. The -1 guard prevents a stored legacy value from reaching the request. No changed path matches the stated failure conditions.

Full details: Lifecycle Resource Cleanup

Explanation

The check fails only when a changed lifecycle path can leak a listener, watcher, provider, timer, task, or other resource, or can duplicate work after cancellation, disposal, or restart. The PR changes 11 files. The changed runtime logic is limited to: - src/api/providers/openai.ts: addMaxTokensIfNeeded() now assigns max_completion_tokens from resolveOpenAiCompatibleMaxTokens(). This is a pure synchronous request-body computation. - src/api/providers/utils/openai-compatible-responses.ts: buildResponsesRequest() now sets max_output_tokens from the same resolver. It is also pure. - src/api/providers/utils/openai-compatible-max-tokens.ts (new): a pure function with no side effects. - src/api/providers/kimi-code.ts: an options value passed to the base constructor. No resource is created. - packages/types and OpenAICompatible.tsx: a constant and its import. The default changes only. The abort-signal bridge in openai.ts (around lines 386–433, bridgeExternalAbortSignal with removeExternalAbortListener in finally) is unchanged. The diff does not touch those hunks. The setTimeout in OpenAICompatible.tsx (line 102) is pre-existing and not in a changed hunk. None of the changed paths creates, retains, or restarts a listener, watcher, timer, provider, or task. None of them adds duplicate work after cancellation or disposal. Result: no changed path has a lifecycle cleanup defect.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Review status

Thanks for contributing. This comment tracks the review sequence and the next action.

Current step: Awaiting fresh human maintainer or CODEOWNER approval.

Automated review is complete for the latest commit but does not replace human approval.

Review-state labels are managed by this workflow; do not edit them manually. community-approved is managed the same way — do not add or remove it manually. It signals a fresh community code approval for the current head as an advisory priority only; maintainer review is still required.

@codecov

codecov Bot commented Nov 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown
Contributor

Changed-code mutation testing

Report for PR head 33ef20d7f58e.

Surviving / uncovered mutants Advisories
2 0
Details: mutants, guidance, and reproduction

Changed-code mutation testing

PackageChanged executable linesValidKilledTimeoutSurvivedNo coverageResult
types110010Advisory findings
extension162524010Advisory findings
webview111000Passed

Focused tests

  • types (cwd packages/types): src/__tests__/provider-settings.test.ts, src/__tests__/provider-model-id.test.ts, src/__tests__/telemetry.test.ts, src/__tests__/tool-repetition-limits.test.ts, src/__tests__/ipc.test.ts, src/__tests__/cli.test.ts, src/__tests__/nanogpt.test.ts, src/__tests__/global-settings.test.ts, src/__tests__/cloud.test.ts, src/__tests__/kimi-code.test.ts, src/__tests__/vscode-llm.spec.ts, src/__tests__/provider-identifiers.test.ts, src/__tests__/prompt-cache-ttl.test.ts, src/__tests__/openai-models.test.ts, src/__tests__/deepseek-v4-pro.test.ts, src/__tests__/provider-default-model.test.ts, src/__tests__/cache-write-ttl-pricing.test.ts, src/__tests__/model-message-types.test.ts, src/__tests__/index.test.ts, src/__tests__/telemetry.isTelemetryOptedIn.test.ts
  • extension (cwd src): core/task/__tests__/ask-auto-deny.spec.ts, core/webview/__tests__/ClineProvider.taskHistory.spec.ts, core/webview/__tests__/ClineProvider.spec.ts, api/providers/__tests__/kimi-code.spec.ts, __tests__/extension.spec.ts, core/task-persistence/__tests__/TaskHistoryStore.spec.ts, core/task/__tests__/Task.spec.ts, core/task/__tests__/ask-queued-message-drain.spec.ts, core/task/__tests__/Task.persistence.spec.ts, core/tools/__tests__/executeCommand.spec.ts, activate/__tests__/registerCommands.spec.ts, core/webview/__tests__/webviewMessageHandler.spec.ts, core/webview/__tests__/ClineProvider.sticky-mode.spec.ts, core/webview/__tests__/ClineProvider.apiHandlerRebuild.spec.ts, core/tools/__tests__/executeCommandTool.spec.ts, core/webview/__tests__/ClineProvider.sticky-profile.spec.ts, core/config/__tests__/importExport.spec.ts, __tests__/ClineProvider.history-resume-delegation.spec.ts, core/task/__tests__/Task.dispose.test.ts, core/task/__tests__/ask-clear-approval-buttons.spec.ts, api/providers/__tests__/openai.spec.ts, core/task/__tests__/Task.streaming-tool-calls.spec.ts, core/task/__tests__/ask-allowlist-cwd.spec.ts, core/webview/__tests__/ClineProvider.stale-view.spec.ts, api/providers/__tests__/friendli.spec.ts, core/config/__tests__/ProviderSettingsManager.spec.ts, core/task/__tests__/grace-retry-errors.spec.ts, core/task/__tests__/flushPendingToolResultsToHistory.spec.ts, core/webview/__tests__/webviewMessageHandler.newTask.spec.ts, core/webview/__tests__/ClineProvider.lockApiConfig.spec.ts, __tests__/single-open-invariant.spec.ts, api/providers/__tests__/model-catalog-adapters.spec.ts, core/task/__tests__/Task.throttle.test.ts, core/task/__tests__/reasoning-preservation.test.ts, api/providers/utils/__tests__/openai-compatible-responses.spec.ts, core/webview/__tests__/webviewMessageHandler.routerModels.spec.ts, core/task/__tests__/Task.run-shadow.spec.ts, core/assistant-message/__tests__/presentAssistantMessage-tool-usage-attribution.spec.ts, core/assistant-message/__tests__/presentAssistantMessage-custom-tool.spec.ts, api/providers/__tests__/deepseek.spec.ts, __tests__/ClineProvider.delegation.spec.ts, api/providers/__tests__/nanogpt.spec.ts, core/webview/__tests__/webviewMessageHandler.delete.spec.ts, api/providers/__tests__/mimo.spec.ts, core/webview/__tests__/ClineProvider.flicker-free-cancel.spec.ts, services/code-index/__tests__/code-index-status-manager.spec.ts, api/providers/__tests__/openai-native-tools.spec.ts, core/webview/__tests__/webviewMessageHandler.edit.spec.ts, activate/__tests__/registerCodeActions.spec.ts, core/webview/__tests__/webviewMessageHandler.checkpoint.spec.ts, core/webview/__tests__/checkpointRestoreHandler.spec.ts, core/task/__tests__/grounding-sources.test.ts, utils/__tests__/autoImportSettings.spec.ts, core/task/__tests__/Task.ignored-disabled-tools-notice.spec.ts, core/webview/__tests__/generateSystemPrompt.spec.ts, __tests__/ClineProvider.subtask-links.spec.ts, core/webview/__tests__/webviewMessageHandler.openFile.spec.ts, api/providers/__tests__/openai-usage-tracking.spec.ts, core/task-title/__tests__/TaskTitleService.spec.ts, core/task/__tests__/Task.resume-eviction-race.spec.ts, core/assistant-message/__tests__/presentAssistantMessage-unknown-tool.spec.ts, api/providers/__tests__/moonshot.spec.ts, core/task-title/__tests__/generateTaskTitle.spec.ts, core/task/__tests__/Task.abort-reason-race.spec.ts, activate/__tests__/handleUri.spec.ts, core/assistant-message/__tests__/presentAssistantMessage-auto-deny.spec.ts, extension/__tests__/api-task-conversation-history-length.spec.ts, __tests__/removeClineFromStack-delegation.spec.ts, extension/__tests__/api-start-task-logging.spec.ts, core/assistant-message/__tests__/presentAssistantMessage-images.spec.ts, core/webview/__tests__/messageEnhancer.test.ts, api/__tests__/index.spec.ts, extension/__tests__/api-configuration.spec.ts, core/assistant-message/__tests__/presentAssistantMessage-tool-repetition.spec.ts, extension/__tests__/api-has-task-ui-message-text.spec.ts, core/webview/__tests__/webviewMessageHandler.readOriginalContent.spec.ts, core/webview/__tests__/webviewMessageHandler.readFileContent.spec.ts, core/webview/__tests__/webviewMessageHandler.providerInfo.spec.ts, core/webview/__tests__/webviewMessageHandler.importRooHistory.spec.ts, core/webview/__tests__/webviewMessageHandler.searchFiles.spec.ts, extension/__tests__/api-start-new-task.spec.ts, extension/__tests__/api-send-message.spec.ts, core/task/__tests__/Task.pending-action.spec.ts, utils/__tests__/enhance-prompt.spec.ts, core/webview/__tests__/webviewMessageHandler.abandonSubtask.spec.ts, core/webview/__tests__/webviewMessageHandler.cloudAuth.spec.ts, __tests__/abandonSubtask.spec.ts, activate/__tests__/handleTask.spec.ts, services/marketplace/__tests__/marketplace-setting-check.spec.ts, core/webview/__tests__/webviewMessageHandler.lockApiConfig.spec.ts, core/task/__tests__/ask-abort-race.spec.ts, core/assistant-message/__tests__/presentAssistantMessage.spec.ts, extension/__tests__/api-delegation-events.spec.ts, __tests__/nested-delegation-resume.spec.ts, core/task/__tests__/Task.sticky-profile-race.spec.ts, core/task/__tests__/ToolExecutionContext.spec.ts, core/webview/__tests__/ClineProvider.pending-action.spec.ts, api/providers/__tests__/openai-timeout.spec.ts, services/code-index/__tests__/code-index-scope.spec.ts, api/providers/utils/__tests__/openai-compatible-max-tokens.spec.ts, core/webview/__tests__/ClineProviderFactory.spec.ts, extension/__tests__/api-delete-queued-message.spec.ts, __tests__/task-run-dispatch.spec.ts, __tests__/api-subtask.spec.ts, extension/__tests__/api-theme-fixture.spec.ts, test-utils/__tests__/provider.spec.ts, __tests__/new-task-delegation.spec.ts, core/task/__tests__/Task.terminal-operation.spec.ts, core/assistant-message/__tests__/toTelemetryToolName.spec.ts, extension/__tests__/api-terminal-profile.spec.ts
  • webview (cwd .): webview-ui/src/components/settings/providers/__tests__/OpenAICompatible.spec.tsx

All surviving and uncovered mutants

Warning annotations highlight up to 20 unique locations (maximum 7 per file). This summary lists every advisory mutant.

types

packages/types/src/providers/openai.ts

LineStatusMutatorReplacement
1120SurvivedBooleanLiteralfalse

extension

src/api/providers/utils/openai-compatible-max-tokens.ts

LineStatusMutatorReplacement
22SurvivedConditionalExpressiontrue

Resolve a mutation gap

Add or strengthen a focused test that fails under the mutation. If the mutant is equivalent, request maintainer approval for the narrowest mutator-specific exclusion and explain why it cannot change behavior:

// Stryker disable next-line ConditionalExpression: normalized input cannot reach the alternate branch
const result = condition ? value : fallback

Broad all exclusions and exclusions without a concrete reason are reported as advisories.

Reproduce locally

From a full checkout containing both commits:

pnpm install --frozen-lockfile
node scripts/stryker-diff.mjs ci --base d672d7961a3c553f28f0436364a50481009850e1 --head 57e87f51bd77ae31ed1d337738ee70de29b622e8

Mutation reports

  • types: reports/mutation/types/mutation.html
  • extension: reports/mutation/extension/mutation.html
  • webview: reports/mutation/webview/mutation.html

The workflow uploads generated reports in the changed-code-mutation-report artifact. A direct artifact link appears below after upload.

@github-actions github-actions Bot added coderabbit-review-active Required CI passed; CodeRabbit review is active awaiting-coderabbit Waiting for CodeRabbit to approve the latest commit labels Nov 24, 2026
@github-actions github-actions Bot added awaiting-maintainer CodeRabbit approved; waiting for a human maintainer and removed coderabbit-review-active Required CI passed; CodeRabbit review is active awaiting-coderabbit Waiting for CodeRabbit to approve the latest commit labels Nov 24, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-maintainer CodeRabbit approved; waiting for a human maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] OpenAI Compatible does not send max output tokens when the checkbox shows ticked

1 participant