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 <noreply@anthropic.com>
This commit is contained in:
parent
6f6a4f82e4
commit
864d9166fc
1 changed files with 2 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue