Title: antigravity-ls-proxy: reasoning_effort 'default'/'name' resolves to a non-enum model — MODEL_MAP metadata keys pass the family lookup · Issue #686 · developing-today/code · GitHub
Open Graph Title: antigravity-ls-proxy: reasoning_effort 'default'/'name' resolves to a non-enum model — MODEL_MAP metadata keys pass the family lookup · Issue #686 · developing-today/code
X Title: antigravity-ls-proxy: reasoning_effort 'default'/'name' resolves to a non-enum model — MODEL_MAP metadata keys pass the family lookup · Issue #686 · developing-today/code
Description: Bug bin/antigravity-ls-proxy.mjs — resolveModelEnum, step 3 (family-with-effort lookup, lines 138–140): let effort = (requestedEffort || family.default || 'medium').toLowerCase().trim(); if (!family[effort]) effort = family.default || Ob...
Open Graph Description: Bug bin/antigravity-ls-proxy.mjs — resolveModelEnum, step 3 (family-with-effort lookup, lines 138–140): let effort = (requestedEffort || family.default || 'medium').toLowerCase().trim(); if (!famil...
X Description: Bug bin/antigravity-ls-proxy.mjs — resolveModelEnum, step 3 (family-with-effort lookup, lines 138–140): let effort = (requestedEffort || family.default || 'medium').toLowerCase().trim(); if...
Opengraph URL: https://github.com/developing-today/code/issues/686
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"antigravity-ls-proxy: reasoning_effort 'default'/'name' resolves to a non-enum model — MODEL_MAP metadata keys pass the family lookup","articleBody":"## Bug\n\n`bin/antigravity-ls-proxy.mjs` — `resolveModelEnum`, step 3 (family-with-effort lookup, lines 138–140):\n\n```js\nlet effort = (requestedEffort || family.default || 'medium').toLowerCase().trim();\nif (!family[effort]) effort = family.default || Object.keys(family)[0];\nconst enumVal = family[effort];\n```\n\nThe guard only checks that `family[effort]` is *truthy*. A family entry in `MODEL_MAP` is not just effort → enum: it also carries the metadata keys `default` (an effort name, e.g. `'medium'`) and `name` (a display name, e.g. `'Gemini 3.8 Flash'`). A client that sends either of those strings as `reasoning_effort` / `effort` (both are read from the request body at the chat-completions handler) therefore \"resolves\" successfully — to a value that is not a model enum at all. That bogus value is then sent to the language server as `model:` in `GetModelResponse` and as `plannerConfig.requestedModel.model` in cascade mode, where it can only fail (or be misinterpreted) server-side, instead of falling back to the family's default effort the way a genuinely unknown effort does.\n\n## Evidence (verified this run)\n\nThe function and `MODEL_MAP` were extracted verbatim from current `main` and driven directly:\n\n| request | result `modelEnum` |\n|---|---|\n| `gemini-3.8-flash`, effort `\"default\"` | `\"medium\"` ❌ (an effort name, not an enum) |\n| `gemini-3.8-flash`, effort `\"name\"` | `\"Gemini 3.8 Flash\"` ❌ (the display name) |\n| `gemini-3.1-pro`, effort `\"default\"` | `\"high\"` ❌ |\n| `gemini-3.8-flash`, effort `\"high\"` | `\"MODEL_PLACEHOLDER_M318\"` ✅ |\n| `gemini-3.1-pro`, effort `\"medium\"` (not offered) | `\"MODEL_PLACEHOLDER_M37\"` ✅ correct default fallback |\n| `gemini-3.8-flash`, no effort | `\"MODEL_PLACEHOLDER_M319\"` ✅ |\n\nSo an unrecognized effort falls back correctly, but an effort that happens to collide with a `MODEL_MAP` metadata key slips through with a garbage \"enum\".\n\n## Why it matters\n\n- The proxy's own contract (step 5 of the same function) is \"refuse rather than quietly run a different model than the one asked for\" — this path does the opposite: it quietly runs with a non-model value.\n- `reasoning_effort` is client-controlled in the OpenAI-shaped API; values like `\"default\"` are plausible from generic clients/configs. The failure surfaces downstream as an opaque language-server error naming a model the user never asked for, far from the real cause.\n\n## Suggested fix\n\nIn step 3, accept an effort only when its mapped value is actually an enum (e.g. a string starting with `MODEL_`, matching every effort value in `MODEL_MAP`); otherwise fall back to `family.default` (and validate that fallback the same way). Equivalently, restrict the accepted effort names to the known effort keys (`low` / `medium` / `high` / `extra-low`) before indexing the family object.\n\n## Acceptance criteria\n\n- `resolveModelEnum('gemini-3.8-flash', 'default')` and `('gemini-3.8-flash', 'name')` return the family's default-effort enum (`MODEL_PLACEHOLDER_M319`), never `\"medium\"` / `\"Gemini 3.8 Flash\"`.\n- Existing correct behaviour is unchanged: valid efforts resolve to their enums, an unoffered effort (e.g. `medium` on `gemini-3.1-pro`) still falls back to the family default, and unknown models still throw the 400 \"Unknown model\" error.\n- A regression test covers the metadata-key efforts (`default`, `name`) — this proxy currently has no test file, so a black-box test in the style of `bin/muse-proxy.test.mjs` (spawn the proxy against a stub language server via `ANTIGRAVITY_LS_ADDRESS`/`ANTIGRAVITY_CSRF_TOKEN` and capture the `model` the proxy sends) or an equivalent unit test of the resolver is acceptable.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-23T20:15:58Z","url":"https://github.com/developing-today/code/issues/686"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c90896a6-1f7a-4c61-f261-9ea05b344715 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E19E:39588:52F197:6EC501:6B062176 |
| html-safe-nonce | f24b1c46b6fe7544a5b695f428b5bb8bde451449d3f509e5d58a2104e27a1b81 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMTlFOjM5NTg4OjUyRjE5Nzo2RUM1MDE6NkIwNjIxNzYiLCJ2aXNpdG9yX2lkIjoiMzk2ODAwMDYxMTYwMTIyODE1MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0e19d01b9575f4abf5b7890cda2a7d3aae3b99787a4f2f7bb34258b6ed7aaaee |
| hovercard-subject-tag | issue:6004793569 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/686/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7c4d275da32f23478c6b77b861b7aa8e9e1df9e30992a98327c8c0661d366bcc/developing-today/code/issues/686 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7c4d275da32f23478c6b77b861b7aa8e9e1df9e30992a98327c8c0661d366bcc/developing-today/code/issues/686 |
| og:image:alt | Bug bin/antigravity-ls-proxy.mjs — resolveModelEnum, step 3 (family-with-effort lookup, lines 138–140): let effort = (requestedEffort || family.default || 'medium').toLowerCase().trim(); if (!famil... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9a7c5824b75ea2ec5e3de73a483229c7bb9f32a774ffd401f010dd9bacf1483d |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b25c3080e84402f75431d8dc7a96b2635219cec7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width