Update files

This commit is contained in:
Mohamed Boudra
2026-01-23 13:41:33 +07:00
parent f0cafb4607
commit 912a694221
3 changed files with 9 additions and 2 deletions
@@ -395,6 +395,12 @@ export class AgentManager {
this.emitState(agent);
}
async setTitle(agentId: string, title: string): Promise<void> {
const agent = this.requireAgent(agentId);
await this.registry?.setTitle(agentId, title);
this.emitState(agent);
}
async clearAgentAttention(agentId: string): Promise<void> {
const agent = this.requireAgent(agentId);
if (agent.attention.requiresAttention) {
@@ -20,6 +20,7 @@ function createTestDeps(): TestDeps {
waitForAgentEvent: vi.fn(),
recordUserMessage: vi.fn(),
setAgentMode: vi.fn(),
setTitle: vi.fn().mockResolvedValue(undefined),
getAgent: vi.fn(),
streamAgent: vi.fn(() => (async function* noop() {})()),
respondToPermission: vi.fn(),
@@ -118,7 +119,7 @@ describe("create_agent MCP tool", () => {
await tool.callback({ title: " Fix auth " });
expect(spies.agentRegistry.setTitle).toHaveBeenCalledWith(
expect(spies.agentManager.setTitle).toHaveBeenCalledWith(
"agent-1",
"Fix auth"
);
@@ -938,7 +938,7 @@ export async function createAgentMcpServer(
);
}
await agentRegistry.setTitle(agent.id, normalizedTitle);
await agentManager.setTitle(agent.id, normalizedTitle);
return {
content: [],
structuredContent: ensureValidJson({