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:
YeonGyu-Kim 2026-02-13 18:52:18 +09:00 committed by GitHub
commit f876d60e87
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View File

@ -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) {

View File

@ -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) =>