@@ -5,6 +5,7 @@ import path from "node:path";
55import type { AgentToolResult } from "openclaw/plugin-sdk/agent-core" ;
66import type { AnyAgentTool } from "openclaw/plugin-sdk/agent-harness" ;
77import {
8+ type EmbeddedRunAttemptParamsV2 as EmbeddedRunAttemptParams ,
89 HEARTBEAT_RESPONSE_TOOL_NAME ,
910 embeddedAgentLog ,
1011 getPluginToolMeta ,
@@ -51,6 +52,7 @@ import {
5152 type JsonValue ,
5253} from "./protocol.js" ;
5354import type { CodexRemoteWorkspaceFileReader } from "./remote-workspace-media.js" ;
55+ import { resolveCodexDynamicToolDirectNames } from "./run-attempt-tools.js" ;
5456import { codexDynamicToolsFingerprint } from "./thread-fingerprints.js" ;
5557
5658const CODEX_OPENCLAW_DYNAMIC_TOOL_NAMESPACE = "openclaw" ;
@@ -763,6 +765,25 @@ describe("createCodexDynamicToolBridge", () => {
763765 expectNoNamespace ( specs . find ( ( tool ) => tool . name === "message" ) ) ;
764766 } ) ;
765767
768+ it ( "keeps progress_card direct when searchable loading defers broad tools" , ( ) => {
769+ const bridge = createCodexDynamicToolBridge ( {
770+ tools : [ createTool ( { name : "progress_card" } ) , createTool ( { name : "web_search" } ) ] ,
771+ signal : new AbortController ( ) . signal ,
772+ loading : "searchable" ,
773+ directToolNames : resolveCodexDynamicToolDirectNames ( { } as EmbeddedRunAttemptParams ) ,
774+ } ) ;
775+
776+ const specs = flattenSpecsWithNamespace ( bridge . specs ) ;
777+ const progressCard = specs . find ( ( tool ) => tool . name === "progress_card" ) ;
778+ const webSearch = specs . find ( ( tool ) => tool . name === "web_search" ) ;
779+ expectNoNamespace ( progressCard ) ;
780+ expectDynamicSpec ( webSearch , {
781+ name : "web_search" ,
782+ namespace : CODEX_OPENCLAW_DYNAMIC_TOOL_NAMESPACE ,
783+ deferLoading : true ,
784+ } ) ;
785+ } ) ;
786+
766787 it ( "isolates direct-only tools in Codex's model-only namespace" , ( ) => {
767788 const bridge = createCodexDynamicToolBridge ( {
768789 tools : [
0 commit comments