Skip to content

fix(providers/command-code): fix validation request format for Command Code API - #2243

Merged
diegosouzapw merged 4 commits into
cheaper-inference:release/v3.8.0from
ddarkr:fix/command-code-validation
May 14, 2026
Merged

diegosouzapw merged 4 commits into
cheaper-inference:release/v3.8.0from
ddarkr:fix/command-code-validation

Conversation

@ddarkr

@ddarkr ddarkr commented May 14, 2026

Copy link
Copy Markdown
Contributor

Problem

The POST /api/providers/validate endpoint was sending an invalid request body to Command Code's /alpha/generate API, causing a 400 error that was misinterpreted as "Invalid API key".

Root cause

  • x-cli-environment header set to production was rejected by Command Code API
  • stream: true in the validation request caused compatibility issues with the validation endpoint

Changes (2 files)

src/lib/providers/validation.ts

  • Changed x-cli-environment from production to external
  • Changed environment from omniroute-validation to external
  • Removed skills: null (Command Code API rejects this field)
  • Updated default validation model to deepseek/deepseek-v4-flash
  • Changed stream from true to false

open-sse/executors/commandCode.ts

  • Changed environment from omniroute to external
  • Removed skills: null (Command Code API rejects this field)

@ddarkr
ddarkr requested a review from diegosouzapw as a code owner May 14, 2026 09:17

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the environment configuration to "external" across the codebase and refines the validation logic by removing the "skills" field, disabling streaming, and updating the default model to "deepseek/deepseek-v4-flash". Feedback highlights a potential inconsistency where the "x-cli-environment" header remains set to "production" in the execution logic, which could cause requests to fail. Additionally, it is suggested to prioritize the new DeepSeek model over the registry's first model in the validation logic to ensure the intended model is used for connectivity probes.

workingDir: "/workspace",
date: new Date().toISOString().slice(0, 10),
environment: "omniroute",
environment: "external",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The pull request description states that the x-cli-environment header set to production is rejected by the Command Code API. While you have updated the environment field in the request body here to external, the x-cli-environment header in the execute method (line 507) still uses production. This discrepancy will likely cause actual inference requests to fail even if validation succeeds.

Comment on lines +437 to +440
model:
providerSpecificData?.validationModelId ||
entry?.models?.[0]?.id ||
"deepseek/deepseek-v4-flash",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The pull request description mentions updating the default validation model to deepseek/deepseek-v4-flash. However, the current implementation prioritizes entry?.models?.[0]?.id (which resolves to claude-opus-4-7 in the registry) over the new DeepSeek model. If the intention is to use the DeepSeek model by default for validation (likely because it is faster and more cost-effective for a connectivity probe), it should be prioritized over the registry's first model.

        model:
          providerSpecificData?.validationModelId ||
          "deepseek/deepseek-v4-flash",

@diegosouzapw
diegosouzapw merged commit 1b14b5b into cheaper-inference:release/v3.8.0 May 14, 2026
1 of 2 checks passed
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Thanks @ddarkr! Squash-merged into release/v3.8.0 as 1b14b5b0. Clean, surgical fix — the external environment marker plus stream: false correctly unblocks the Command Code validation probe, and the test updates keep coverage in lock-step with the headers/body changes. Appreciated.

diegosouzapw added a commit that referenced this pull request May 14, 2026
Deep audit of all 320 commits since v3.7.9 found:
- 18 merged PRs not documented in CHANGELOG (4 features, 10 bug fixes, 1 security, 2 chores, 1 debug improvement)
- 3 contributors entirely missing from credits table (@NomenAK with 12 PRs, @kang-heewon, @one-vs)
- 4 existing contributors with inaccurate PR counts (@oyi77 8→12, @ddarkr 2→3, @andrewmunsell 2→3, @nickwizard 2→3)

New entries added:
- feat: #2135 (1proxy settings), #2227 (antigravity project ID), #2238 (Z.AI Search), #2240 (CLI Suite)
- fix: #2217, #2218, #2219, #2221, #2222, #2223, #2224, #2231, #2233, #2236, #2242, #2243
- security: #2209 (stack trace exposure)
- chore: #2228, #2234

