Merge pull request #1750 from ojh102/fix/guard-non-string-tool-output
fix(hooks): guard against non-string tool output in afterToolResult hooks
This commit is contained in:
@@ -10,6 +10,7 @@ export function createDelegateTaskRetryHook(_ctx: PluginInput) {
|
||||
output: { title: string; output: string; metadata: unknown }
|
||||
) => {
|
||||
if (input.tool.toLowerCase() !== "task") return
|
||||
if (typeof output.output !== "string") return
|
||||
|
||||
const errorInfo = detectDelegateTaskError(output.output)
|
||||
if (errorInfo) {
|
||||
|
||||
@@ -43,6 +43,7 @@ export function createEditErrorRecoveryHook(_ctx: PluginInput) {
|
||||
output: { title: string; output: string; metadata: unknown }
|
||||
) => {
|
||||
if (input.tool.toLowerCase() !== "edit") return
|
||||
if (typeof output.output !== "string") return
|
||||
|
||||
const outputLower = (output.output ?? "").toLowerCase()
|
||||
const hasEditError = EDIT_ERROR_PATTERNS.some((pattern) =>
|
||||
|
||||
Reference in New Issue
Block a user