Skip to content

feat(mitm): add Antigravity reasoning-effort overrides - #7228

Merged
diegosouzapw merged 2 commits into
release/v3.8.49from
feat/port-pr-2584-antigravity-reasoning-effort-overrides
Jul 17, 2026
Merged

diegosouzapw merged 2 commits into
release/v3.8.49from
feat/port-pr-2584-antigravity-reasoning-effort-overrides

Conversation

@diegosouzapw

Copy link
Copy Markdown
Owner

Summary

  • Antigravity MITM alias entries now support an optional reasoning-effort override alongside the existing destination-model mapping ({ model?, reasoningEffort? }); legacy plain-string mappings still normalize to { model } with no DB migration required.
  • The standalone Antigravity proxy forwards the chosen tier as a top-level reasoningEffortOverride; the antigravity→openai translator honors it ahead of its thinkingConfig-derived guess, and an explicit "none" suppresses reasoning_effort even when Antigravity's own request asked for thinking.
  • The Antigravity tool card now exposes a per-model reasoning-effort selector (Default/None/Low/Medium/High/XHigh) next to the model-mapping input, reusing OmniRoute's existing canonical 5-tier reasoning vocabulary instead of introducing a new one.

Attribution

Thanks to @trfi for the original implementation.

Changes

  • src/mitm/aliasConfig.ts (new) + src/mitm/_internal/aliasConfig.cjs (new, CJS mirror for the standalone proxy process): normalize/validate alias entries and reasoning-effort values.
  • src/mitm/server.cjs: getMappedModel → getMappedOverride; intercept() applies the override (model swap + reasoningEffortOverride) via the new shim.
  • open-sse/translator/request/antigravity-to-openai.ts: honor an explicit reasoningEffortOverride ahead of the thinkingConfig-derived tier.
  • src/app/api/cli-tools/antigravity-mitm/alias/route.ts + src/shared/validation/schemas/cli.ts: accept the structured mapping shape, validate reasoning-effort values at the API boundary.
  • src/app/(dashboard)/dashboard/cli-code/components/AntigravityToolCard.tsx: per-model reasoning-effort selector.
  • i18n: new cliTools.reasoningEffort* keys in en.json + placeholder entries in all other locales.

Test plan

  • TDD: tests/unit/mitm-antigravity-reasoning-effort-override.test.ts (14 cases) and tests/unit/mitm-alias-config-shim.test.ts (6 cases) — confirmed failing against the pre-change translator (override ignored: low !== high, none did not suppress reasoning_effort, reasoning-only override was a no-op) and passing after the fix.
  • npm run typecheck:core — clean.
  • npx eslint on all changed files — clean (the one pre-existing AntigravityToolCard.tsx react-hooks/exhaustive-deps warning was confirmed present on the unmodified base file, not introduced by this change).
  • Existing tests/unit/translator-antigravity-to-openai.test.ts (9 cases) and tests/unit/antigravity-orphan-toolresult-6026.test.ts (3 cases) still pass — no regression.

The Antigravity MITM alias mapping only ever swapped the destination model;
there was no way to override the reasoning effort Antigravity's own
thinkingConfig requested. Alias entries are now `{ model?, reasoningEffort? }`
(a legacy plain-string mapping still normalizes to `{ model }`, so no DB
migration is required). The standalone proxy (server.cjs) forwards the chosen
tier as a top-level `reasoningEffortOverride` on the intercepted request; the
antigravity->openai translator honors it ahead of its thinkingConfig-derived
guess, and an explicit "none" suppresses reasoning_effort entirely even when
Antigravity's own request asked for thinking. Reuses the existing canonical
5-tier reasoning vocabulary (`@/shared/reasoning/effortStandardization.ts`,
with max/extra aliasing to xhigh) instead of introducing a new one. The API
route validates the reasoning-effort value at the boundary and the Antigravity
tool card UI now exposes a per-model reasoning-effort selector alongside the
existing model-mapping input.

