fix(ws): set agent context for skills/tools (#1471)

This commit is contained in:
Christina Tong
2026-03-20 11:12:13 -07:00
committed by GitHub
parent e77b282c93
commit f6b40792a9

View File

@@ -9,6 +9,7 @@ import type { ApprovalResult } from "../../agent/approval-execution";
import { fetchRunErrorDetail } from "../../agent/approval-recovery";
import { getResumeData } from "../../agent/check-approval";
import { getClient } from "../../agent/client";
import { setConversationId, setCurrentAgentId } from "../../agent/context";
import {
getStreamToolContextId,
type sendMessageStream,
@@ -152,6 +153,10 @@ export async function handleIncomingMessage(
return;
}
// Set agent context for tools that need it (e.g., Skill tool)
setCurrentAgentId(agentId);
setConversationId(conversationId);
if (isDebugEnabled()) {
console.log(
`[Listen] Handling message: agentId=${agentId}, requestedConversationId=${requestedConversationId}, conversationId=${conversationId}`,