Skip to content

Provider state continuity: keep compatibility settings across saves; fail clearly on a dead shadow-call target - #5642

Merged
lidge-jun merged 6 commits into
devfrom
codex/260923-p1-provider-state-continuity
Sep 23, 2026
Merged

lidge-jun merged 6 commits into
devfrom
codex/260923-p1-provider-state-continuity

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

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/providers with an existing name rebuilt the row from the request. The dashboard form sends none of preserveReasoningContentModels, requiresReasoningPlaceholderModels, foldDeveloperRoleToSystem, reasoningWireFormat or omitReasoningEffortWithToolsModels, 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 with foldDeveloperRoleToSystem: true started rejecting Native Chat with 400 role 'developer' is not allowed after the operator changed its default model. After:

  • An overwrite that keeps the destination (same adapter, same normalized base URL, and the same auth mode when the request names one) carries each of the five settings the request omits, including an explicit [] or false. The value is read from the live row after the DNS await, so a concurrent PATCH is kept.
  • An overwrite that moves the provider to another destination carries none of them: they describe the previous upstream, and registry enrichment fills what is known about the new one. The stored apiKeyPool is 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.
  • PATCH accepts all five settings; null clears 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.
  • The contract lives in src/server/management/provider-overwrite-carry.ts (PROVIDER_COMPAT_CARRY_FIELDS); provider-routes.ts keeps only call sites.

