feat(KB-123): add agent role tracking and expanded logging to agent system
- Extend AgentLogEntry with agent field and new event types (thinking, tool_end) - Expand AgentLogger with thinking, tool_end callbacks and agent role support - Wire new logging callbacks in createKbAgent and all agent call-sites (executor, merger, reviewer, triage, pi) - Update AgentLogViewer with agent role badges and rendering for new entry types - Export AgentRole and AgentLogType from core package and add tests for new functionality
This commit is contained in:
@@ -528,7 +528,7 @@ describe("TriageProcessor agent log persistence", () => {
|
||||
});
|
||||
|
||||
// Text buffer is flushed in finally block
|
||||
expect(store.appendAgentLog).toHaveBeenCalledWith("KB-001", "Hello world", "text");
|
||||
expect(store.appendAgentLog).toHaveBeenCalledWith("KB-001", "Hello world", "text", undefined, "triage");
|
||||
});
|
||||
|
||||
it("logs tool invocations to store.appendAgentLog", async () => {
|
||||
@@ -561,7 +561,7 @@ describe("TriageProcessor agent log persistence", () => {
|
||||
updatedAt: new Date().toISOString(),
|
||||
});
|
||||
|
||||
expect(store.appendAgentLog).toHaveBeenCalledWith("KB-001", "Read", "tool", "foo.ts");
|
||||
expect(store.appendAgentLog).toHaveBeenCalledWith("KB-001", "Read", "tool", "foo.ts", "triage");
|
||||
});
|
||||
|
||||
it("still fires onAgentText callback alongside logging", async () => {
|
||||
@@ -596,6 +596,6 @@ describe("TriageProcessor agent log persistence", () => {
|
||||
});
|
||||
|
||||
expect(onAgentText).toHaveBeenCalledWith("KB-001", "hi");
|
||||
expect(store.appendAgentLog).toHaveBeenCalledWith("KB-001", "hi", "text");
|
||||
expect(store.appendAgentLog).toHaveBeenCalledWith("KB-001", "hi", "text", undefined, "triage");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user