mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-26 12:35:35 +02:00
fix(agent): pass sessionId to tools for sub-agent session tracking
toolsOptions spread `options` which had sessionId undefined for auto-generated sessions. This caused sessions_list and sessions_spawn to fail with "No session ID available" — breaking sub-agent orchestration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -393,9 +393,12 @@ export class Agent {
|
||||
const profileToolsConfig = this.profile?.getToolsConfig();
|
||||
const mergedToolsConfig = mergeToolsConfig(profileToolsConfig, options.tools);
|
||||
const profileDir = this.profile?.getProfileDir();
|
||||
// Use this.sessionId (which may be auto-generated) instead of options.sessionId
|
||||
// (which may be undefined). Without this, sessions_list and sessions_spawn
|
||||
// can't find sub-agent runs because they have no session context.
|
||||
this.toolsOptions = mergedToolsConfig
|
||||
? { ...options, cwd: effectiveCwd, tools: mergedToolsConfig, profileDir, provider: this.resolvedProvider }
|
||||
: { ...options, cwd: effectiveCwd, profileDir, provider: this.resolvedProvider };
|
||||
? { ...options, sessionId: this.sessionId, cwd: effectiveCwd, tools: mergedToolsConfig, profileDir, provider: this.resolvedProvider }
|
||||
: { ...options, sessionId: this.sessionId, cwd: effectiveCwd, profileDir, provider: this.resolvedProvider };
|
||||
|
||||
const tools = resolveTools(this.toolsOptions);
|
||||
if (this.debug) {
|
||||
|
||||
Reference in New Issue
Block a user