Skip to content

fix(sse): derive the auto-combo noauth pool from emulated tool calling - #16436

Merged
diegosouzapw merged 7 commits into
cheaper-inference:release/v3.8.52from
opensource-elearning:fix/noauth-providers-api-and-bun-pack
Oct 16, 2026
Merged

diegosouzapw merged 7 commits into
cheaper-inference:release/v3.8.52from
opensource-elearning:fix/noauth-providers-api-and-bun-pack

Conversation

@opensource-elearning

@opensource-elearning opensource-elearning commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds toolCalling: "emulated" to the free noauth providers so they stay eligible for tool-calling combos, and replaces the hardcoded auto-combo noauth allowlist with auto-discovery from NOAUTH_PROVIDERS.

Changes

1. Registry entries (open-sse/config/providers/registry/*)

toolCalling: "emulated" added to:

  • opencode
  • duckduckgo-web
  • cloudflare-playground
  • uncloseai

2. open-sse/config/providers/shared.ts

New optional field on RegistryEntry, with docs:

toolCalling?: "emulated" | boolean;

Opt-in for providers whose registry/capability rows report toolCalling: false but that serve prompt-emulated tool calling.

3. src/shared/constants/providers/noauth.ts

toolCalling: "emulated" added to opencode, cloudflare-playground and uncloseai. (duckduckgo-web and devin-cli-agentic already carried it on the base branch.)

4. open-sse/services/autoCombo/virtualFactory.ts — auto-discovery

Replaces the hardcoded allowlist:

- const AUTO_COMBO_NOAUTH_ALLOWLIST = new Set<string>(["opencode"]);
+ const EMULATED_TOOL_CALLING_NOAUTH_PROVIDERS = getEmulatedToolCallingNoAuthProviders();

getEmulatedToolCallingNoAuthProviders() scans NOAUTH_PROVIDERS at startup and collects every entry with noAuth: true and toolCalling: "emulated", so there is no hardcoded list to maintain when a provider is added.

Net effect on the fresh-install auto/auto-* noauth pool: {opencode} → {cloudflare-playground, devin-cli-agentic, duckduckgo-web, opencode, uncloseai}. aihorde, auggie, codex-app-server, veoaifree-web and zcode carry no opt-in and stay out.

5. Regression guards updated

tests/unit/noauth-autocombo-allowlist.test.ts and tests/unit/virtual-auto-combo.test.ts pinned the old hardcoded {opencode} allowlist. Both now assert the auto-discovered set — present: cloudflare-playground, devin-cli-agentic, duckduckgo-web, opencode, uncloseai; absent: aihorde, auggie, codex-app-server, veoaifree-web, zcode.

The header of noauth-autocombo-allowlist.test.ts and the docblock above getEmulatedToolCallingNoAuthProviders() keep the operator decision of 2026-07-24 (refs #8183/#6453/#7032) as historical context: duckduckgo-web (429/VQD) and aihorde (401, anon key rejected) were unreliable on the reference egress (VPS .15) and still carry no opt-in, so they stay out. That decision also scoped the pool to the category/tier and flat-variant auto/* pools — auto/<family> selectors still bypass it (bypassAllowlist, refs #6453/#8183).

Adding toolCalling: "emulated" to another NOAUTH_PROVIDERS entry now requires a reviewed diff in both guard files. That is intentional.

Why this matters

Free noauth providers have no native upstream tool calling, so the supportsToolCalling check filtered them out of tool-calling combos (auto/coding, auto/best-coding, …). With toolCalling: "emulated" they stay eligible: the 3rd-party CLI (Claude Code, Codex, Cursor, …) executes the tools while the free provider only emits the call markers.

Scope note

Rebased onto release/v3.8.52 and trimmed to this PR's own 2 commits. Commits belonging to other open PRs were removed and remain in their own PRs: #16323, #16324, #16325, #16326, #16341, #16342, #16346, #16355. The stray pr-body.md (leftover draft belonging to another feature) was dropped from the first commit.

⚠️ base-red inherited: #15306 — the remaining CI failures are inherited, not caused by this PR. Sibling PR #16341 (unrelated change, same base) fails the identical check list. tests/unit/auto-combo-candidates-free-access-reason.test.ts is byte-identical to base here and its fix lives in #16326.

Testing

  • npm run typecheck:core — pass
  • tests/unit/noauth-autocombo-allowlist.test.ts — 3/3 pass
  • tests/unit/virtual-auto-combo.test.ts — 12/12 pass
  • tests/unit/capability-filter.test.ts, tests/unit/model-capabilities-registry.test.ts, tests/unit/8488-capability-filter-fail-closed.test.ts — 39/39 pass
  • ESLint over the changed files — clean apart from shared.ts:916, which is pre-existing and already listed in config/quality/eslint-suppressions.json

…hared.ts docs

- opencode: add toolCalling=emulated in registry
- duckduckgo-web: add toolCalling=emulated in registry
- cloudflare-playground: add toolCalling=emulated in registry
- uncloseai: add toolCalling=emulated in registry
- shared.ts: document toolCalling='emulated' opt-in for prompt-emulated providers

This allows free noauth providers (opencode, duckduckgo-web, cloudflare-playground, uncloseai) to work with tool-calling combos by using prompt-emulated tool calling instead of native upstream tool calling.

The emulated approach lets 3rd-party CLIs (Claude, Codex, Cursor) handle tool calls while the free provider just generates text. This unlocks free models for tool use cases without requiring upstream tool calling support.
@opensource-elearning
opensource-elearning force-pushed the fix/noauth-providers-api-and-bun-pack branch from cf8bba8 to 0594df5 Compare October 13, 2026 02:42
…roviders

- Add toolCalling=emulated to cloudflare-playground and uncloseai
- Auto-discovery in virtualFactory.ts picks up all providers with toolCalling=emulated
- No hardcoded allowlist - new providers just need toolCalling=emulated in NOAUTH_PROVIDERS

5 providers now support tool-calling combos via emulation:
- devin-cli-agentic
- opencode
- duckduckgo-web
- cloudflare-playground
- uncloseai

Update the two regression guards that pinned the old {opencode}-only allowlist
(tests/unit/virtual-auto-combo.test.ts, tests/unit/noauth-autocombo-allowlist.test.ts)
to the auto-discovered set, keeping the 2026-07-24 egress-reliability note
(refs cheaper-inference#8183/cheaper-inference#6453/cheaper-inference#7032) as historical context. Repair the comment block above
getEmulatedToolCallingNoAuthProviders(), which the rewrite had left cut mid-sentence.

Verified: auto/coding, auto/coding:free, auto/coding:pro work with tools
Move discovery into emulatedNoAuthAllowlist.ts so virtualFactory.ts stays
under its frozen ceiling (1239/1258). The pool remains every NOAUTH provider
with toolCalling "emulated": cloudflare-playground, devin-cli-agentic,
duckduckgo-web, opencode, and uncloseai.
# Conflicts:
#	open-sse/config/providers/registry/opencode/index.ts
@diegosouzapw diegosouzapw changed the title fix(providers): add toolCalling=emulated to free noauth providers + shared.ts docs fix(sse): derive the auto-combo noauth pool from emulated tool calling Oct 16, 2026
@diegosouzapw
diegosouzapw merged commit 6759603 into cheaper-inference:release/v3.8.52 Oct 16, 2026
8 of 9 checks passed
diegosouzapw pushed a commit that referenced this pull request Oct 18, 2026
devin-cli-agentic joins the auto/* pools only once its isolated login is confirmed. A cached `devin auth status` probe (no CLI output, which holds account PII, is ever returned) backs a readiness gate in the auto-combo no-auth pool, a provider-card / detail-page badge, and GET /api/providers/devin-cli-agentic/auth-status, which is classified LOCAL_ONLY in routeGuard.ts because it spawns the CLI (Hard Rules #15/#17; covered by route-guard-devin-agentic-auth-status.test.ts). Direct devin-cli-agentic/<model> routing is unchanged.

Operational notes:
- The auto/* path never waits on the CLI: it reads the cached status and, when it is missing or older than 60 s, starts ONE background `devin auth status` spawn (8 s timeout). So a server with auto/* traffic spawns the Devin CLI in the background about once a minute.
- Devin was already in the auto/* no-auth allowlist via #16436 (emulated tool calling); this PR narrows that admission to a confirmed login.

Maintainer fixes on top:
- Boundary: open-sse/services/autoCombo/virtualFactory.ts no longer imports @/lib/providers/noAuthAutoRoutingReadiness (new open-sse -> src edge; tip at the 774 ceiling). New open-sse/services/autoCombo/noAuthReadiness.ts registry (registerNoAuthReadiness(id, probe) + isNoAuthProviderReadyForAutoRouting(id)); it fails closed: a provider that requires a probe stays out when none is registered or the probe throws. The Devin probe is registered from src at boot (registerNodejs -> registerNoAuthAutoRoutingReadiness()).
- tests/unit/virtual-auto-combo.test.ts (failing on the PR head: it still listed devin-cli-agentic as allowed) now stubs the readiness probe as logged in, so it keeps asserting the full membership with Devin included; no assertion weakened.
- noauth-autocombo-allowlist.test.ts registers the real probe like boot does, plus fail-closed cases (no registered probe while the CLI is logged in; throwing probe keeps the rest of the pool intact).
- Prettier on devin-agentic-auth-status.test.ts; merged the current tip.

Evidence:
- noauth-autocombo-allowlist, virtual-auto-combo, devin-agentic-auth-status, route-guard-devin-agentic-auth-status, instrumentation-import-graph-12074: 32/32 (re-run after the final tip merge); vitest providerCardAudioBadge.test.tsx + tests/unit/autoCombo: 16/16.
- Gates exit 0: typecheck:core, open-sse typecheck, api typecheck, file-size, complexity, cognitive complexity, dead-code, boundary ratchet (774/774), agent skills (Generated 0), changelog-integrity, env-doc-sync, docs-sync, eslint, prettier.
- Any remaining CI reds are the inherited base-red #15306.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants