From 864d9166fcaf048a84d10d2b7a11a8f20d136be6 Mon Sep 17 00:00:00 2001 From: Jiang Bohan Date: Tue, 3 Feb 2026 18:25:48 +0800 Subject: [PATCH] feat(hub): support profileId in createAgent - Add profileId option to createAgent() method - Default to "default" profile for all agents - Ensures every agent has an associated profile for memory and config Co-Authored-By: Claude Opus 4.5 --- src/hub/hub.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hub/hub.ts b/src/hub/hub.ts index 3d1eae3b..7ca033f2 100644 --- a/src/hub/hub.ts +++ b/src/hub/hub.ts @@ -128,7 +128,7 @@ export class Hub { } /** Create new Agent, or rebuild with existing ID */ - createAgent(id?: string, options?: { persist?: boolean }): AsyncAgent { + createAgent(id?: string, options?: { persist?: boolean; profileId?: string }): AsyncAgent { if (id) { const existing = this.agents.get(id); if (existing && !existing.closed) { @@ -136,7 +136,7 @@ export class Hub { } } - const agent = new AsyncAgent({ sessionId: id }); + const agent = new AsyncAgent({ sessionId: id, profileId: options?.profileId ?? "default" }); this.agents.set(agent.sessionId, agent); // Persist to agent store (skip during restore to avoid duplicates)