chore: remove stale dead code · openclaw/openclaw@444562b
steipete
·
2026-05-31
·
via Recent Commits to openclaw:main
File tree
channels/plugins/contracts/test-helpers
| Original file line number | Diff line number | Diff line change |
|---|
@@ -549,16 +549,15 @@ function appendCodexAcpConfigOverrides(command: string, override: CodexAcpModelO
|
549 | 549 | function createModelScopedAgentRegistry(params: { |
550 | 550 | agentRegistry: AcpAgentRegistry; |
551 | 551 | scope: AsyncLocalStorage<CodexAcpModelOverride | undefined>; |
552 | | -leaseCommand: (command: string | undefined) => string | undefined; |
| 552 | +leaseCommand: (command: string) => string; |
553 | 553 | }): AcpAgentRegistry { |
554 | 554 | return { |
555 | | -resolve(agentName: string): string | undefined { |
| 555 | +resolve(agentName: string): string { |
556 | 556 | const command = params.agentRegistry.resolve(agentName); |
557 | 557 | const override = params.scope.getStore(); |
558 | 558 | if ( |
559 | 559 | !override || |
560 | 560 | normalizeAgentName(agentName) !== CODEX_ACP_AGENT_ID || |
561 | | -typeof command !== "string" || |
562 | 561 | !isCodexAcpCommand(command) |
563 | 562 | ) { |
564 | 563 | return params.leaseCommand(command); |
@@ -700,9 +699,9 @@ export class AcpxRuntime implements AcpRuntime {
|
700 | 699 | }); |
701 | 700 | } |
702 | 701 | |
703 | | -private commandWithLaunchLease(command: string | undefined): string | undefined { |
| 702 | +private commandWithLaunchLease(command: string): string { |
704 | 703 | const launch = this.launchLeaseScope.getStore(); |
705 | | -if (!command || !launch) { |
| 704 | +if (!launch) { |
706 | 705 | return command; |
707 | 706 | } |
708 | 707 | launch.stableCommand = command; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -44,4 +44,3 @@ export const testing = {
|
44 | 44 | }); |
45 | 45 | }, |
46 | 46 | }; |
47 | | -export { testing as __testing }; |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -8,7 +8,7 @@ export { normalizeXaiModelId as normalizeNativeXaiModelId } from "./model-id.js"
|
8 | 8 | export const XAI_TOOL_SCHEMA_PROFILE = "xai"; |
9 | 9 | export const HTML_ENTITY_TOOL_CALL_ARGUMENTS_ENCODING = "html-entities"; |
10 | 10 | |
11 | | -export const XAI_UNSUPPORTED_SCHEMA_KEYWORDS = new Set([ |
| 11 | +const XAI_UNSUPPORTED_SCHEMA_KEYWORDS = new Set([ |
12 | 12 | "minLength", |
13 | 13 | "maxLength", |
14 | 14 | "minItems", |
@@ -17,7 +17,7 @@ export const XAI_UNSUPPORTED_SCHEMA_KEYWORDS = new Set([
|
17 | 17 | "maxContains", |
18 | 18 | ]); |
19 | 19 | |
20 | | -export function resolveXaiModelCompatPatch(): ModelCompatConfig { |
| 20 | +function resolveXaiModelCompatPatch(): ModelCompatConfig { |
21 | 21 | return { |
22 | 22 | toolSchemaProfile: XAI_TOOL_SCHEMA_PROFILE, |
23 | 23 | unsupportedToolSchemaKeywords: Array.from(XAI_UNSUPPORTED_SCHEMA_KEYWORDS), |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4,7 +4,6 @@ import { pickSandboxToolPolicy } from "./sandbox-tool-policy.js";
|
4 | 4 | import { isToolAllowed, resolveSandboxToolPolicyForAgent } from "./sandbox/tool-policy.js"; |
5 | 5 | import type { SandboxToolPolicy } from "./sandbox/types.js"; |
6 | 6 | import { isToolAllowedByPolicyName } from "./tool-policy-match.js"; |
7 | | -import { TOOL_POLICY_CONFORMANCE } from "./tool-policy.conformance.js"; |
8 | 7 | import { |
9 | 8 | collectExplicitAllowlist, |
10 | 9 | DEFAULT_PLUGIN_TOOLS_ALLOWLIST_ENTRY, |
@@ -78,17 +77,6 @@ describe("tool-policy", () => {
|
78 | 77 | }); |
79 | 78 | }); |
80 | 79 | |
81 | | -describe("TOOL_POLICY_CONFORMANCE", () => { |
82 | | -it("matches exported TOOL_GROUPS exactly", () => { |
83 | | -expect(TOOL_POLICY_CONFORMANCE.toolGroups).toEqual(TOOL_GROUPS); |
84 | | -}); |
85 | | - |
86 | | -it("is JSON-serializable", () => { |
87 | | -const serialized = JSON.stringify(TOOL_POLICY_CONFORMANCE); |
88 | | -expect(JSON.parse(serialized)).toEqual({ toolGroups: TOOL_GROUPS }); |
89 | | -}); |
90 | | -}); |
91 | | - |
92 | 80 | describe("sandbox tool policy", () => { |
93 | 81 | it("allows all tools with * allow", () => { |
94 | 82 | const policy: SandboxToolPolicy = { allow: ["*"], deny: [] }; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。