Repository navigation
fix(providers/command-code): fix validation request format for Command Code API - #2243
Conversation
…validation changes
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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.
| model: | ||
| providerSpecificData?.validationModelId || | ||
| entry?.models?.[0]?.id || | ||
| "deepseek/deepseek-v4-flash", |
There was a problem hiding this comment.
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",1b14b5b
into
cheaper-inference:release/v3.8.0
|
Thanks @ddarkr! Squash-merged into |
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+.
…d Code API (cheaper-inference#2243) Integrated into release/v3.8.0 — Command Code validation now sends correct external environment and stream=false.
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+.
…d Code API (cheaper-inference#2243) Integrated into release/v3.8.0 — Command Code validation now sends correct external environment and stream=false.
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+.
…d Code API (cheaper-inference#2243) Integrated into release/v3.8.0 — Command Code validation now sends correct external environment and stream=false.
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+.
Problem
The
POST /api/providers/validateendpoint was sending an invalid request body to Command Code's/alpha/generateAPI, causing a 400 error that was misinterpreted as "Invalid API key".Root cause
x-cli-environmentheader set toproductionwas rejected by Command Code APIstream: truein the validation request caused compatibility issues with the validation endpointChanges (2 files)
src/lib/providers/validation.tsx-cli-environmentfromproductiontoexternalenvironmentfromomniroute-validationtoexternalskills: null(Command Code API rejects this field)deepseek/deepseek-v4-flashstreamfromtruetofalseopen-sse/executors/commandCode.tsenvironmentfromomniroutetoexternalskills: null(Command Code API rejects this field)