mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-18 16:27:26 +00:00
fix: align tool definition adapter
This commit is contained in:
@@ -101,10 +101,10 @@ const _readSessionMessages = async (sessionFile: string) => {
|
||||
describe("createSystemPromptOverride", () => {
|
||||
it("returns the override prompt trimmed", () => {
|
||||
const override = createSystemPromptOverride("OVERRIDE");
|
||||
expect(override).toBe("OVERRIDE");
|
||||
expect(override()).toBe("OVERRIDE");
|
||||
});
|
||||
it("returns an empty string for blank overrides", () => {
|
||||
const override = createSystemPromptOverride(" \n ");
|
||||
expect(override).toBe("");
|
||||
expect(override()).toBe("");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -40,9 +40,9 @@ export function toToolDefinitions(tools: AnyAgentTool[]): ToolDefinition[] {
|
||||
execute: async (
|
||||
toolCallId,
|
||||
params,
|
||||
signal: AbortSignal | undefined,
|
||||
onUpdate: AgentToolUpdateCallback<unknown> | undefined,
|
||||
_ctx,
|
||||
signal?: AbortSignal,
|
||||
): Promise<AgentToolResult<unknown>> => {
|
||||
try {
|
||||
return await tool.execute(toolCallId, params, signal, onUpdate);
|
||||
@@ -91,9 +91,9 @@ export function toClientToolDefinitions(
|
||||
execute: async (
|
||||
toolCallId,
|
||||
params,
|
||||
_signal: AbortSignal | undefined,
|
||||
_onUpdate: AgentToolUpdateCallback<unknown> | undefined,
|
||||
_ctx,
|
||||
_signal?: AbortSignal,
|
||||
): Promise<AgentToolResult<unknown>> => {
|
||||
const outcome = await runBeforeToolCallHook({
|
||||
toolName: func.name,
|
||||
|
||||
Reference in New Issue
Block a user