Repository navigation
Provider state continuity: keep compatibility settings across saves; fail clearly on a dead shadow-call target - #5642
Conversation
PATCH /api/providers now accepts preserveReasoningContentModels and requiresReasoningPlaceholderModels (an array, [] kept as the explicit opt-out, null to clear). POST overwrite carries both stored lists from the live row when the request omits them, so a dashboard save no longer drops a custom provider's lists or resets a registry provider's edited list to the seed. Carries #5614 onto current dev. Co-authored-by: Fred Amartey <[email protected]>
…e destination A POST /api/providers overwrite now carries all five operator compatibility settings (preserveReasoningContentModels, requiresReasoningPlaceholderModels, foldDeveloperRoleToSystem, reasoningWireFormat, omitReasoningEffortWithToolsModels) from the live row when the request omits them, as long as the provider keeps its destination: the same adapter, the same normalized base URL and, when the request names one, the same auth mode. An overwrite that moves the provider carries none of them, and no longer carries the stored apiKeyPool either. The rest of the old row is never merged into the candidate. PATCH accepts foldDeveloperRoleToSystem and reasoningWireFormat (null clears), alongside the two reasoning lists. POST type-checks the settings when a client sends them. The contract lives in provider-overwrite-carry.ts so the route keeps only call sites. Refs #5563
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Repository: lidge-jun/opencodex/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (45)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Deterministic PR hygiene checks passed. |
…s gone
When shadowCallIntercept.model resolves to a provider that is disabled or
deleted, or to a combo that no longer exists, an intercepted helper call now
returns 409 intercept_target_unavailable before any upstream send and records
the code in the request log, with one server-log warning per target. It is not
passed through to the native helper model and does not fall back to the
default provider. A qualified target that only the router's terminal
default-provider fallback accepts counts as unavailable (a deleted provider
used to be misrouted there silently), and the shadow-call settings API refuses
to save one. Combo and routing-profile targets keep their declared failover;
a bare target resolved through the default provider stays valid.
Disabling or deleting a provider the target resolves to still succeeds, and the
response carries dependentShadowIntercept { model, enabled }. The dashboard
shows a persistent warning for it when interception is on.
Refs #5618
…lure The seven translated provider and server reference pages gain the sections added in English: what a provider save keeps, and what happens when the shadow-call target is unavailable. The reasoning-list rows now say a save that moves the provider does not keep the list.
⏳ DRAFT
What to do
This pull request was already a draft. Its draft status will be preserved after every issue above is resolved. Hygiene✅ Deterministic PR hygiene checks passed. |
…nventory responses-core-modules.test.ts walks the owner graph from core.ts and requires every reachable sibling to be listed; shadow-target-availability.ts is imported by request-prepare.ts. The structure owner table gains its row.
리뷰 · 우선순위 64 / 80프로바이더를 저장하거나 끌 때, 사람이 정해 둔 값이 몰래 없어지거나 헬퍼 호출이 다른 프로바이더로 새는 일을 막습니다. 대시보드 저장은 프로바이더 한 줄을 요청 내용으로 다시 만듭니다. 폼은 호환 설정 다섯 가지를 보내지 않습니다. 이제는 목적지가 같을 때만 그 다섯 값을 남깁니다. 목적지는 어댑터, 주소, 그리고 요청이 인증 방식을 적었을 때의 인증 방식입니다. 주소는 대문자와 끝의 섀도 콜도 고칩니다. 가로채기 대상 프로바이더를 끄면 헬퍼 호출마다 베이스는 라인 - 라인 - 프로바이더를 지울 때 섀도 대상이면 경고만 나옵니다. 기본 프로바이더가 바뀌었다는 문장은 나오지 않습니다. 메인테이너의 판단이 필요한 지점
너의 추천 저장할 때 설정이 조용히 지워지는 문제와, 꺼진 섀도 대상으로 요청이 새는 문제를 같이 막는 방향이 맞습니다. 머지 전에 이 댓글은 grok-bot이 작성했습니다 |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 78dcaeb8e6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (route.routeKind === "default-provider" && model.includes("/")) { | ||
| return { unavailable: "it names no configured provider and would only reach the default provider" }; | ||
| } | ||
| return { route }; |
There was a problem hiding this comment.
Retain the resolved provider for bare shadow targets
When a bare target such as helper-fast initially resolves through a provider's defaultModel or models, disabling or deleting that provider makes routeModel fall through to the default provider; because only slash-containing fallbacks are rejected above, this return accepts the new route and sends the helper call with different credentials and cost. The management response even reports dependentShadowIntercept and the dashboard says calls will fail, so preserve the target's resolved provider identity or otherwise reject this fallback after that provider disappears.
Useful? React with 👍 / 👎.
| if (route.routeKind === "default-provider" && model.includes("/")) { | ||
| return { unavailable: "it names no configured provider and would only reach the default provider" }; | ||
| } |
There was a problem hiding this comment.
Distinguish native slash IDs from stale provider qualifiers
A slash does not necessarily delimit a provider: the router deliberately lets native IDs such as meta-llama/Llama-3.1-8B-Instruct fall through to the default provider when the prefix is not a configured provider. This condition now rejects every such shadow target with intercept_target_unavailable (and the matching settings validation rejects saving it), breaking existing configurations that use valid slash-containing upstream model IDs. Check whether the prefix actually denotes a removed/disabled provider instead of treating every slash as qualification.
AGENTS.md reference: src/AGENTS.md:L10-L10
Useful? React with 👍 / 👎.
Summary
Saving or disabling a provider no longer silently undoes the operator's explicit compatibility and routing choices.
Compatibility settings survive provider saves (#5563, carries #5614).
POST /api/providerswith an existing name rebuilt the row from the request. The dashboard form sends none ofpreserveReasoningContentModels,requiresReasoningPlaceholderModels,foldDeveloperRoleToSystem,reasoningWireFormatoromitReasoningEffortWithToolsModels, so an unrelated edit dropped them, or reset a registry provider to its seed. The live-config reconcile could not restore them. Before: a gateway recorded withfoldDeveloperRoleToSystem: truestarted rejecting Native Chat with400 role 'developer' is not allowedafter the operator changed its default model. After:[]orfalse. The value is read from the live row after the DNS await, so a concurrent PATCH is kept.apiKeyPoolis now gated the same way, because its keys were issued for the previous destination. The rest of the old row is never merged into the candidate.nullclears one, and an empty reasoning list is kept as the explicit opt-out (from fix(providers): keep the reasoning-replay lists across provider saves #5614). POST type-checks the settings when a client sends them.src/server/management/provider-overwrite-carry.ts(PROVIDER_COMPAT_CARRY_FIELDS);provider-routes.tskeeps only call sites.Shadow-call target lifecycle (#5618). When
shadowCallIntercept.modelpointed at a disabled provider, every helper call failed with a generic404 Provider is disabled(logged ashttp_404). A deleted provider was worse:provider/modelfell through to the router's default-provider fallback and the helper call went, unannounced, to another destination with other credentials. Now:409with codeintercept_target_unavailablebefore any upstream send. The request log records the code, and the server logs one warning per target. It is never passed through to the native helper model and never falls back to the default provider. Combo and routing-profile targets keep their declared failover; a bare target resolved through the default provider stays valid.PATCH /api/providerswithdisabled: trueandDELETE /api/providersstill succeed, and their response addsdependentShadowIntercept: { model, enabled }when the target resolves to that provider. The dashboard shows a persistent warning for it.PUT /api/shadow-call-settingsrefuses a qualified target with no configured provider.Docs:
reference/configuration/providers.mdgains "What a provider save keeps", andreference/configuration/server.mdgains "When the target is unavailable", both in English and the seven translated locales.structure/gui-and-management-api.mdrecords both contracts. The unit plan is indevlog/_plan/260923_p1_provider_state_continuity/.Closes #5563
Closes #5618
Verification
tests/server/management-provider-compat-carry.test.ts(new): for each of the five settings, an unrelated same-name POST overwrite,loadConfig(),routeModel, and the next outgoing chat body compared with the body built with and without the setting, so no probe passes vacuously. It also covers moves to a new base URL or adapter (no setting and no key pool carried), a same-destination save with a differently cased host and a trailing slash, destination identity rules, and PATCH/POST validation.tests/server/management-provider-reasoning-lists.test.ts(from fix(providers): keep the reasoning-replay lists across provider saves #5614): PATCH and dashboard-save cases for the two reasoning lists, the registry-seed case, and a PATCH landing during the save's DNS await.tests/responses/shadow-intercept-target-lifecycle.test.ts(new): disable, delete, unrelated provider, re-enable, combo failover, bare default-provider target, and the settings PUT refusal.scripts/test-layout/layout.jsonandtests/fixtures/test-layout-expected.json.gui/src/pages/use-providers-crud.tsreads the new response field andProviders.tsxletsnotifytake a warning tone; two keys are added to every locale catalog. I could not run the dashboard in this lane, so there is no screenshot yet. The notice is the existingToastNoticein itswarntone, shown after disabling or deleting the provider that the shadow-call target uses.Checklist
Co-authored-by: Fred Amartey [email protected]