refactor(extensions): remove unused dead helpers · openclaw/openclaw@b5f71c0
vincentkoc
·
2026-06-18
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -20,7 +20,7 @@ vi.mock("./cli-auth-seam.js", async (importActual) => {
|
20 | 20 | }; |
21 | 21 | }); |
22 | 22 | |
23 | | -const { buildAnthropicCliMigrationResult, hasClaudeCliAuth } = await import("./cli-migration.js"); |
| 23 | +const { buildAnthropicCliMigrationResult } = await import("./cli-migration.js"); |
24 | 24 | const { resolveKnownAnthropicModelRef } = await import("./claude-model-refs.js"); |
25 | 25 | const { createTestWizardPrompter, registerSingleProviderPlugin } = |
26 | 26 | await import("openclaw/plugin-sdk/plugin-test-runtime"); |
@@ -135,23 +135,6 @@ function createProviderAuthMethodNonInteractiveContext(
|
135 | 135 | } |
136 | 136 | |
137 | 137 | describe("anthropic cli migration", () => { |
138 | | -it("detects local Claude CLI auth", () => { |
139 | | -readClaudeCliCredentialsForSetup.mockReturnValue({ type: "oauth" }); |
140 | | - |
141 | | -expect(hasClaudeCliAuth()).toBe(true); |
142 | | -}); |
143 | | - |
144 | | -it("uses the non-interactive Claude auth probe without keychain prompts", () => { |
145 | | -readClaudeCliCredentialsForSetup.mockReset(); |
146 | | -readClaudeCliCredentialsForSetupNonInteractive.mockReset(); |
147 | | -readClaudeCliCredentialsForSetup.mockReturnValue(null); |
148 | | -readClaudeCliCredentialsForSetupNonInteractive.mockReturnValue({ type: "oauth" }); |
149 | | - |
150 | | -expect(hasClaudeCliAuth({ allowKeychainPrompt: false })).toBe(true); |
151 | | -expect(readClaudeCliCredentialsForSetup).not.toHaveBeenCalled(); |
152 | | -expect(readClaudeCliCredentialsForSetupNonInteractive).toHaveBeenCalledTimes(1); |
153 | | -}); |
154 | | - |
155 | 138 | it("keeps anthropic defaults and selects the claude-cli runtime", () => { |
156 | 139 | const result = buildAnthropicCliMigrationResult({ |
157 | 140 | agents: { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -12,10 +12,7 @@ import {
|
12 | 12 | normalizeLowercaseStringOrEmpty, |
13 | 13 | } from "openclaw/plugin-sdk/string-coerce-runtime"; |
14 | 14 | import { resolveClaudeCliAnthropicModelRefs } from "./claude-model-refs.js"; |
15 | | -import { |
16 | | -readClaudeCliCredentialsForSetup, |
17 | | -readClaudeCliCredentialsForSetupNonInteractive, |
18 | | -} from "./cli-auth-seam.js"; |
| 15 | +import type { readClaudeCliCredentialsForSetup } from "./cli-auth-seam.js"; |
19 | 16 | import { CLAUDE_CLI_BACKEND_ID, CLAUDE_CLI_DEFAULT_ALLOWLIST_REFS } from "./cli-shared.js"; |
20 | 17 | |
21 | 18 | type AgentDefaultsModel = NonNullable<NonNullable<OpenClawConfig["agents"]>["defaults"]>["model"]; |
@@ -172,15 +169,6 @@ function modelEntryWithClaudeCliRuntime(entry: unknown): Record<string, unknown>
|
172 | 169 | return base; |
173 | 170 | } |
174 | 171 | |
175 | | -/** Return whether Claude CLI credentials are available for setup migration. */ |
176 | | -export function hasClaudeCliAuth(options?: { allowKeychainPrompt?: boolean }): boolean { |
177 | | -return Boolean( |
178 | | -options?.allowKeychainPrompt === false |
179 | | - ? readClaudeCliCredentialsForSetupNonInteractive() |
180 | | - : readClaudeCliCredentialsForSetup(), |
181 | | -); |
182 | | -} |
183 | | - |
184 | 172 | function buildClaudeCliAuthProfiles( |
185 | 173 | credential?: ClaudeCliCredential | null, |
186 | 174 | ): ProviderAuthResult["profiles"] { |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | // Discord provider module implements model/runtime integration. |
2 | 2 | import { warn, type RuntimeEnv } from "openclaw/plugin-sdk/runtime-env"; |
3 | 3 | import { formatErrorMessage } from "openclaw/plugin-sdk/ssrf-runtime"; |
4 | | -import { Client, overwriteApplicationCommands, type RequestClient } from "../internal/discord.js"; |
| 4 | +import { Client, type RequestClient } from "../internal/discord.js"; |
5 | 5 | import { |
6 | 6 | attachDiscordDeployRestContext, |
7 | 7 | attachDiscordDeployRequestBody, |
@@ -206,16 +206,3 @@ export function runDiscordCommandDeployInBackground(params: {
|
206 | 206 | ); |
207 | 207 | }); |
208 | 208 | } |
209 | | - |
210 | | -export async function clearDiscordNativeCommands(params: { |
211 | | -client: Client; |
212 | | -applicationId: string; |
213 | | -runtime: RuntimeEnv; |
214 | | -}) { |
215 | | -try { |
216 | | -await overwriteApplicationCommands(params.client.rest, params.applicationId, []); |
217 | | -params.runtime.log?.("discord: cleared native commands (commands.native=false)"); |
218 | | -} catch (err) { |
219 | | -params.runtime.error?.(`discord: failed to clear native commands: ${String(err)}`); |
220 | | -} |
221 | | -} |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -60,20 +60,6 @@ function resolveMemoryToolContext(options: MemoryToolOptions) {
|
60 | 60 | return { cfg, agentId }; |
61 | 61 | } |
62 | 62 | |
63 | | -export async function getMemoryManagerContext(params: { |
64 | | -cfg: OpenClawConfig; |
65 | | -agentId: string; |
66 | | -}): Promise< |
67 | | -| { |
68 | | -manager: NonNullable<MemorySearchManagerResult["manager"]>; |
69 | | -} |
70 | | -| { |
71 | | -error: string | undefined; |
72 | | -} |
73 | | -> { |
74 | | -return await getMemoryManagerContextWithPurpose({ ...params, purpose: undefined }); |
75 | | -} |
76 | | - |
77 | 63 | export async function getMemoryManagerContextWithPurpose(params: { |
78 | 64 | cfg: OpenClawConfig; |
79 | 65 | agentId: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -329,7 +329,3 @@ export function buildOpenRouterMusicGenerationProvider(): MusicGenerationProvide
|
329 | 329 | }, |
330 | 330 | }; |
331 | 331 | } |
332 | | - |
333 | | -export const openRouterMusicTestInternals = { |
334 | | - readOpenRouterAudioStream, |
335 | | -}; |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -470,9 +470,3 @@ async function resolveCanonicalCandidate(targetPath: string): Promise<string> {
|
470 | 470 | cursor = parent; |
471 | 471 | } |
472 | 472 | } |
473 | | - |
474 | | -export function setReadOpenFlagsResolverForTest( |
475 | | -_resolver: (() => { flags: number; supportsNoFollow: boolean }) | undefined, |
476 | | -): void { |
477 | | -// Retained for older OpenShell tests; pinned reads now delegate to fs-safe. |
478 | | -} |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。