Add session export to HTML, improve tool error handling, and enhance RPC mode documentation

This commit is contained in:
Mario Zechner 2025-11-12 21:55:10 +01:00
parent 68092ccf01
commit 9e3e319f1a
9 changed files with 638 additions and 63 deletions

View file

@ -163,10 +163,7 @@ export const editTool: AgentTool<typeof editSchema> = {
if (signal) {
signal.removeEventListener("abort", onAbort);
}
resolve({
content: [{ type: "text", text: `Error: File not found: ${path}` }],
details: undefined,
});
reject(new Error(`File not found: ${path}`));
return;
}
@ -188,15 +185,11 @@ export const editTool: AgentTool<typeof editSchema> = {
if (signal) {
signal.removeEventListener("abort", onAbort);
}
resolve({
content: [
{
type: "text",
text: `Error: Could not find the exact text in ${path}. The old text must match exactly including all whitespace and newlines.`,
},
],
details: undefined,
});
reject(
new Error(
`Could not find the exact text in ${path}. The old text must match exactly including all whitespace and newlines.`,
),
);
return;
}
@ -207,15 +200,11 @@ export const editTool: AgentTool<typeof editSchema> = {
if (signal) {
signal.removeEventListener("abort", onAbort);
}
resolve({
content: [
{
type: "text",
text: `Error: Found ${occurrences} occurrences of the text in ${path}. The text must be unique. Please provide more context to make it unique.`,
},
],
details: undefined,
});
reject(
new Error(
`Found ${occurrences} occurrences of the text in ${path}. The text must be unique. Please provide more context to make it unique.`,
),
);
return;
}