Repository navigation
chore(llm): replace gpt-5.6-luna with gpt-6-luna across routing, config, and tests - #16284
Merged
Merged
Conversation
Keep the GPT-5.6 family prefix for sol and terra, and include gpt-6-luna so luna traffic keeps the explicit-cache contract and chat-completions sanitizer. Co-authored-by: Cursor <[email protected]>
Prices move to openai.gpt-6-luna.2026-09-22 unchanged, pending official gpt-6-luna rates. Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Operator-directed model replacement (David Zhang, 2026-09-22). Numeric cost expectations stay identical because the rate card prices were carried over. Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
…ragment The desktop edits are model id literals, not a user-facing note. Co-authored-by: Cursor <[email protected]>
Keeps the explicit-cache predicate without shifting unrelated lines in the file. Co-authored-by: Cursor <[email protected]>
Any edit to clients.py makes CodeQL report the existing _hash_key cache-digest alert as a new pull-request finding. Resolved gpt-6-luna ids still match that file's startswith('gpt-5.6') check.
Co-authored-by: Cursor <[email protected]>
The model-name subclass did not stop CodeQL from reporting the pre-existing cache-key digest. The gate is the existing prefix check or an exact gpt-6-luna comparison. Co-authored-by: Cursor <[email protected]>
Operator directive (David Zhang, 2026-09-23). The long-context token threshold stays 272000 pending official pricing docs. Co-authored-by: Cursor <[email protected]>
The halved-rate note was one comment line over the product file ratchet. Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
2 of 4 tasks
Git-on-my-level
added a commit
that referenced
this pull request
Sep 23, 2026
…7284) ## Summary Consolidate Luna model references so a future model bump changes a handful of files on purpose. - `LUNA_MODEL` in `backend/utils/llm/model_config.py` is the only production Python literal. Feature defaults, file-chat models, the desktop direct-mode reasoning model, sweep/QA scripts, the smoke provider ref, and the e2e fake import it. - `uses_explicit_cache_and_chat_sanitizer` is the shared wire predicate (GPT-5.6 prefix, plus the canonical Luna id). The six call sites are `clients.py` (explicit cache options), `model_config.supports_cache_retention`, `conversation_prompt_prefix.py`, `proactive_notification.py`, and both executor gates (cache-field strip and chat-completions sanitizer). - Docs that describe the current routing choice say `gpt-x-luna`. Backend tests import `LUNA_MODEL` (conftest exposes the same constant as the `luna_model` fixture). `model_endpoint_inventory.yaml` `current_provider_model` lines are documentation. The coverage test only asserts the field is non-empty, and the gateway config loader cites the filename as a label rather than parsing the model id. Those lines now say `gpt-x-luna`. #16284 is already merged and `chore/gpt-6-luna-model-rename` was deleted, so this PR targets `main` (which contains that merge). Retarget-to-main is already done. ## Grep proof `git grep -l gpt-6-luna`: **71 files before, 21 after.** Remaining files, and why the literal stays: | File | Why | |---|---| | `backend/utils/llm/model_config.py` | Canonical `LUNA_MODEL` definition | | `backend/llm_gateway/config/generated_route_overrides.yaml` | Gateway routing decision | | `backend/llm_gateway/config/route_artifacts.yaml` | Gateway routing decision | | `backend/llm_gateway/config/cost_rate_cards.yaml` | Provider bills the exact model id | | `backend/charts/backend-listen/dev_omi_backend_listen_values.yaml` | Deploy env plumbing | | `backend/charts/backend-listen/prod_omi_backend_listen_values.yaml` | Deploy env plumbing | | `backend/deploy/runtime_env.yaml` | Deploy env plumbing | | `backend/deploy/runtime_env/dev.overlay.yaml` | Deploy env plumbing | | `.github/workflows/jit_qa_manual_operator.yml` | Workflow env plumbing | | `backend/docs/conversation-note-style.md` | Dated 2026-09-23 pricing evidence and the official model docs URL | | `backend/testing/jit_processing/fixtures/jit_architecture_quality_cost_v2.json` | Frozen synthetic fixture (prompt hashes). Tests compare its model field to `LUNA_MODEL` | | `desktop/macos/Desktop/Sources/FloatingControlBar/RealtimeHubTools.swift` | No shared provider-model constant in Swift | | `desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextBucketRollup.swift` | Same | | `desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ProactiveLaneClient.swift` | Same; the existing `escalationModel` alias is `omi-luna-think`, not the provider id | | `desktop/macos/Desktop/Tests/AgentRuntimeProcessTests.swift` | Swift tests have no shared model-id constant | | `desktop/macos/Desktop/Tests/ContextBucketDirectorProbeTests.swift` | Same | | `desktop/macos/Desktop/Tests/MessageMetadataTests.swift` | Same | | `desktop/macos/Desktop/Tests/ProactiveLaneClientTests.swift` | Same | | `desktop/macos/agent/tests/control-tools.test.ts` | TS agent tests have no shared model-id constant | | `desktop/macos/agent/tests/pi-mono-adapter.test.ts` | Same | | `desktop/macos/pi-mono-extension/index.test.ts` | Same | ## Left unchanged on purpose - `supports_prompt_cache` still special-cases `LUNA_MODEL` beside the `gpt-5` / `gpt-4o` / o-series prefixes. That is cache-key routing, not the explicit-cache and chat-completions sanitizer. - The coverage guardrail that requires an explicit reasoning effort matches every `gpt-5*` lane or `LUNA_MODEL`. Folding it into the GPT-5.6 predicate would drop `gpt-5-nano`. - Helm, runtime env, and the JIT workflow still set the exact model string. `FAIR_USE_CLASSIFIER_MODEL` and `MEMORY_DAILY_MEMORY_SWEEP_MODEL_NAME` duplicate the code default. Removing those env literals would change deploy semantics, so this PR only points the code fallback at `LUNA_MODEL`. ## Product invariants affected - INV-MEM-1 - INV-MEM-4 The matching paths (`backend/utils/memory/daily_memory_sweep.py`, `backend/utils/memory/maintenance_cost.py`, `backend/docs/memory/belief_model_plan.md`) only replace a hardcoded Luna model id or a dated rate-card phrase. Tier count, promotion authority, collections, and memory-access behavior are unchanged. ## Failure class Failure-Class: none The follow-up commit only adds `is_auto_lane_id` to the chat-file gateway stub. `chat_file` now imports `LUNA_MODEL`, and `model_config` imports that name from `gateway_client`. The suites that load the real module against a stub need the name present. That is a test-harness import surface, not a product failure class. ## Test plan - [x] `cd backend && PYTHON=.venv/bin/python BACKEND_UNIT_TEST_FILE_LIST=... bash test.sh` for the gateway config, accounting, executor, prompt-cache, QoS, and every touched unit test file (28 files). All passed. `test_desktop_proactivity.py` once exceeded the 0.30s CPU guard (0.33s) while the batch was running in parallel; rerun alone, 61 passed and the guard held. - [x] After CI, the chat-file stub suites (`test_chat_file_gateway_stub_import_contract.py`, `test_chat_file_upload_picked_name.py`, `test_chat_file_upload_unsupported.py`) passed under the same isolation runner: 2 + 6 + 17. - [ ] Full `bash test.sh` was not run: the isolation runner covers ~930 files, and a saturated parallel run already tripped an unrelated CPU-time guard. The focused set is the gateway/config/accounting/executor suite plus every touched test file. - [ ] Desktop Swift was not recompiled: no Swift or TS literals were edited. No changelog fragment: no user-facing desktop change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Operator-directed model replacement (David Zhang, 2026-09-22):
gpt-5.6-lunais nowgpt-6-lunaacross routing, gateway config, deploy/helm env, the JIT QA workflow, tests, desktop Swift/TS literals, and docs that describe current routing.Base is
origin/mainat504ad16e7dfa734afaaa76dcd14d7d56f058ef2d. 73 files changed, including an internal-only desktop changelog fragment.gpt-5.6-solandgpt-5.6-terraare unchanged.Exclusions
git grep gpt-5.6-lunastill hits only these, on purpose:backend/docs/memory/complete-tool-evidence.md— dated pricing evidence for rate cardopenai.gpt-5.6-luna.2026-07-30and the official 5.6-luna pricing URL. Historical record, left as-is.backend/llm_gateway/gateway/executor.py— the Live OpenAI 400 (2026-08) narrative still namesgpt-5.6-lunaas the model that rejected function tools withreasoning_effortother thannone, and non-default temperature, on/v1/chat/completions.backend/tests/unit/test_llm_gateway_openai_compatible.py— the same 2026-08 temperature 400 comment.backend/utils/other/chat_file.py— the 2026-08-28 live probe that confirmed the PDF file-part contract ongpt-5.6-luna. The current vision/document constants aregpt-6-luna.backend/llm_gateway/config/cost_rate_cards.yaml— the Sol/Terra source note still citesrequesty.ai/models/openai-responses/gpt-5.6-luna, and the gpt-6-luna card comment namesopenai.gpt-5.6-luna.2026-07-30as the card whose prices were halved.docs/archive/SPEC-meeting-receipt.mddoes not mentiongpt-5.6-luna.Prefix gates
Shared helper
model_uses_gpt56_request_contract(startswith('gpt-5.6') or model == 'gpt-6-luna') inbackend/utils/llm/model_config.py. Every site is extended so luna traffic keeps its previous wire behavior. None stayed 5.6-only.executor.py_provider_request— extended. Models on this contract skip_remove_gpt56_cache_fields, so explicit-cache fields stay on forgpt-6-luna.executor.py_sanitize_openai_chat_completions_request— extended. Forcesreasoning_effort=nonewhen function tools are present and strips a non-default temperature. Open question, not resolved here: whethergpt-6-lunastill rejects those params on/v1/chat/completions. Carrying the sanitizer is the safe default; the dev bake will show if it is unused.clients.py— extended inline (startswith('gpt-5.6') or model == 'gpt-6-luna'). The predicate is not imported, so the rest of that file stays line-identical to main. CodeQL reports the pre-existing_hash_keySHA-256 cache-digest (py/weak-sensitive-data-hashing, alert 164) as a new pull-request alert when this file is analyzed. That digest is an in-process client cache key, not password storage. Alert 164 is dismissed as a false positive so the check is not failed by the unchanged sink.conversation_prompt_prefix.pyshared_conversation_cache_supported— extended for the non-gateway path.model_config.pysupports_cache_retention— extended as an exclusion.gpt-6-lunastays off the legacyprompt_cache_retention=24hfield, same as GPT-5.6.supports_prompt_cachealso treatsgpt-6-lunaas cache-key capable, because thegpt-5family prefix would otherwise dropprompt_cache_keyfor luna traffic.proactive_notification.pygate_cache_supported— extended for the non-gateway path.test_every_gpt5_generated_lane_pins_an_explicit_reasoning_effortalso still requires a pinnedreasoning_effortongpt-6-lunalanes.Pricing
Rate card
openai.gpt-5.6-luna.2026-07-30is replaced byopenai.gpt-6-luna.2026-09-22withmodel: gpt-6-luna. Prices are half of that 5.6-luna card per operator directive (David Zhang, 2026-09-23), pending official published rates: short input $0.10/M, cached input $0.01/M, output $0.60/M, cache write $0.125/M; long-context input $0.20/M, cached input $0.02/M, output $0.90/M, cache write $0.25/M.long_context_threshold_tokensstays 272000, inherited pending official gpt-6-luna pricing docs. Accounting tests, the maintenance planner, the summary-lab price table, andjit_architecture_quality_cost_v2.jsonuse these halved numbers. Sol and Terra cards are unchanged.The two chat-structured route artifacts had their
artifact_digestvalues recomputed after the model id change.Product invariants affected
RealtimeHubTools.swiftchanges a model id string only. No second transcript store and no change to session identity or kernel ownership.Verification
PYTHON=.venv/bin/python bash test-preflight.sh(backend): 19 passed, 7 warnings, 0 failed (26 checks). Interpreter.venv/bin/python3.11.15.BACKEND_UNIT_TEST_FILE_LIST=… bash test.shon the 27 touched unit files, includingtest_llm_gateway_executor.py,test_llm_gateway_config.py,test_llm_gateway_accounting.py,test_llm_gateway_openai_compatible.py,test_llm_gateway_route_refs.py,test_chat_agent_cost_report.py, andtest_production_like_memory_model.py. 26 files passed.test_insight_date_grounding.pyfailed collection because its isolatedmodel_configstub did not export the new helper; after the stub was updated, that file passed 16 tests.pytest tests/integration/test_qos_live_cp9.py::TestP7_PromptCaching::test_luna_supports_cache_key_routing: 1 passed. The rest of the live QoS files call real provider APIs and were not run.npm test -- tests/control-tools.test.ts tests/pi-mono-adapter.test.tsindesktop/macos/agent— 2 files, 152 tests passed.desktop/macos/pi-mono-extension:npm testafternpm run buildindesktop/macos/agent— 143 passed, 0 failed.xcrun swift build -c debug --package-path Desktopunderdesktop/macos/— Build complete (501.16s), exit 0. Linker warned thatlibwebpwas built for a newer macOS than the 14.0 deployment target; the link still succeeded.Updated test expectations come from the operator-directed replacement (David Zhang, 2026-09-22), not from a measured provider change.
scripts/pr-preflight --pr-body-fileandmake preflight(with that body) each passed 57 checks on the final commit.