Total contributors updated from 50+ to 55+.
@ddarkr
ddarkr deleted the fix/command-code-validation branch July 9, 2026 06:18
HouMinXi pushed a commit to HouMinXi/OmniRoute that referenced this pull request Aug 2, 2026
…d Code API (cheaper-inference#2243)

Integrated into release/v3.8.0 — Command Code validation now sends correct external environment and stream=false.
HouMinXi pushed a commit to HouMinXi/OmniRoute that referenced this pull request Aug 2, 2026
Deep audit of all 320 commits since v3.7.9 found:
- 18 merged PRs not documented in CHANGELOG (4 features, 10 bug fixes, 1 security, 2 chores, 1 debug improvement)
- 3 contributors entirely missing from credits table (@NomenAK with 12 PRs, @kang-heewon, @one-vs)
- 4 existing contributors with inaccurate PR counts (@oyi77 8→12, @ddarkr 2→3, @andrewmunsell 2→3, @nickwizard 2→3)

New entries added:
- feat: cheaper-inference#2135 (1proxy settings), cheaper-inference#2227 (antigravity project ID), cheaper-inference#2238 (Z.AI Search), cheaper-inference#2240 (CLI Suite)
- fix: cheaper-inference#2217, cheaper-inference#2218, cheaper-inference#2219, cheaper-inference#2221, cheaper-inference#2222, cheaper-inference#2223, cheaper-inference#2224, cheaper-inference#2231, cheaper-inference#2233, cheaper-inference#2236, cheaper-inference#2242, cheaper-inference#2243
- security: cheaper-inference#2209 (stack trace exposure)
- chore: cheaper-inference#2228, cheaper-inference#2234

Total contributors updated from 50+ to 55+.
Poid-ZA pushed a commit to Poid-ZA/OmniRoute that referenced this pull request Aug 5, 2026
…d Code API (cheaper-inference#2243)

Integrated into release/v3.8.0 — Command Code validation now sends correct external environment and stream=false.
Poid-ZA pushed a commit to Poid-ZA/OmniRoute that referenced this pull request Aug 5, 2026
Deep audit of all 320 commits since v3.7.9 found:
- 18 merged PRs not documented in CHANGELOG (4 features, 10 bug fixes, 1 security, 2 chores, 1 debug improvement)
- 3 contributors entirely missing from credits table (@NomenAK with 12 PRs, @kang-heewon, @one-vs)
- 4 existing contributors with inaccurate PR counts (@oyi77 8→12, @ddarkr 2→3, @andrewmunsell 2→3, @nickwizard 2→3)

New entries added:
- feat: cheaper-inference#2135 (1proxy settings), cheaper-inference#2227 (antigravity project ID), cheaper-inference#2238 (Z.AI Search), cheaper-inference#2240 (CLI Suite)
- fix: cheaper-inference#2217, cheaper-inference#2218, cheaper-inference#2219, cheaper-inference#2221, cheaper-inference#2222, cheaper-inference#2223, cheaper-inference#2224, cheaper-inference#2231, cheaper-inference#2233, cheaper-inference#2236, cheaper-inference#2242, cheaper-inference#2243
- security: cheaper-inference#2209 (stack trace exposure)
- chore: cheaper-inference#2228, cheaper-inference#2234

Total contributors updated from 50+ to 55+.
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…d Code API (cheaper-inference#2243)

Integrated into release/v3.8.0 — Command Code validation now sends correct external environment and stream=false.
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
Deep audit of all 320 commits since v3.7.9 found:
- 18 merged PRs not documented in CHANGELOG (4 features, 10 bug fixes, 1 security, 2 chores, 1 debug improvement)
- 3 contributors entirely missing from credits table (@NomenAK with 12 PRs, @kang-heewon, @one-vs)
- 4 existing contributors with inaccurate PR counts (@oyi77 8→12, @ddarkr 2→3, @andrewmunsell 2→3, @nickwizard 2→3)

New entries added:
- feat: cheaper-inference#2135 (1proxy settings), cheaper-inference#2227 (antigravity project ID), cheaper-inference#2238 (Z.AI Search), cheaper-inference#2240 (CLI Suite)
- fix: cheaper-inference#2217, cheaper-inference#2218, cheaper-inference#2219, cheaper-inference#2221, cheaper-inference#2222, cheaper-inference#2223, cheaper-inference#2224, cheaper-inference#2231, cheaper-inference#2233, cheaper-inference#2236, cheaper-inference#2242, cheaper-inference#2243
- security: cheaper-inference#2209 (stack trace exposure)
- chore: cheaper-inference#2228, cheaper-inference#2234

Total contributors updated from 50+ to 55+.
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.

2 participants