Files
OmniRoute/tests/unit/proxy-noauth-provider-6272.test.ts
Diego Rodrigues de Sa e Souza b6975537c1 fix(providers): remove the chipotle/pepper provider (#13131) (#13913)
* fix(providers): remove the chipotle/pepper provider (#13131)

amelia.chipotle.com (the reverse-engineered Amelia chat-widget backend
chipotle/pepper-1 talked to) now returns 404 on every route, including
root, from its Azure Application Gateway — confirmed live 2026-09-15.
This regressed from a WS handshake timeout (#4037, June 2026) to a
fully decommissioned host, so the upstream protocol cannot be fixed.
Owner decided to retire the provider entirely (Option B), following
the phind/kluster quiet-removal precedent: no REMOVED_PROVIDERS.md
entry (reserved for operator takedowns), just a one-line note under
FREE_TIERS.md "Removed / no free tier".

Removed every surface: executor, registry entry, executors/index.ts
and providers/index.ts wiring, noauth provider catalog entry,
ProviderIcon generic-fallback set, the autoCombo exclusion-list
comment, the chipotle_error code from the sanitizer allowlist,
PROVIDER_REFERENCE.md (regenerated), and every doc/test reference.

Regression test: tests/unit/issue-13131-chipotle-provider-removed.test.ts
asserts the provider is fully gone from the executor registry, the
provider REGISTRY and the noauth catalog, and that the executor module
no longer resolves — not a live-network repro (flaky/third-party).

Several existing tests used "chipotle" only as a generic noAuth-provider
example (proxy scoping, error classification, onboarding, fallback
text) with no chipotle-specific behavior under test; those were
re-pointed at another still-existing noAuth provider
(cloudflare-playground / duckduckgo-web) rather than weakened.

* test(providers): document the agnes-cn/chipotle count coincidence (#13131)

provider-node-reserved-prefix.test.ts's REGISTRY id+alias walk was
already red on the base tip (414 vs. expected 412) from agnes-cn
(#13399, +id/+alias). Removing chipotle's REGISTRY id/alias in this
PR nets it back to 412, making the test pass again without a numeric
edit — record why in a comment so it doesn't read as an untracked
coincidence later.
2026-09-17 13:22:09 -03:00

94 lines
3.6 KiB
TypeScript

import test from "node:test";
import assert from "node:assert/strict";
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
const TEST_DATA_DIR = fs.mkdtempSync(path.join(os.tmpdir(), "omniroute-6272-"));
process.env.DATA_DIR = TEST_DATA_DIR;
const ORIGINAL_INITIAL_PASSWORD = process.env.INITIAL_PASSWORD;
delete process.env.INITIAL_PASSWORD;
const core = await import("../../src/lib/db/core.ts");
const settingsDb = await import("../../src/lib/db/settings.ts");
const { safeResolveProxy } = await import("../../src/sse/handlers/chatHelpers.ts");
test.after(async () => {
core.resetDbInstance();
fs.rmSync(TEST_DATA_DIR, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 });
if (ORIGINAL_INITIAL_PASSWORD === undefined) delete process.env.INITIAL_PASSWORD;
else process.env.INITIAL_PASSWORD = ORIGINAL_INITIAL_PASSWORD;
});
test("#6272: resolveProxyForConnection('noauth', ...) honors a provider-level proxy assigned to 'opencode'", async () => {
core.getDbInstance();
const proxy = { type: "http", host: "127.0.0.1", port: 8888 };
// Reporter's second symptom: "same thing happen when i set the proxy directly
// in the provider menu" -> assign a provider-scoped proxy to the opencode
// provider id, the way Settings -> Providers -> opencode would persist it.
await settingsDb.setProxyForLevel("provider", "opencode", proxy);
const resolved = await settingsDb.resolveProxyForConnection("noauth", undefined);
assert.equal(
resolved?.proxy?.host,
"127.0.0.1",
`expected the opencode provider-level proxy to be honored, got level=${resolved?.level} proxy=${JSON.stringify(resolved?.proxy)}`
);
assert.equal(resolved?.level, "provider");
assert.equal(resolved?.levelId, "opencode");
});
test("control: resolveProxyForConnection('noauth', ...) still honors the GLOBAL proxy when no no-auth provider proxy is set", async () => {
core.getDbInstance();
await settingsDb.deleteProxyForLevel("provider", "opencode");
const proxy = { type: "http", host: "10.0.0.1", port: 9999 };
await settingsDb.setProxyForLevel("global", null, proxy);
const resolved = await settingsDb.resolveProxyForConnection("noauth", undefined);
assert.equal(resolved?.proxy?.host, "10.0.0.1");
assert.equal(resolved?.level, "global");
});
test("resolveProxyForConnection keeps provider-level no-auth proxies isolated", async () => {
core.getDbInstance();
await settingsDb.deleteProxyForLevel("global", null);
await settingsDb.setProxyForLevel("provider", "opencode", {
type: "http",
host: "127.0.0.2",
port: 8889,
});
await settingsDb.setProxyForLevel("provider", "duckduckgo-web", {
type: "http",
host: "127.0.0.3",
port: 8890,
});
const opencode = await settingsDb.resolveProxyForConnection("noauth", undefined, "opencode");
const ddgw = await settingsDb.resolveProxyForConnection("noauth", undefined, "duckduckgo-web");
assert.equal(opencode?.proxy?.host, "127.0.0.2");
assert.equal(ddgw?.proxy?.host, "127.0.0.3");
});
test("safeResolveProxy keeps the synthetic no-auth connection provider-specific", async () => {
core.getDbInstance();
await settingsDb.setProxyForLevel("provider", "opencode", {
type: "http",
host: "127.0.0.4",
port: 8891,
});
await settingsDb.setProxyForLevel("provider", "duckduckgo-web", {
type: "http",
host: "127.0.0.5",
port: 8892,
});
const opencode = await safeResolveProxy("noauth", undefined, "opencode");
const ddgw = await safeResolveProxy("noauth", undefined, "duckduckgo-web");
assert.equal(opencode?.proxy?.host, "127.0.0.4");
assert.equal(ddgw?.proxy?.host, "127.0.0.5");
});