Skip to content

Commit 1a47675

Browse files
committed
fix: restore check after CLI seam cleanup
1 parent a01c4c3 commit 1a47675

39 files changed

Lines changed: 90 additions & 601 deletions

extensions/anthropic/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-
44
import anthropicPlugin from "./index.js";
55

66
describe("anthropic provider replay hooks", () => {
7-
it("registers no cli backends", async () => {
7+
it("registers no cli commands", async () => {
88
const captured = capturePluginRegistration({ register: anthropicPlugin.register });
99

10-
expect(captured.cliBackends).toEqual([]);
10+
expect(captured.cliRegistrars).toEqual([]);
1111
});
1212

1313
it("owns native reasoning output mode for Claude transports", async () => {

extensions/google/provider-models.test.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ describe("resolveGoogleGeminiForwardCompatModel", () => {
5454
it("resolves stable gemini 2.5 flash-lite from direct google templates for Gemini CLI when available", () => {
5555
const model = resolveGoogleGeminiForwardCompatModel({
5656
providerId: "google-gemini-cli",
57-
templateProviderId: "google",
5857
ctx: createContext({
5958
provider: "google-gemini-cli",
6059
modelId: "gemini-2.5-flash-lite",
@@ -73,7 +72,6 @@ describe("resolveGoogleGeminiForwardCompatModel", () => {
7372
it("resolves stable gemini 2.5 flash-lite from Gemini CLI templates when direct google templates are unavailable", () => {
7473
const model = resolveGoogleGeminiForwardCompatModel({
7574
providerId: "google-gemini-cli",
76-
templateProviderId: "google",
7775
ctx: createContext({
7876
provider: "google-gemini-cli",
7977
modelId: "gemini-2.5-flash-lite",
@@ -99,7 +97,6 @@ describe("resolveGoogleGeminiForwardCompatModel", () => {
9997
it("resolves gemini 3.1 pro for google aliases via an alternate template provider", () => {
10098
const model = resolveGoogleGeminiForwardCompatModel({
10199
providerId: "google-vertex",
102-
templateProviderId: "google-gemini-cli",
103100
ctx: createContext({
104101
provider: "google-vertex",
105102
modelId: "gemini-3.1-pro-preview",
@@ -118,7 +115,6 @@ describe("resolveGoogleGeminiForwardCompatModel", () => {
118115
it("keeps Gemini CLI 3.1 clones sourced from CLI templates when both catalogs exist", () => {
119116
const model = resolveGoogleGeminiForwardCompatModel({
120117
providerId: "google-gemini-cli",
121-
templateProviderId: "google",
122118
ctx: createContext({
123119
provider: "google-gemini-cli",
124120
modelId: "gemini-3.1-pro-preview",
@@ -149,7 +145,6 @@ describe("resolveGoogleGeminiForwardCompatModel", () => {
149145
it("preserves template reasoning metadata instead of forcing it on forward-compat clones", () => {
150146
const model = resolveGoogleGeminiForwardCompatModel({
151147
providerId: "google",
152-
templateProviderId: "google-gemini-cli",
153148
ctx: createContext({
154149
provider: "google",
155150
modelId: "gemini-3.1-flash-preview",
@@ -172,7 +167,6 @@ describe("resolveGoogleGeminiForwardCompatModel", () => {
172167
it("resolves gemini 3.1 flash from direct google templates", () => {
173168
const model = resolveGoogleGeminiForwardCompatModel({
174169
providerId: "google",
175-
templateProviderId: "google-gemini-cli",
176170
ctx: createContext({
177171
provider: "google",
178172
modelId: "gemini-3.1-flash-preview",
@@ -195,7 +189,6 @@ describe("resolveGoogleGeminiForwardCompatModel", () => {
195189
it("prefers the flash-lite template before the broader flash prefix", () => {
196190
const model = resolveGoogleGeminiForwardCompatModel({
197191
providerId: "google-vertex",
198-
templateProviderId: "google-gemini-cli",
199192
ctx: createContext({
200193
provider: "google-vertex",
201194
modelId: "gemini-3.1-flash-lite-preview",

extensions/lobster/src/lobster-tool.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ function fakeApi(overrides: Partial<OpenClawPluginApi> = {}): OpenClawPluginApi
4444
registerGatewayMethod() {},
4545
registerCli() {},
4646
registerService() {},
47-
registerCliBackend() {},
4847
registerConfigMigration() {},
4948
registerAutoEnableProbe() {},
5049
registerProvider() {},

src/agents/auth-profiles.store-cache.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ import fs from "node:fs";
22
import os from "node:os";
33
import path from "node:path";
44
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
5-
import { AUTH_STORE_VERSION, EXTERNAL_CLI_SYNC_TTL_MS } from "./auth-profiles/constants.js";
5+
import { AUTH_STORE_VERSION } from "./auth-profiles/constants.js";
66
import type { AuthProfileStore } from "./auth-profiles/types.js";
77

8+
const AUTH_STORE_CACHE_TTL_MS = 15 * 60 * 1000;
9+
810
const mocks = vi.hoisted(() => ({
911
syncExternalCliCredentials: vi.fn((_: AuthProfileStore) => false),
1012
}));
@@ -138,7 +140,7 @@ describe("auth profile store cache", () => {
138140
expect(second.profiles["openai-codex:default"]).toMatchObject({ access: "access-1" });
139141
expect(mocks.syncExternalCliCredentials).toHaveBeenCalledTimes(1);
140142

141-
vi.advanceTimersByTime(EXTERNAL_CLI_SYNC_TTL_MS + 1);
143+
vi.advanceTimersByTime(AUTH_STORE_CACHE_TTL_MS + 1);
142144

143145
const third = ensureAuthProfileStore(agentDir);
144146

src/agents/command/session-store.test.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("updateSessionStoreAfterAgentRun", () => {
2020
await fs.rm(tmpDir, { recursive: true, force: true });
2121
});
2222

23-
it("persists cli session bindings when the provider is configured as a CLI backend", async () => {
23+
it("persists the runtime provider/model used by the completed run", async () => {
2424
const cfg = {
2525
agents: {
2626
defaults: {
@@ -47,9 +47,6 @@ describe("updateSessionStoreAfterAgentRun", () => {
4747
sessionId: "cli-session-123",
4848
provider: "codex-cli",
4949
model: "gpt-5.4",
50-
cliSessionBinding: {
51-
sessionId: "cli-session-123",
52-
},
5350
},
5451
},
5552
};
@@ -65,15 +62,11 @@ describe("updateSessionStoreAfterAgentRun", () => {
6562
result,
6663
});
6764

68-
expect(sessionStore[sessionKey]?.cliSessionBindings?.["codex-cli"]).toEqual({
69-
sessionId: "cli-session-123",
70-
});
71-
expect(sessionStore[sessionKey]?.cliSessionIds?.["codex-cli"]).toBe("cli-session-123");
65+
expect(sessionStore[sessionKey]?.modelProvider).toBe("codex-cli");
66+
expect(sessionStore[sessionKey]?.model).toBe("gpt-5.4");
7267

7368
const persisted = loadSessionStore(storePath);
74-
expect(persisted[sessionKey]?.cliSessionBindings?.["codex-cli"]).toEqual({
75-
sessionId: "cli-session-123",
76-
});
77-
expect(persisted[sessionKey]?.cliSessionIds?.["codex-cli"]).toBe("cli-session-123");
69+
expect(persisted[sessionKey]?.modelProvider).toBe("codex-cli");
70+
expect(persisted[sessionKey]?.model).toBe("gpt-5.4");
7871
});
7972
});

src/agents/model-selection.test.ts

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { describe, it, expect, vi } from "vitest";
22
import type { OpenClawConfig } from "../config/config.js";
33
import { resetLogger, setLoggerOverride } from "../logging/logger.js";
4-
import { createEmptyPluginRegistry } from "../plugins/registry-empty.js";
5-
import { getActivePluginRegistry, setActivePluginRegistry } from "../plugins/runtime.js";
64
import {
75
buildAllowedModelSet,
86
inferUniqueProviderFromConfiguredModels,
@@ -134,27 +132,8 @@ describe("model-selection", () => {
134132
});
135133

136134
describe("isCliProvider", () => {
137-
it("treats runtime-registered CLI backends as CLI providers", () => {
138-
const previousRegistry = getActivePluginRegistry();
139-
const registry = createEmptyPluginRegistry();
140-
try {
141-
registry.cliBackends = [
142-
{
143-
pluginId: "example-plugin",
144-
source: "test",
145-
backend: {
146-
id: "example-cli",
147-
config: {
148-
command: "example",
149-
},
150-
},
151-
},
152-
];
153-
setActivePluginRegistry(registry);
154-
expect(isCliProvider("example-cli", {} as OpenClawConfig)).toBe(true);
155-
} finally {
156-
setActivePluginRegistry(previousRegistry ?? createEmptyPluginRegistry());
157-
}
135+
it("returns false for provider ids", () => {
136+
expect(isCliProvider("example-cli", {} as OpenClawConfig)).toBe(false);
158137
});
159138
});
160139

src/agents/skills/plugin-skills.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ function buildRegistry(params: { acpxRoot: string; helperRoot: string }): Plugin
2626
name: "ACPX Runtime",
2727
channels: [],
2828
providers: [],
29-
cliBackends: [],
3029
skills: ["./skills"],
3130
hooks: [],
3231
origin: "workspace",
@@ -39,7 +38,6 @@ function buildRegistry(params: { acpxRoot: string; helperRoot: string }): Plugin
3938
name: "Helper",
4039
channels: [],
4140
providers: [],
42-
cliBackends: [],
4341
skills: ["./skills"],
4442
hooks: [],
4543
origin: "workspace",
@@ -67,7 +65,6 @@ function createSinglePluginRegistry(params: {
6765
channels: [],
6866
providers: [],
6967
legacyPluginIds: params.legacyPluginIds,
70-
cliBackends: [],
7168
skills: params.skills,
7269
hooks: [],
7370
origin: "workspace",

src/auto-reply/reply.triggers.trigger-handling.test-harness.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import os from "node:os";
44
import { join } from "node:path";
55
import { afterAll, afterEach, beforeAll, expect, vi } from "vitest";
66
import { clearRuntimeAuthProfileStoreSnapshots } from "../agents/auth-profiles.js";
7-
import { resetCliCredentialCachesForTest } from "../agents/cli-credentials.js";
87
import type { OpenClawConfig } from "../config/config.js";
98
import { resetProviderRuntimeHookCacheForTest } from "../plugins/provider-runtime.js";
109
import { resolveRelativeBundledPluginPublicModuleId } from "../test-utils/bundled-plugin-public-surface.js";
@@ -447,7 +446,6 @@ export async function runGreetingPromptForBareNewOrReset(params: {
447446
export function installTriggerHandlingE2eTestHooks() {
448447
afterEach(() => {
449448
clearRuntimeAuthProfileStoreSnapshots();
450-
resetCliCredentialCachesForTest();
451449
resetProviderRuntimeHookCacheForTest();
452450
vi.clearAllMocks();
453451
});

src/auto-reply/reply/agent-runner-execution.test.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,6 @@ vi.mock("../../agents/model-selection.js", () => ({
3131
isCliProvider: () => false,
3232
}));
3333

34-
vi.mock("../../agents/cli-runner.js", () => ({
35-
runCliAgent: vi.fn(),
36-
}));
37-
38-
vi.mock("../../agents/cli-session.js", () => ({
39-
getCliSessionId: vi.fn(),
40-
}));
41-
4234
vi.mock("../../agents/bootstrap-budget.js", () => ({
4335
resolveBootstrapWarningSignaturesSeen: () => [],
4436
}));

src/auto-reply/reply/agent-runner-execution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
updateSessionStore,
2828
} from "../../config/sessions.js";
2929
import { logVerbose } from "../../globals.js";
30-
import { emitAgentEvent, registerAgentRunContext } from "../../infra/agent-events.js";
30+
import { registerAgentRunContext } from "../../infra/agent-events.js";
3131
import { CommandLaneClearedError, GatewayDrainingError } from "../../process/command-queue.js";
3232
import { defaultRuntime } from "../../runtime.js";
3333
import { sanitizeForLog } from "../../terminal/ansi.js";

0 commit comments

Comments
 (0)