Skip to content

chore(llm): replace gpt-5.6-luna with gpt-6-luna across routing, config, and tests - #16284

Merged
Git-on-my-level merged 15 commits into
mainfrom
chore/gpt-6-luna-model-rename
Sep 23, 2026
Merged

Git-on-my-level merged 15 commits into
mainfrom
chore/gpt-6-luna-model-rename

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Summary

Operator-directed model replacement (David Zhang, 2026-09-22): gpt-5.6-luna is now gpt-6-luna across routing, gateway config, deploy/helm env, the JIT QA workflow, tests, desktop Swift/TS literals, and docs that describe current routing.

Base is origin/main at 504ad16e7dfa734afaaa76dcd14d7d56f058ef2d. 73 files changed, including an internal-only desktop changelog fragment. gpt-5.6-sol and gpt-5.6-terra are unchanged.

Exclusions

git grep gpt-5.6-luna still hits only these, on purpose:

  • backend/docs/memory/complete-tool-evidence.md — dated pricing evidence for rate card openai.gpt-5.6-luna.2026-07-30 and 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 names gpt-5.6-luna as the model that rejected function tools with reasoning_effort other than none, 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 on gpt-5.6-luna. The current vision/document constants are gpt-6-luna.
  • backend/llm_gateway/config/cost_rate_cards.yaml — the Sol/Terra source note still cites requesty.ai/models/openai-responses/gpt-5.6-luna, and the gpt-6-luna card comment names openai.gpt-5.6-luna.2026-07-30 as the card whose prices were halved.

docs/archive/SPEC-meeting-receipt.md does not mention gpt-5.6-luna.

Prefix gates

Shared helper model_uses_gpt56_request_contract (startswith('gpt-5.6') or model == 'gpt-6-luna') in backend/utils/llm/model_config.py. Every site is extended so luna traffic keeps its previous wire behavior. None stayed 5.6-only.

  1. executor.py _provider_request — extended. Models on this contract skip _remove_gpt56_cache_fields, so explicit-cache fields stay on for gpt-6-luna.
  2. executor.py _sanitize_openai_chat_completions_request — extended. Forces reasoning_effort=none when function tools are present and strips a non-default temperature. Open question, not resolved here: whether gpt-6-luna still rejects those params on /v1/chat/completions. Carrying the sanitizer is the safe default; the dev bake will show if it is unused.
  3. 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_key SHA-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.
  4. conversation_prompt_prefix.py shared_conversation_cache_supported — extended for the non-gateway path.
  5. model_config.py supports_cache_retention — extended as an exclusion. gpt-6-luna stays off the legacy prompt_cache_retention=24h field, same as GPT-5.6. supports_prompt_cache also treats gpt-6-luna as cache-key capable, because the gpt-5 family prefix would otherwise drop prompt_cache_key for luna traffic.
  6. proactive_notification.py gate_cache_supported — extended for the non-gateway path.

test_every_gpt5_generated_lane_pins_an_explicit_reasoning_effort also still requires a pinned reasoning_effort on gpt-6-luna lanes.

Pricing

Rate card openai.gpt-5.6-luna.2026-07-30 is replaced by openai.gpt-6-luna.2026-09-22 with model: 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_tokens stays 272000, inherited pending official gpt-6-luna pricing docs. Accounting tests, the maintenance planner, the summary-lab price table, and jit_architecture_quality_cost_v2.json use these halved numbers. Sol and Terra cards are unchanged.

The two chat-structured route artifacts had their artifact_digest values recomputed after the model id change.

Product invariants affected

  • INV-CHAT-1 — RealtimeHubTools.swift changes a model id string only. No second transcript store and no change to session identity or kernel ownership.
  • INV-MEM-4 — model id and the halved gpt-6-luna rate card in the memory sweep, maintenance cost, runtime env, and belief-model plan. No promotion route, admission receipt, or tier transition change.
  • INV-MEM-1 — the same memory paths. No new product tier and no new canonical collection.

Verification

  • PYTHON=.venv/bin/python bash test-preflight.sh (backend): 19 passed, 7 warnings, 0 failed (26 checks). Interpreter .venv/bin/python 3.11.15.
  • BACKEND_UNIT_TEST_FILE_LIST=… bash test.sh on the 27 touched unit files, including test_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, and test_production_like_memory_model.py. 26 files passed. test_insight_date_grounding.py failed collection because its isolated model_config stub 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.
  • Desktop agent: npm test -- tests/control-tools.test.ts tests/pi-mono-adapter.test.ts in desktop/macos/agent — 2 files, 152 tests passed.
  • desktop/macos/pi-mono-extension: npm test after npm run build in desktop/macos/agent — 143 passed, 0 failed.
  • Swift: xcrun swift build -c debug --package-path Desktop under desktop/macos/ — Build complete (501.16s), exit 0. Linker warned that libwebp was 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-file and make preflight (with that body) each passed 57 checks on the final commit.

Git-on-my-level and others added 15 commits September 22, 2026 21:42
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]>
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]>
…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]>
@Git-on-my-level
Git-on-my-level merged commit 59455a6 into main Sep 23, 2026
63 checks passed
@Git-on-my-level
Git-on-my-level deleted the chore/gpt-6-luna-model-rename branch September 23, 2026 06:44
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.
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