Skip to content

feat(web-search): backend registry and executor-runnable candidate set (#2188 L3) - #2206

Merged
lidge-jun merged 3 commits into
devfrom
codex/sidecar-websearch-slots
Aug 21, 2026
Merged

lidge-jun merged 3 commits into
devfrom
codex/sidecar-websearch-slots

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Aug 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

Layer 3 of the #2188 stacked chain (parent: #2204). Web-search rule 2 — a model may be OFFERED as the web-search sidecar only when an active, executor-backed backend can actually run it:

  • src/web-search/backends.ts: WEB_SEARCH_BACKENDS registers the two shipped backends (ChatGPT forward, Anthropic stored-OAuth) with auth-presence as the liveness probe. Future backends (Gemini/Grok/Zen/Exa) stay out until a live probe + executor land; probe contracts are recorded in the devlog unit (002/031).
  • webSearchSidecarCandidates = (picker-visible ∪ auth slots) ∩ active-backend-runnable. The openai side requires a bare native slug or the Luna auth slot — account-bound selector/slug rows and custom openai-keyed rows are excluded because the forward executor POSTs settings.model verbatim (review-caught).
  • planWebSearch consumes the shared auth state for credential presence. resolveSidecarBackend's explicit-or-openai preference is deliberately unchanged; the types/config.ts comment and three docs-site pages that claimed anthropic-preferred for web-search now tell the truth (vision keeps its own anthropic-if-credential default).

Design doc: devlog/_plan/260820_sidecar_selection_unification/030_layer3_websearch_slots.md.

Verification

  • bun x tsc --noEmit clean; bun test --isolate across web-search-candidates, web-search, web-search-anthropic, sidecar-candidates, sidecar-auth — green (9 new tests incl. selector/slug and custom-row exclusions, hidden-Luna slot survival, keyed-anthropic unreachability, resolveSidecarBackend(undefined) === "openai" pin).
  • Independent read-only review (grok-4.6): one High (selector/slug ids) + two Mediums (custom rows, docs-site claims) found, fixed, and re-verified to pass across three rounds.

Checklist

Summary by CodeRabbit

  • New Features

    • Web search now defaults to OpenAI unless Anthropic is explicitly selected.
    • Vision automatically prefers a usable Anthropic account, otherwise falling back to OpenAI.
    • Web-search model availability now reflects active authentication and backend eligibility.
  • Bug Fixes

    • Clarified and aligned backend-selection behavior across configuration and user documentation.
    • Explicit Anthropic configuration continues to fail safely when credentials are unavailable.
  • Tests

    • Added coverage for backend eligibility, authentication requirements, custom models, and disabled accounts.

@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner August 20, 2026 14:19
@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2a8ffcd4-2947-4fa0-aed0-9ff6b4f9c587

📥 Commits

Reviewing files that changed from the base of the PR and between a141859 and 9b827c2.

📒 Files selected for processing (7)
  • docs-site/src/content/docs/guides/claude-code.md
  • docs-site/src/content/docs/guides/sidecars.md
  • docs-site/src/content/docs/reference/configuration/server.md
  • src/types/config.ts
  • src/web-search/backends.ts
  • src/web-search/index.ts
  • tests/web-search-candidates.test.ts

📝 Walkthrough

Walkthrough

Web-search backend selection now uses explicit OpenAI and Anthropic descriptors, filters candidates by active authentication and provider rules, and resolves Anthropic credentials during planning. Configuration references and guides document separate web-search and vision defaults.

Changes

Web search backend selection

Layer / File(s) Summary
Backend registry and candidate filtering
src/web-search/backends.ts, tests/web-search-candidates.test.ts
Defines OpenAI and Anthropic activation and candidate eligibility rules. Filters unsupported candidates and identifies authentication-slot models. Tests cover authentication, provider, model, and default-selection cases.
Sidecar authentication in web-search planning
src/web-search/index.ts
planWebSearch resolves shared sidecar authentication and constructs Anthropic provider data from the validated provider configuration.
Distinct backend defaults
src/types/config.ts, docs-site/src/content/docs/reference/configuration/server.md, docs-site/src/content/docs/guides/sidecars.md, docs-site/src/content/docs/guides/claude-code.md
Documents OpenAI as the web-search default and Anthropic as explicit-only. Documents Anthropic preference for vision when a usable OAuth account exists, with OpenAI as fallback.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Auth as SidecarAuthState
  participant Filter as webSearchSidecarCandidates
  participant Backends as WEB_SEARCH_BACKENDS
  participant Planner as planWebSearch
  Auth->>Filter: resolved authentication
  Filter->>Backends: evaluate backend eligibility
  Backends-->>Filter: runnable candidates
  Planner->>Auth: resolve shared sidecar authentication
  Auth-->>Planner: validated Anthropic provider data
Loading

Suggested reviewers: ingwannu

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/sidecar-websearch-slots

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.

@Ingwannu Ingwannu left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Reviewed the exact current head 92f5f42. The backend registry is limited to shipped executor-backed/auth-probed implementations, the OpenAI candidate predicate excludes account-qualified and custom provider rows that the forward executor cannot consume verbatim, and the default-backend documentation now matches resolveSidecarBackend. Focused tests and typecheck were green locally, and the full exact-head CI including macOS is green. Approved as the Layer 3 stacked change; do not merge this layer independently before its parent chain is ready and retargeted onto dev.

@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 65 / 80

#2188 L3임. 부모 #2204. 웹서치 후보 = (피커 ∪ 슬롯) ∩ 실행 가능한 백엔드. src/web-search/backends.ts에 ChatGPT forward랑 Anthropic stored-OAuth만 등록함. Gemini/Grok/Zen/Exa는 프로브+executor 없이 안 넣음. 그 자제 맞음. #2190 x_search랑 섞지 말 것.

planWebSearch가 공유 auth를 봄. resolveSidecarBackend의 explicit-or-openai는 안 바꿈. 예전에 anthropic 우선이라고 적힌 src/types/config.ts 주석이랑 docs-site 세 페이지를 고침. config 필드 유니온을 넓히진 않음. 스플릿 캠페인이랑 겹치면 이 레이어만 닫고 다시 짜는 게 맞음. 스택 전체를 리베이스하지 말 것.

openai 후보는 bare native slug나 luna 슬롯만. selector/slug랑 커스텀 openai 키 줄은 제외. forward executor가 settings.model을 그대로 POST해서임. 리뷰에서 잡은 거 맞음.

해결방안: L2 위에 머지. 미래 백엔드는 031 문서대로 프로브 생긴 뒤에 레지스트리 줄만 추가. backend: openai|anthropic 유니온을 이 PR에서 키우지 말 것.

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

@lidge-jun
lidge-jun changed the base branch from codex/sidecar-picker-candidates to dev August 21, 2026 03:30
@lidge-jun
lidge-jun force-pushed the codex/sidecar-websearch-slots branch from 92f5f42 to 1f4a8da Compare August 21, 2026 03:31
WEB_SEARCH_BACKENDS registers only executor-backed, auth-probed
backends (openai forward, anthropic stored-OAuth); future backends stay
out until a live probe and executor land. webSearchSidecarCandidates =
(picker ∪ auth slots) ∩ active backend family. planWebSearch consumes
the shared auth state for presence; resolveSidecarBackend's
explicit-or-openai preference is unchanged, and the config comment that
claimed the opposite now tells the truth.
Account-bound selector/slug rows and custom openai-keyed rows reach the
candidate set as provider openai, but the forward executor POSTs
settings.model verbatim with no routeModel prefix-stripping, so those
ids can never run. eligibleModel now requires a bare native slug or the
auth slot. docs-site stops claiming anthropic-preferred for web-search
(that default belongs to vision only).
@lidge-jun
lidge-jun force-pushed the codex/sidecar-websearch-slots branch from 1f4a8da to 9b827c2 Compare August 21, 2026 03:31
@lidge-jun
lidge-jun merged commit bd79ab5 into dev Aug 21, 2026
4 of 5 checks passed
@lidge-jun
lidge-jun deleted the codex/sidecar-websearch-slots branch August 26, 2026 04:12
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
lidge-jun#2188 L3) (lidge-jun#2206)

* feat(web-search): backend registry and candidate intersection (lidge-jun#2188)

WEB_SEARCH_BACKENDS registers only executor-backed, auth-probed
backends (openai forward, anthropic stored-OAuth); future backends stay
out until a live probe and executor land. webSearchSidecarCandidates =
(picker ∪ auth slots) ∩ active backend family. planWebSearch consumes
the shared auth state for presence; resolveSidecarBackend's
explicit-or-openai preference is unchanged, and the config comment that
claimed the opposite now tells the truth.

* fix(web-search): restrict the openai backend to executor-runnable ids

Account-bound selector/slug rows and custom openai-keyed rows reach the
candidate set as provider openai, but the forward executor POSTs
settings.model verbatim with no routeModel prefix-stripping, so those
ids can never run. eligibleModel now requires a bare native slug or the
auth slot. docs-site stops claiming anthropic-preferred for web-search
(that default belongs to vision only).

* docs(vision): describe the vision backend default on its own terms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants