refactor(plugins): share API provider specs - #4062
Merged
Merged
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review blockedAutomated review did not run, so no review verdict was produced. Reason: The input-safety check rejected material in this revision. No detected value, path, or scanner output is reproduced here. Automatic review is on hold, including after source changes. Request a fresh re-review after resolving the failure; maintainers can also release the hold through an intentional scanner-policy update. Next step: If this is a genuine credential, remove and rotate it. If it is an intentional test fixture, a maintainer must review and qualify it. |
steipete
force-pushed
the
triage/20260921-plugin-glue-b4
branch
from
September 28, 2026 01:49
3a46313 to
d59562f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Six bundled providers now share
PluginProviderSpecregistration: Hugging Face, Nous, Fireworks, xAI, Venice, and Zed. Hugging Face and xAI also share the API-key settings implementation. This removes 255 production lines and raises the declarative count from 31 to 37, with the 87-provider registry unchanged.Native boundaries remain provider-owned: Hugging Face keeps its CLI-token reader and serialized retained runtime; Nous keeps Hermes credential validation and diagnostics; Fireworks keeps slug projection and allowlisted persistence; Venice and Zed keep their native source routing, cookie policy, bindings, and visibility. Bundled scripts are unchanged. Every migrated color uses
ProviderColor(hex:).The new typed options carry existing status-page, token-cost, settings-section, and plugin-result-policy contracts. Each is needed by at least two candidates, including deferred providers: status pages by Hugging Face/OpenAI; token costs by xAI/OpenRouter/OpenAI; settings sections by Fireworks/Moonshot/z.ai/OpenRouter; result policies by Fireworks/OpenAI. Shared code contains no provider switch.
Equivalence and validation
The separate pre/post capture is byte-identical: 53,692 bytes, SHA-256:
It covers all ten candidates: registry and implementation order, full CLI help, metadata/branding/widget flags, settings text/actions/pickers, cookie-mode snapshots, credential projections, token-account metadata, and availability. The committed golden remains derived-only and adds the token-cost capability. New coverage checks native file-token discovery and reuse of the retained Hugging Face strategy.
All Swift tests used
source Scripts/test_environment.sh. No live probes, cookie imports, app relaunches, release builds, or full sharded suite were run.565 app/core tests, 56 plugin tests, and 18 Linux-target tests passed. XCTest executed 65 tests with two opt-in renderers skipped and zero failures. Linux-target tests ran on macOS.
JSC: 117 app/core and 39 plugin tests passed.
make check: exit 0, zero violations in 2,660 Swift files. All three pre-commit independent reviews finished without actionable P0–P2 findings.The initial build caught a test naming the removed xAI implementation. A temporary capture hook also reused the golden's fixture name and contaminated synthetic account availability; the hook was removed and the focused run passed without changing the frozen expected values. One argument-layout lint violation was fixed in a separate commit. No pre-existing bug fix or regression red→green claim is made; this is a behavior-preserving refactor. No changelog entry is needed.
Deferred candidates
Sources/CodexBarCore/Providers/Moonshot/MoonshotProviderDescriptor.swift:88) and shared Kimi branding remain outside the spec.Sources/CodexBarCore/Providers/Zai/ZaiProviderDescriptor.swift:95) is not expressible by the spec; it is the only candidate needing that option.Sources/CodexBarCore/Providers/OpenRouter/OpenRouterProviderDescriptor.swift:59) is unique among these spec candidates; widget selectability also must be retained.(0.06, 0.51, 0.43)color (Sources/CodexBarCore/Providers/OpenAI/OpenAIAPIProviderDescriptor.swift:45) cannot be represented by six-digit hex without changing the capture; its custom icon and cost-menu configuration also remain outside the current spec. No color was changed.Abacus, Muse, LongCat, Replicate, and TypeSafe are untouched as requested.
Production delta
The branch changes 12 production files.
Scripts/regenerate-provider-manifests.shregenerated the manifests; only the two app implementation entries changed. No gatekeeper anchors needed changes. Tests add 156 lines and remove four relative to the pinned basebf34fc9f424f.Refs #4043
Refs #4049
Refs #4058