mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-11-16 17:09:09 +00:00
## Summary
- GitHub Copilot returns HTTP 400 ("Unsupported parameter: 'temperature'") for GPT-5.4 and newer GPT-5.x and for GPT-6.x. The GitHub strip rule only matched `/gpt-5\.4/`, so the registry models `gpt-5.5`, `gpt-5.6-sol`, `gpt-5.6-terra`, `gpt-5.6-luna` and `gpt-6-astra` still forwarded `temperature` and failed for any client that sends one (most agent clients do on every turn).
- The regex is now an anchored predicate covering 5.4–5.9, 5.10+, and `gpt-6` with or without a minor version (`gpt-6-astra`, `gpt-6.1-sol`). It also no longer over-matches malformed ids such as `gpt-5.4invalid`.
## Attribution
Thanks to [@m00nie](https://github.com/m00nie) for the original implementation.
## Changes
- `open-sse/translator/paramSupport.ts`: new exported `isGithubTemperatureUnsupportedModel()` (regex `^gpt-(?:5\.(?:[4-9]|[1-9]\d+)|6(?:\.\d+)?)(?:-|$)`, ignores a leading `provider/` prefix), used by the `github` temperature rule.
- `open-sse/executors/github.ts`: the duplicate hard-coded `gpt-5.4` guard in `transformRequest` now calls the same predicate, so the two can't drift. `transformRequest` already handles both chat and Responses bodies, so no extra call site is needed for the Responses path.
- Tests: strip/keep tables in `tests/unit/executors-strip-unsupported-params.test.ts`, plus a `GithubExecutor.transformRequest` case in `tests/unit/executor-github.test.ts` that covers chat and Responses bodies for gpt-5.6-*/gpt-6-*, keeps `temperature` for gpt-5.3-codex, and checks that the caller's body is not mutated.
## Test plan
- TDD: the 3 new tests failed on the base before the fix (`gpt-5.6-*`/`gpt-6-*` kept `temperature`, and `gpt-5.4invalid` was over-stripped), and they pass after it.
- `node --import tsx/esm --test tests/unit/executors-strip-unsupported-params.test.ts tests/unit/executor-github.test.ts` → `ℹ tests 58 ℹ pass 58 ℹ fail 0`
- Sibling sweep (every `tests/unit` file that references `paramSupport` / `stripUnsupportedParams` / `GithubExecutor`, 31 files) → `ℹ tests 281 ℹ pass 280 ℹ fail 1`. The one failure was a 42 s load timeout in `github-copilot-auto-model.test.ts` under concurrency. Rerun on its own: `ℹ tests 14 ℹ pass 14 ℹ fail 0`
- `npx eslint --suppressions-location config/quality/eslint-suppressions.json <changed files>` → clean
- `npx prettier --check <changed files>` → all formatted
- `npm run typecheck:core` → clean
- `GITHUB_BASE_REF=release/v3.8.52 npm run check:test-masking` → `OK — 2 modificado(s) … sem enfraquecimento`
⚠️ base-red inherited: #15306 — unit/vitest/integration/package-artifact gates on release/v3.8.52
Thanks @diegosouzapw.
31 KiB
31 KiB