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)