Merge pull request #3801 from code-yeongyu/fix/directory-agents-non-string-output
fix(directory-agents-injector): guard against non-string output.output (#3800)
This commit is contained in:
@@ -26,6 +26,10 @@ export async function processFilePathForAgentsInjection(input: {
|
|||||||
sessionID: string;
|
sessionID: string;
|
||||||
output: { title: string; output: string; metadata: unknown };
|
output: { title: string; output: string; metadata: unknown };
|
||||||
}): Promise<void> {
|
}): Promise<void> {
|
||||||
|
// Guard: output.output may be non-string at runtime (e.g. MCP bridge format changes).
|
||||||
|
// Consistent with the pattern used in tool-output-truncator and other hooks.
|
||||||
|
if (typeof input.output.output !== "string") return;
|
||||||
|
|
||||||
const resolved = resolveFilePath(input.ctx.directory, input.filePath);
|
const resolved = resolveFilePath(input.ctx.directory, input.filePath);
|
||||||
if (!resolved) return;
|
if (!resolved) return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user