From 0eb84f5133a8386b64042544d329dcc51021ef21 Mon Sep 17 00:00:00 2001 From: Abhi <43648792+abhipatel12@users.noreply.github.com> Date: Tue, 30 Dec 2025 16:43:33 -0500 Subject: [PATCH] chore: remove cot style comments (#15735) --- integration-tests/hooks-agent-flow.test.ts | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/integration-tests/hooks-agent-flow.test.ts b/integration-tests/hooks-agent-flow.test.ts index 5c2239f735..45dbb4b0e3 100644 --- a/integration-tests/hooks-agent-flow.test.ts +++ b/integration-tests/hooks-agent-flow.test.ts @@ -107,19 +107,6 @@ describe('Hooks Agent Flow', () => { const input = fs.readFileSync(0, 'utf-8'); console.error('DEBUG: AfterAgent hook input received'); process.stdout.write("Received Input: " + input); - // Ensure separation between the echo and the JSON output if they were to run together (though relying on separate console calls usually separates by newline) - // usage of process.stdout.write does NOT add newline. - // But here we want strictly the output "Received Input..." to be present. - // We also need to output the JSON decision for the hook runner to consider it successful? - // Actually HookRunner parses the *last* valid JSON block or treats text as system message. - // If we output mixed text and JSON, HookRunner might get confused if we don't handle it right. - // Existing test expects "Received Input" in stdout. And "Hello World". - // It DOES NOT parse the decision? - // Wait, HookRunner logic: - // "if (exitCode === EXIT_CODE_SUCCESS && stdout.trim()) ... JSON.parse ..." - // If JSON.parse fails: "Not JSON, convert plain text to structured output" - // So if we output formatted text, it becomes "systemMessage". - // That is fine for this test as we don't check the decision, just the stdout content. } catch (err) { console.error('Hook Failed:', err); process.exit(1); @@ -161,7 +148,8 @@ describe('Hooks Agent Flow', () => { ); expect(afterAgentLog).toBeDefined(); - // Verify the hook stdout contains the input we echoed which proves the hook received the prompt and response + // Verify the hook stdout contains the input we echoed which proves the + // hook received the prompt and response expect(afterAgentLog?.hookCall.stdout).toContain('Received Input'); expect(afterAgentLog?.hookCall.stdout).toContain('Hello validation'); // The fake response contains "Hello World" @@ -220,16 +208,10 @@ describe('Hooks Agent Flow', () => { (log) => log.hookCall.hook_event_name === 'AfterAgent', ); - // Should ensure BeforeAgent fired once expect(beforeAgentLogs).toHaveLength(1); - // Should ensure AfterAgent fired once - // Note: If the tool call itself triggered BeforeTool/AfterTool, that's fine, - // but BeforeAgent/AfterAgent should only wrap the *entire* turn (User Request -> Final Answer). expect(afterAgentLogs).toHaveLength(1); - // Verify the output log content to ensure we actually got the final answer - // (This implies the loop completed successfully) const afterAgentLog = afterAgentLogs[0]; expect(afterAgentLog).toBeDefined(); expect(afterAgentLog?.hookCall.stdout).toContain('AfterAgent Fired');