Shadow-call target lifecycle (#5618). When shadowCallIntercept.model pointed at a disabled provider, every helper call failed with a generic 404 Provider is disabled (logged as http_404). A deleted provider was worse: provider/model fell through to the router's default-provider fallback and the helper call went, unannounced, to another destination with other credentials. Now:

  • An intercepted request whose target no longer resolves (provider disabled or deleted, combo removed, or a qualified target that only the default-provider fallback would accept) returns one 409 with code intercept_target_unavailable before 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/providers with disabled: true and DELETE /api/providers still succeed, and their response adds dependentShadowIntercept: { model, enabled } when the target resolves to that provider. The dashboard shows a persistent warning for it. PUT /api/shadow-call-settings refuses a qualified target with no configured provider.

Docs: reference/configuration/providers.md gains "What a provider save keeps", and reference/configuration/server.md gains "When the target is unavailable", both in English and the seven translated locales. structure/gui-and-management-api.md records both contracts. The unit plan is in devlog/_plan/260923_p1_provider_state_continuity/.

Closes #5563
Closes #5618

Verification

  • Local checks: NOT RUN. This lane runs no local suite, focused test, typecheck, build or proxy. Evidence is static source reading plus hosted CI on the exact head SHA.
  • 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.
  • Both new test files are registered in scripts/test-layout/layout.json and tests/fixtures/test-layout-expected.json.
  • GUI: gui/src/pages/use-providers-crud.ts reads the new response field and Providers.tsx lets notify take 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 existing ToastNotice in its warn tone, shown after disabling or deleting the provider that the shadow-call target uses.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Co-authored-by: Fred Amartey [email protected]

lidge-jun and others added 3 commits September 23, 2026 13:40
Roadmap for keeping explicit provider compatibility settings across saves and for reporting and failing clearly on a shadow-call target whose provider is disabled or deleted.
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
@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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 configuration

Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: f4a5c0b4-036b-46a4-8ccf-09b5da211cf5

📥 Commits

Reviewing files that changed from the base of the PR and between 0f9254b and 78dcaeb.

📒 Files selected for processing (45)
  • devlog/_plan/260923_p1_provider_state_continuity/000_overview.md
  • devlog/_plan/260923_p1_provider_state_continuity/010_part1_compat_contract.md
  • devlog/_plan/260923_p1_provider_state_continuity/020_part2_shadow_target_lifecycle.md
  • devlog/_plan/260923_p1_provider_state_continuity/030_delivery.md
  • docs-site/src/content/docs/fr/reference/configuration/providers.md
  • docs-site/src/content/docs/fr/reference/configuration/server.md
  • docs-site/src/content/docs/ja/reference/configuration/providers.md
  • docs-site/src/content/docs/ja/reference/configuration/server.md
  • docs-site/src/content/docs/ko/reference/configuration/providers.md
  • docs-site/src/content/docs/ko/reference/configuration/server.md
  • docs-site/src/content/docs/reference/configuration/providers.md
  • docs-site/src/content/docs/reference/configuration/server.md
  • docs-site/src/content/docs/ru/reference/configuration/providers.md
  • docs-site/src/content/docs/ru/reference/configuration/server.md
  • docs-site/src/content/docs/tr/reference/configuration/providers.md
  • docs-site/src/content/docs/tr/reference/configuration/server.md
  • docs-site/src/content/docs/zh-cn/reference/configuration/providers.md
  • docs-site/src/content/docs/zh-cn/reference/configuration/server.md
  • docs-site/src/content/docs/zh-tw/reference/configuration/providers.md
  • docs-site/src/content/docs/zh-tw/reference/configuration/server.md
  • gui/src/i18n/de.ts
  • gui/src/i18n/en.ts
  • gui/src/i18n/fr.ts
  • gui/src/i18n/ja.ts
  • gui/src/i18n/ko.ts
  • gui/src/i18n/ru.ts
  • gui/src/i18n/tr.ts
  • gui/src/i18n/vi.ts
  • gui/src/i18n/zh-TW.ts
  • gui/src/i18n/zh.ts
  • gui/src/pages/Providers.tsx
  • gui/src/pages/use-providers-crud.ts
  • scripts/test-layout/layout.json
  • src/server/management/provider-overwrite-carry.ts
  • src/server/management/provider-routes.ts
  • src/server/management/shadow-call-validation.ts
  • src/server/responses/request-prepare.ts
  • src/server/responses/shadow-target-availability.ts
  • structure/gui-and-management-api.md
  • structure/transports/responses.md
  • tests/fixtures/test-layout-expected.json
  • tests/helpers/responses-core-source.ts
  • tests/responses/shadow-intercept-target-lifecycle.test.ts
  • tests/server/management-provider-compat-carry.test.ts
  • tests/server/management-provider-reasoning-lists.test.ts
 __________________________________________________________
< Your TODOs are evolving. Soon they'll achieve sentience. >
 ----------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Sep 23, 2026
…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.
@lidge-jun lidge-jun changed the title Provider state continuity: keep compatibility settings across saves; clear shadow-call target failures Provider state continuity: keep compatibility settings across saves; fail clearly on a dead shadow-call target Sep 23, 2026
@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • UI screenshot required.

What to do

  • Add a screenshot of the UI change to the PR description.

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.
@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 64 / 80

프로바이더를 저장하거나 끌 때, 사람이 정해 둔 값이 몰래 없어지거나 헬퍼 호출이 다른 프로바이더로 새는 일을 막습니다.

대시보드 저장은 프로바이더 한 줄을 요청 내용으로 다시 만듭니다. 폼은 호환 설정 다섯 가지를 보내지 않습니다. preserveReasoningContentModels, requiresReasoningPlaceholderModels, foldDeveloperRoleToSystem, reasoningWireFormat, omitReasoningEffortWithToolsModels입니다. 그래서 기본 모델만 바꿔도 그 값이 지워졌습니다. 목록에 있는 프로바이더는 사람이 고친 값이 처음 씨앗 값으로 돌아가기도 했습니다. foldDeveloperRoleToSystem을 켜 둔 게이트웨이는, 그 다음부터 developer 역할을 거절할 수 있습니다.

이제는 목적지가 같을 때만 그 다섯 값을 남깁니다. 목적지는 어댑터, 주소, 그리고 요청이 인증 방식을 적었을 때의 인증 방식입니다. 주소는 대문자와 끝의 /를 빼고 비교합니다. 요청이 값을 직접 보내면 그 값이 이깁니다. 빈 목록 []과 false도 사람이 일부러 끈 값으로 보고 남깁니다. 주소나 어댑터가 바뀌면 다섯 값은 따라가지 않습니다. 예전 주소에 발급된 키 풀도 같이 두고 옵니다. DNS 확인을 기다리는 동안 PATCH가 들어오면, 저장 직전에 그 값을 다시 읽어서 덮지 않습니다.

섀도 콜도 고칩니다. 가로채기 대상 프로바이더를 끄면 헬퍼 호출마다 404 Provider is disabled가 났습니다. 프로바이더를 지우면 더 나빴습니다. 프로바이더/모델이 기본 프로바이더로 조용히 넘어가서, 다른 키로 요청이 나갔습니다. 이제는 대상이 없거나 꺼져 있으면 보내기 전에 409와 코드 intercept_target_unavailable를 한 번 돌려줍니다. 기본 프로바이더로는 보내지 않습니다. 콤보와 라우팅 프로필은 미리 정해 둔 다음 대상으로 넘어가는 동작을 유지합니다. 이름만 있고 슬래시가 없는 대상이 기본 프로바이더로 가는 경우는 그대로 둡니다. 끄기와 삭제 응답에는 dependentShadowIntercept가 붙고, 가로채기가 켜져 있으면 대시보드가 경고를 띄웁니다.

베이스는 dev입니다. 이 커밋의 CI에서 테스트와 구조 검사는 아직 돌고 있습니다. PR은 드래프트이고, 화면 스크린샷이 없다고 게이트가 적혀 있습니다.

라인 - shadowInterceptProviderDependency는 모델 글자의 / 앞부분을 프로바이더 이름과 먼저 비교합니다. combo/아이디와 policy/아이디도 여기서 걸립니다. 프로바이더 이름이 combo이거나 별칭이 combo이면, 콤보 대상을 그 프로바이더에 묶인 것으로 경고합니다. 함수 설명은 콤보와 라우팅 프로필을 빼라고 했는데, 그 검사는 이 비교 다음에 있습니다. 먼저 걸리면 그 검사까지 가지 않습니다. 실제 호출은 콤보의 다음 대상으로 가는데, 화면은 헬퍼 호출이 실패할 것처럼 말합니다.

라인 - 프로바이더를 지울 때 섀도 대상이면 경고만 나옵니다. 기본 프로바이더가 바뀌었다는 문장은 나오지 않습니다. gui/src/pages/use-providers-crud.ts 삭제 성공 처리가 if (shadow) ... else ...라서, 둘 다 해당되면 새 기본 프로바이더 이름이 빠집니다.

메인테이너의 판단이 필요한 지점

  • 열린 PR #5614는 추론 목록 두 개를 저장 때 남기는 수정입니다. 이 PR이 그 내용을 이미 포함하고 있습니다. 이 PR을 살리면 #5614는 닫으면 됩니다.
  • 요청이 인증 방식을 안 적으면, 인증 방식이 바뀌지 않은 것으로 봅니다. 대시보드가 oauth에서 key로 바꿀 때 authMode를 빼먹으면, 예전 키 풀과 호환 설정이 남을 수 있습니다. 이 규칙을 그대로 둘지 정해 주면 됩니다.
  • 드래프트 게이트는 UI 스크린샷을 요구합니다. 작성자는 이 작업 레인에서 대시보드를 띄우지 못했다고 적었습니다.

너의 추천

저장할 때 설정이 조용히 지워지는 문제와, 꺼진 섀도 대상으로 요청이 새는 문제를 같이 막는 방향이 맞습니다. 머지 전에 / 앞부분만 보고 콤보와 policy를 프로바이더로 오인하는 부분을 고치면 좋겠습니다. 삭제 안내에는 기본 프로바이더가 바뀐 사실도 같이 적으면 좋겠습니다. #5614는 이 PR에 들어 있으니 닫으면 됩니다. 이 커밋의 CI가 끝날 때까지 기다리는 편이 안전합니다.

이 댓글은 grok-bot이 작성했습니다

@lidge-jun
lidge-jun marked this pull request as ready for review September 23, 2026 05:39
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 23, 2026 05:39
@lidge-jun
lidge-jun merged commit e635288 into dev Sep 23, 2026
28 of 29 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-23T05:46:20.466219Z 78dcaeb Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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 };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +41 to +43
if (route.routeKind === "default-provider" && model.includes("/")) {
return { unavailable: "it names no configured provider and would only reach the default provider" };
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant