fix: make agent metadata title/branch application reliable (#81)

This commit is contained in:
Mohamed Boudra
2026-02-24 18:15:31 +07:00
committed by GitHub
parent 0832b12608
commit 094ce49d4f
6 changed files with 148 additions and 1 deletions
@@ -859,7 +859,12 @@ export class AgentManager {
async setTitle(agentId: string, title: string): Promise<void> {
const agent = this.requireAgent(agentId);
await this.registry?.setTitle(agentId, title);
const normalizedTitle = title.trim();
if (!normalizedTitle) {
return;
}
this.touchUpdatedAt(agent);
await this.persistSnapshot(agent, { title: normalizedTitle });
this.emitState(agent);
}
@@ -878,6 +883,7 @@ export class AgentManager {
if (!agent || agent.internal) {
return;
}
this.touchUpdatedAt(agent);
this.emitState(agent);
}