mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-19 00:34:46 +00:00
fix(qa): expose codex tools for runtime parity
This commit is contained in:
@@ -346,6 +346,7 @@ export function createOpenClawTools(
|
||||
!embedded ||
|
||||
options?.sourceReplyDeliveryMode === "message_tool_only" ||
|
||||
messageExplicitlyAllowed;
|
||||
const includeSubagentSpawnTool = !embedded || options?.allowGatewaySubagentBinding === true;
|
||||
const effectiveCallGateway = embedded
|
||||
? createEmbeddedCallGateway()
|
||||
: openClawToolsDeps.callGateway;
|
||||
@@ -424,6 +425,9 @@ export function createOpenClawTools(
|
||||
config: resolvedConfig,
|
||||
callGateway: openClawToolsDeps.callGateway,
|
||||
}),
|
||||
]),
|
||||
...(includeSubagentSpawnTool
|
||||
? [
|
||||
createSessionsSpawnTool({
|
||||
agentSessionKey: options?.agentSessionKey,
|
||||
agentChannel: options?.agentChannel,
|
||||
@@ -441,7 +445,8 @@ export function createOpenClawTools(
|
||||
inheritedToolAllowlist: options?.inheritedToolAllowlist,
|
||||
inheritedToolDenylist: options?.inheritedToolDenylist,
|
||||
}),
|
||||
]),
|
||||
]
|
||||
: []),
|
||||
createSessionsYieldTool({
|
||||
sessionId: options?.sessionId,
|
||||
onYield: options?.onYield,
|
||||
|
||||
@@ -123,6 +123,24 @@ describe("openclaw-tools update_plan gating", () => {
|
||||
expect(toolNames(denied)).not.toContain("message");
|
||||
});
|
||||
|
||||
it("keeps subagent spawn available for trusted embedded gateway-bound runs", () => {
|
||||
setEmbeddedMode(true);
|
||||
const defaultTools = createOpenClawTools({
|
||||
config: {} as OpenClawConfig,
|
||||
disablePluginTools: true,
|
||||
});
|
||||
const gatewayBoundTools = createOpenClawTools({
|
||||
config: {} as OpenClawConfig,
|
||||
disablePluginTools: true,
|
||||
allowGatewaySubagentBinding: true,
|
||||
});
|
||||
|
||||
expect(toolNames(defaultTools)).not.toContain("sessions_spawn");
|
||||
expect(toolNames(defaultTools)).not.toContain("sessions_send");
|
||||
expect(toolNames(gatewayBoundTools)).toContain("sessions_spawn");
|
||||
expect(toolNames(gatewayBoundTools)).not.toContain("sessions_send");
|
||||
});
|
||||
|
||||
it("registers update_plan when explicitly enabled", () => {
|
||||
const config = {
|
||||
tools: {
|
||||
|
||||
Reference in New Issue
Block a user