Repository navigation
consolidation: merge 6 LLM gateway auto-router PRs (#8739 #8758 #8740 #8744 #8746 #8748) - #10089
undivisible wants to merge 8 commits into
Conversation
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for consolidating these router branches. I’m going to request changes because the current head appears to violate the core catalog/serving split that this PR documents.
Blocking issues:
-
lanes_catalog.yamlmarks onlyomi:auto:chat-structuredasprod_ready; the other 12 lanes aredev_onlyand 3 areplanned. Butbackend/llm_gateway/config/lanes.yamlstill contains 17 serving lanes, including catalog-only entries likeomi:auto:chat-extraction,omi:auto:daily-summary,omi:auto:stt-realtime,omi:auto:transcription, andomi:auto:screenshot-embedding. That means the serving config still exposes lanes the catalog says should not be serving. -
route_artifacts.yamlstill includes route artifacts for the planned placeholder lanes, withevidence.placeholder: trueonstt-realtime,transcription, andscreenshot-embedding. This directly conflicts with the documented invariant here: “No prod-loadable placeholder route artifacts.” -
validate_serving_config()does not currently enforce “every serving lane must be in the catalog withprod_readystatus.” The implementation only enforces the promotion direction (prod_readycatalog lane has a serving lane/artifact) and explicitly allows serving lanes that are cataloged asdev_only/planned. That lets this inconsistent config pass instead of failing closed. -
The PR also adds several
.aidlc/*planning/review/state documents. These are agent-behavior / agent-instruction-adjacent artifacts: future coding or review agents may read them as project intent and workflow guidance. The guidance is directionally useful, but right now it is internally inconsistent with the actual checked-in config (for example, the docs say catalog-only lanes should not be in serving config, while the config includes them). Please either remove these ephemeral agent planning artifacts from the PR or make sure they accurately reflect the final maintained architecture. Human maintainer review is warranted before landing this documentation because it can shape future AI coding/review behavior in the repo.
I did not see evidence of a malicious or supply-chain attempt. The concern is correctness/safety around model-routing configuration and agent-facing documentation.
Suggested path:
- Either trim
lanes.yamlandroute_artifacts.yamlso serving contains only trulyprod_readylanes/artifacts, or change the catalog/status model and docs if these lanes are intentionally serveable now. - Tighten
validate_serving_config()so catalog entries markeddev_only/plannedcannot appear in serving config unless there is a deliberately named, reviewed exception path. - Add regression tests covering dev_only/planned catalog lanes present in
lanes.yamland placeholder artifacts present inroute_artifacts.yaml. - Reconcile or remove the
.aidlcdocs so future agents do not inherit stale/inaccurate guidance.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
e0bbe02 to
7740247
Compare
Updated consolidation follow-upThe earlier catalog/serving problems are largely resolved in the current branch. The remaining merge conditions are narrower:
This remains a keep-and-narrow PR, not a request to close the auto-router work. |
57fb783 to
4b1d77f
Compare
4b1d77f to
6faf563
Compare
|
retriggering CI after test fix |
|
Hey @undivisible 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
There was a problem hiding this comment.
The safety gate that keeps unapproved models out of production works, but it quietly does nothing if a config file is missing and reads a file at startup in a way the backend rules forbid — so hold off on auto-merging given how much this touches. Also, the description claims a memory-expiry fix that isn't actually in the code — please drop or correct it.
a14901d to
c684fe2
Compare
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Review: LLM Gateway Auto-Router Consolidation❌ REQUEST CHANGES — 5 Blocking Issues1. Merge State: DIRTYPR has conflicts with main ( 2. CI Never RanOnly 2 trivial checks executed (comment-on-declined-pr, Mintlify). Zero build, zero test, zero lint CI. For a +6631-line consolidation of 6 PRs, this is a hard blocker. 3. False Claims in DescriptionPR description claims "clamps required-memory expiry after capture time to preserve memory-tier contract" — but that code was added in one commit then removed in another. Net diff contains zero memory-expiry code. Description must match reality. 4. Fail-Open Gap in validate_serving_config()Lanes NOT in the catalog at all are silently allowed through (explicitly asserted by test as correct behavior). This undermines the safety gate. Should fail closed for unknown lanes. 5. Import-Time File Readresolver.py calls load_catalog() at module import time, violating backend startup rules (flagged by prior reviewer). Path ForwardRebase on main, fix the fail-open gap, resolve import-time side-effect, correct description, trigger full CI. The underlying auto-router work is valuable — this is fixable. |
c684fe2 to
fc20b6b
Compare
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for continuing to narrow this consolidation. I re-reviewed current head fc20b6b5d9718211c214c9af5811abe82a945e3c. CI is now green and the earlier broad catalog placeholders/dev-only serving-lane issues look mostly resolved, so this is not a close/split request. I would still keep changes requested on the current head for a few focused blockers:
-
The catalog/serving contract still has a fail-open exception.
backend/llm_gateway/config/lanes.yamlservesomi:auto:public-shared-conversation-chat, butbackend/llm_gateway/config/lanes_catalog.yamldoes not catalog that lane asprod_readyor catalog it at all.validate_serving_config()also only rejects catalogued non-prod lanes; uncatalogued serving lanes are allowed. Since the PR docs say serving config is a subset of the catalog and onlyprod_readylanes serve, please either catalog this lane asprod_readywith evidence or add a deliberately named, reviewed exception path that fails closed for arbitrary unknown lanes. -
backend/llm_gateway/gateway/resolver.pystill loads the catalog at import time to buildSUPPORTED_AUTO_LANE_IDS, then falls back to an empty allowlist if that read/parsing fails. That keeps a startup/import side effect in a sensitive request-path module and can silently make the allowlist empty in production-like execution. Please move this behind the config loading/reload path or otherwise make failures explicit instead of import-time fail-open/fail-empty behavior. -
The PR description still claims “Clamps required-memory expiry after capture time…” and lists
INV-MEM-1, but the current net diff does not include the memory-expiry change. Please correct the description so maintainers are not reviewing a stale/unrelated invariant claim.
No malicious or supply-chain behavior stood out in this pass. Because this is still a large model-routing/workflow-sensitive PR, it should continue to carry human maintainer review before merge even after these focused blockers are resolved.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
17fa459 to
42471f1
Compare
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for continuing to narrow this consolidation. I’m keeping changes requested on the current head, but the remaining blockers look concrete and fixable:
- Current CI is not green.
Formattingfails becausebackend/llm_gateway/gateway/resolver.pywould be reformatted by black, andBackend unit suitefails in pyright becauseresolver.pyusesLaneCatalogin annotations without importing it. - The catalog follow-up for
public-shared-conversation-chatstill needs its tests/schema expectations reconciled. The PR now adds it asprod_ready, butbackend/tests/unit/llm/test_lane_catalog.pystill asserts the old catalog size/prod-ready counts and only permitsopenai.chat_completions/unknownsurfaces while the new catalog entry usessurface: chat. - The PR body still lists
INV-MEM-1, but the current net diff does not include the memory-expiry change. Please remove that stale invariant claim so maintainers are reviewing the actual scope.
No malicious or supply-chain behavior stood out in this pass. Because this still changes model-routing and workflow-sensitive surfaces, it should keep human maintainer review before merge after the CI/test issues are fixed.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for the fixes on the latest head — the previous CI/test-count issues look resolved. I’m keeping changes requested because one core safety blocker is still present:
validate_serving_config()still allows uncatalogued serving lanes. The function docstring says every serving lane must be in the catalog withprod_readystatus, but the implementation only rejects lanes that are catalogued as non-prod and letscatalog.get(lane_id) is Nonepass. The new regression test also pins that behavior as allowed (test_serving_lane_not_in_catalog_is_allowed). For this gateway, an arbitraryomi:auto:*lane entering serving config without catalog review is the fail-open case the catalog split is meant to prevent. Please make unknown serving lanes fail closed, then update the test to assert rejection.- The PR body still lists
INV-MEM-1, but the current net diff does not include the memory-expiry behavior. Please remove that stale invariant claim so maintainers are reviewing the actual router/workflow scope.
No malicious or supply-chain behavior stood out in this pass. Because this still changes model-routing and workflow-sensitive surfaces, it should keep the existing human-maintainer/security/workflow review labels even after the code blocker is fixed.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for the latest fixes — the previous uncatalogued-serving and stale PR-body blockers look resolved on this head. I’m still requesting changes because the current CI failures are exposing a real gateway regression, not just a harness issue:
- Backend unit tests are failing because generated
model_configlanes/routes are now filtered down to catalogprod_readyentries. That removes routes existing non-auto surfaces still use, for exampleomi:auto:chat-agentandroute.session_titles.model_config.001. The failures show this directly:test_llm_gateway_anthropic_passthrough.pygets 404s for/v1/messages,test_capability_smoke.pyhitsKeyError: 'omi:auto:chat-agent', andtest_llm_gateway_output_budget.pyhitsKeyError: 'route.session_titles.model_config.001'. The catalog split should fail closed for the LLM-gateway auto-router serving set, but it should not accidentally delete existing generated model-config routes that the Anthropic passthrough/session-title paths still depend on unless those surfaces are deliberately migrated and tested. - The Formatting check is still red: CI reports
backend/llm_gateway/gateway/config_loader.pywould be reformatted by black. - Desktop Swift CI is also red. That may be unrelated to the router diff, but it still needs a clean rerun or a maintainer-accepted explanation before merge.
No malicious or supply-chain behavior stood out in this pass. Since this continues to touch model routing and workflow-sensitive surfaces, please keep the human-maintainer/security/workflow review labels until the gateway regression and CI are cleared.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
| passed=False, | ||
| latency_ms=latency_ms, | ||
| failure_reason=f"auth error: {e}", | ||
| ) |
There was a problem hiding this comment.
Duplicate auth exception classes
Low Severity
Capability smoke catches ProviderAuthError from its own module, but the default FakeProvider raises a homonymous exception from deterministic_provider. Auth-failure scenarios are handled as generic exceptions, so smoke JSON mislabels auth failures.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 9f15522. Configure here.
9f15522 to
0e4b452
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0415c31. Configure here.
|
|
||
| _logging.getLogger(__name__).warning("lane catalog not loaded: %s", _exc) | ||
| _catalog = None | ||
| return _catalog |
There was a problem hiding this comment.
Stale catalog breaks hot reload
Medium Severity
The resolver keeps the first-loaded lanes_catalog.yaml in a module-level cache forever, while GatewayConfigReloader reloads the catalog from disk on each mtime change. Reload passes required_lane_ids=get_supported_auto_lane_ids(), so demoted lanes can still be required after serving config is updated, causing ConfigValidationError and stale config until restart.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 0415c31. Configure here.
Consolidates #8739 #8758 #8740 #8744 #8746 #8748. - Unified auto-router with lane catalog, serving config, route artifacts - Config reload, benchmark scoring, capability smoke checks - Lazy-loading lane catalog (no import-time I/O in request-path modules) - Cataloged public-shared-conversation-chat as prod_ready Failure-Class: none
Reconcile catalog and smoke tests with the catalog-derived allowlist, and import LaneCatalog for pyright. Failure-Class: none
Failure-Class: FC-client-model-outside-proxy-allowlist
Failure-Class: new
Failure-Class: FC-client-model-outside-proxy-allowlist
Failure-Class: none
Failure-Class: none
0415c31 to
ba423a3
Compare
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for the quick CI cleanup. I’m still requesting changes because the current head appears to preserve the gateway-routing regression by changing the tests around it rather than keeping the production route available.
The default production gateway config now only loads two lanes (omi:auto:chat-structured and omi:auto:public-shared-conversation-chat). It no longer includes the generated omi:auto:chat-agent lane / route.chat_agent.model_config.001, even though the backend gateway Anthropic client still unconditionally sends chat-agent traffic to CHAT_AGENT_AUTO_LANE_ID (utils/llm/gateway_anthropic.py). With the default app config, /v1/messages for omi:auto:chat-agent returns 404 (auto lane not found: omi:auto:chat-agent). The updated Anthropic passthrough tests hide this by overriding get_gateway_config() and manually injecting a synthetic chat-agent lane, so they no longer prove the production/default config still serves the route.
This is the same model-routing safety concern in narrower form: the catalog split should fail closed for the new auto-router serving set, but it should not silently remove an existing gateway-served Anthropic/chat-agent path unless that migration is intentional, documented, and covered by production-default tests. Please either keep the generated model-config route(s) required by existing call sites available outside the auto-router catalog gate, or make the intentional removal explicit and update the call sites/rollout plan accordingly.
I verified on this head that the focused backend tests now pass, and I did not see malicious or supply-chain behavior. Because this still touches model routing and workflow-sensitive surfaces, the existing human-maintainer/security/workflow review labels should stay until a maintainer signs off.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
|
Superseded by #10934. |
|
Hey @undivisible 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |


Consolidates 6 LLM gateway auto-router PRs (#8739 #8758 #8740 #8744 #8746 #8748).
Changes
Failure-Class: FC-client-model-outside-proxy-allowlist
Note
High Risk
Touches core LLM gateway config loading, readiness, and which auto-lanes can serve in production; mis-catalogued or reload bugs could block traffic or serve wrong routes.
Overview
This consolidation lands the LLM gateway auto-router stack in one pass: catalog-driven serving, runtime config refresh, and offline benchmark/smoke tooling, with CI policy aligned to safer desktop stable promotion.
Lane catalog and serving config — Adds
lanes_catalog.yamlandlane_catalog.pyso lanes areplanned/dev_only/prod_ready. Only prod_ready lanes may appear inlanes.yaml/ route artifacts; startup cross-checks enforce that. The resolver allowlist is derived from the catalog (e.g.chat-structured,public-shared-conversation-chat); placeholders and dev-only lanes stay catalog-only.load_gateway_configfilters generated routes by catalog, merges explicit YAML over generated entries, and can require allowlisted lane IDs.Evidencegains an optionalplaceholderflag for promotion logic without changing prod eligibility.Runtime config — Replaces cached sync config with
GatewayConfigReloader(mtime watch + TTL cache + stale fallback).get_gateway_configis async;/readyawaits it. Prod mode defaults to on unlessOMI_LLM_GATEWAY_PRODopts into dev.Offline auto-router path — Adds
_privatescoring and BenchmarksFetcher (AA API with example fallback),sync_benchmarks_to_route_artifacts.py(writesroute_artifacts.proposed.yamlonly),capability_smoke.pywithFakeProvider, andDailyRefreshCachefor shared refresh semantics.Shadow / dual-path (R3.1) — Unit tests and fakes for shadow cutover and divergence metrics (parallel control vs gateway, LKG on gateway failure).
CI — Desktop stable promotion policy script expects bearer auth and blocks reintroduced manual operator inputs. Backend dev deploy skips GitHub compare supersession when
GH_TOKENis unset so hermetic tests can run.Reviewed by Cursor Bugbot for commit ba423a3. Bugbot is set up for automated code reviews on this repo. Configure here.