Repository navigation
feat(api): multi-key auth, free-limit proxy fallback, web_search grounding, Interactions API - #12
Merged
samson910022 merged 3 commits intoSep 9, 2026
Conversation
…nding, Interactions API
- P1: external multi-client keys (API_KEYS/OPENCODE_API_KEYS merge,
timingSafeEqual, Bearer/x-api-key OR, empty falls back to no-auth)
- P2: websearch allowlist alias normalization (web_fetch<->webfetch),
messages request-level narrowing parity
- P3: lazy fallback proxy pool (socks5-first, failover-rr, cooldown,
loopback bypass) engaged only on 429 FreeUsageLimitError/GoUsageLimitError;
stream paths degrade to poll; details/metrics exposure
- P4: /v1/responses tools:[{type:web_search}] drives opencode websearch,
returns web_search_call + url_citation (honest indices only)
- P5: POST /v1beta|/v1/interactions thin layer (text + google_search
grounding, previous_interaction_id, store flag, SSE contract)
- chat/messages reject hosted web_search with 400 + pointer
- engines: node >=22.19 (undici 8 floor)
typecheck + build clean; 13 suites / 244 tests green
- remove unread apiKeyId dead code, use isAuthorized verifier - shared isHostedSearchType (exact + versioned prefix), messages guard reuses it (covers google_search on /v1/messages) - normalize strategy/cooldown at config build time (truthful config+log) - document failover-rr/round-robin alias + store:false non-ephemerality - responses mixed-request toolMode metadata includes websearch - chat stream catch assigns collected unconditionally - tests: normalizers, versioned types, google_search 400
CI pinned Node 20 but undici 8 requires >=22.19, crashing every suite at import time (webidl.util.markAsUncloneable). Bump CI to Node 24 and load undici lazily so direct-only deployments never pay for or depend on the proxy runtime: load failure fails open to direct.
This was referenced Sep 9, 2026
samson910022
deleted the
feat/phased-multikey-websearch-fallback-interactions
branch
September 10, 2026 21:14
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.
Summary
Phased implementation (P1–P5), each phase reviewed by subagents with fix→review loops until PASS, plus a final 3-agent comprehensive review (GO).
API_KEYS/OPENCODE_API_KEYSmerge, timingSafeEqual, Bearer/x-api-key OR, empty falls back to no-auth)web_fetch↔webfetch), messages request-level narrowing parity/v1/responsestools:[{type:web_search}]drives opencode websearch, returnsweb_search_call+url_citation(honest indices only)POST /v1beta|/v1/interactionsthin layer (text + google_search grounding, previous_interaction_id, store flag, SSE contract)Verification
npm run typecheckcleannpm run buildcleannpm test -- --runInBand: 13 suites / 244 tests green (was 7/191)Docs
docs/api-reference.md: web_search grounding + Interactions sectionsdocs/configuration.md: API_KEYS row, fallback-proxy section (two-hop model), allowlist guidance