Co-authored-by: Truong Fiu <gnourtf@gmail.com>
Inspired-by: decolua/9router#2584
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@diegosouzapw

Copy link
Copy Markdown
Owner Author

Aprovado. Diff grande mas escopo bate 1:1 com o body (i18n é churn mecânico de placeholder MISSING em 44 locais, padrão já usado no projeto). Revert-proof no translator confirma fail-without-fix (2/14 testes caem sem o fix). Validação de segurança OK: Hard Rule #13 (sem interpolação de shell no .cjs) e #7 (Zod + hasInvalidReasoningEffort rejeitando valor de reasoning inválido com 400 na borda da API). Único ponto de atenção não-bloqueante: a duplicação aliasConfig.ts/aliasConfig.cjs é uma dívida arquitetural inerente (server.cjs não pode importar ESM/TS) — os dois têm teste próprio, mas nada garante que fiquem sincronizados se só um for editado no futuro; vale considerar um gerador ou um teste cross-check de paridade entre os dois módulos numa PR futura. Pronto para merge como está.

@diegosouzapw
diegosouzapw merged commit ca03d61 into release/v3.8.49 Jul 17, 2026
15 checks passed
@diegosouzapw
diegosouzapw deleted the feat/port-pr-2584-antigravity-reasoning-effort-overrides branch July 19, 2026 21:00
HouMinXi pushed a commit to HouMinXi/OmniRoute that referenced this pull request Aug 2, 2026
…7228)

* feat(mitm): add Antigravity reasoning-effort overrides

The Antigravity MITM alias mapping only ever swapped the destination model;
there was no way to override the reasoning effort Antigravity's own
thinkingConfig requested. Alias entries are now `{ model?, reasoningEffort? }`
(a legacy plain-string mapping still normalizes to `{ model }`, so no DB
migration is required). The standalone proxy (server.cjs) forwards the chosen
tier as a top-level `reasoningEffortOverride` on the intercepted request; the
antigravity->openai translator honors it ahead of its thinkingConfig-derived
guess, and an explicit "none" suppresses reasoning_effort entirely even when
Antigravity's own request asked for thinking. Reuses the existing canonical
5-tier reasoning vocabulary (`@/shared/reasoning/effortStandardization.ts`,
with max/extra aliasing to xhigh) instead of introducing a new one. The API
route validates the reasoning-effort value at the boundary and the Antigravity
tool card UI now exposes a per-model reasoning-effort selector alongside the
existing model-mapping input.

Co-authored-by: Truong Fiu <gnourtf@gmail.com>
Inspired-by: decolua/9router#2584

* chore(changelog): fragment for diegosouzapw#7228

---------

Co-authored-by: Truong Fiu <gnourtf@gmail.com>
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…7228)

* feat(mitm): add Antigravity reasoning-effort overrides

The Antigravity MITM alias mapping only ever swapped the destination model;
there was no way to override the reasoning effort Antigravity's own
thinkingConfig requested. Alias entries are now `{ model?, reasoningEffort? }`
(a legacy plain-string mapping still normalizes to `{ model }`, so no DB
migration is required). The standalone proxy (server.cjs) forwards the chosen
tier as a top-level `reasoningEffortOverride` on the intercepted request; the
antigravity->openai translator honors it ahead of its thinkingConfig-derived
guess, and an explicit "none" suppresses reasoning_effort entirely even when
Antigravity's own request asked for thinking. Reuses the existing canonical
5-tier reasoning vocabulary (`@/shared/reasoning/effortStandardization.ts`,
with max/extra aliasing to xhigh) instead of introducing a new one. The API
route validates the reasoning-effort value at the boundary and the Antigravity
tool card UI now exposes a per-model reasoning-effort selector alongside the
existing model-mapping input.

Co-authored-by: Truong Fiu <gnourtf@gmail.com>
Inspired-by: decolua/9router#2584

* chore(changelog): fragment for diegosouzapw#7228

---------

Co-authored-by: Truong Fiu <gnourtf@gmail.com>
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.

1 participant