Update files
This commit is contained in:
@@ -395,6 +395,12 @@ export class AgentManager {
|
|||||||
this.emitState(agent);
|
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> {
|
async clearAgentAttention(agentId: string): Promise<void> {
|
||||||
const agent = this.requireAgent(agentId);
|
const agent = this.requireAgent(agentId);
|
||||||
if (agent.attention.requiresAttention) {
|
if (agent.attention.requiresAttention) {
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ function createTestDeps(): TestDeps {
|
|||||||
waitForAgentEvent: vi.fn(),
|
waitForAgentEvent: vi.fn(),
|
||||||
recordUserMessage: vi.fn(),
|
recordUserMessage: vi.fn(),
|
||||||
setAgentMode: vi.fn(),
|
setAgentMode: vi.fn(),
|
||||||
|
setTitle: vi.fn().mockResolvedValue(undefined),
|
||||||
getAgent: vi.fn(),
|
getAgent: vi.fn(),
|
||||||
streamAgent: vi.fn(() => (async function* noop() {})()),
|
streamAgent: vi.fn(() => (async function* noop() {})()),
|
||||||
respondToPermission: vi.fn(),
|
respondToPermission: vi.fn(),
|
||||||
@@ -118,7 +119,7 @@ describe("create_agent MCP tool", () => {
|
|||||||
|
|
||||||
await tool.callback({ title: " Fix auth " });
|
await tool.callback({ title: " Fix auth " });
|
||||||
|
|
||||||
expect(spies.agentRegistry.setTitle).toHaveBeenCalledWith(
|
expect(spies.agentManager.setTitle).toHaveBeenCalledWith(
|
||||||
"agent-1",
|
"agent-1",
|
||||||
"Fix auth"
|
"Fix auth"
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -938,7 +938,7 @@ export async function createAgentMcpServer(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
await agentRegistry.setTitle(agent.id, normalizedTitle);
|
await agentManager.setTitle(agent.id, normalizedTitle);
|
||||||
return {
|
return {
|
||||||
content: [],
|
content: [],
|
||||||
structuredContent: ensureValidJson({
|
structuredContent: ensureValidJson({
|
||||||
|
|||||||
Reference in New Issue
Block a user