@cydm/magic-shell-agent-node 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node.js +4 -0
- package/dist/workbench/runtime-control.js +18 -0
- package/package.json +1 -1
package/dist/node.js
CHANGED
|
@@ -642,6 +642,7 @@ export class AgentNode {
|
|
|
642
642
|
const displayName = this.readString(payload.displayName) || message.displayName;
|
|
643
643
|
const sessionId = this.readString(payload.sessionId) || message.target?.sessionId || generateSessionId();
|
|
644
644
|
try {
|
|
645
|
+
console.log(`[AgentNode] spawn_worker request session=${sessionId} plugin=${pluginName} cwd=${cwd || ""}`);
|
|
645
646
|
await this.spawnWorker({ sessionId, pluginName, cwd, displayName, taskSummary });
|
|
646
647
|
if (taskSummary) {
|
|
647
648
|
this.rememberNodeSpawn(taskSummary, sessionId);
|
|
@@ -654,8 +655,11 @@ export class AgentNode {
|
|
|
654
655
|
});
|
|
655
656
|
}
|
|
656
657
|
catch (err) {
|
|
658
|
+
console.error(`[AgentNode] spawn_worker failed session=${sessionId} plugin=${pluginName}:`, err);
|
|
657
659
|
this.sendControlResult(source, message.requestId, name, false, {
|
|
658
660
|
error: err instanceof Error ? err.message : String(err),
|
|
661
|
+
sessionId,
|
|
662
|
+
pluginName,
|
|
659
663
|
});
|
|
660
664
|
}
|
|
661
665
|
return;
|
|
@@ -134,6 +134,24 @@
|
|
|
134
134
|
return true;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
+
if (msg.controlKind === "result" && msg.controlName === "spawn_worker") {
|
|
138
|
+
if (msg.ok === false) {
|
|
139
|
+
const requestedSessionId = msg.payload?.sessionId || msg.sessionId || ctx.pendingSpawnSessionId;
|
|
140
|
+
if (!requestedSessionId || requestedSessionId === ctx.pendingSpawnSessionId) {
|
|
141
|
+
ctx.pendingSpawnSessionId = null;
|
|
142
|
+
ctx.pendingSpawnAutoAttach = true;
|
|
143
|
+
ctx.resetSpawnButton();
|
|
144
|
+
}
|
|
145
|
+
ctx.writeSystemNotice(`WORKER SPAWN FAILED: ${msg.error || msg.payload?.error || "Unknown error"}`);
|
|
146
|
+
if (ctx.sessionId && ctx.sessionId === requestedSessionId) {
|
|
147
|
+
ctx.returnToPrimaryChat({ clearSession: true });
|
|
148
|
+
}
|
|
149
|
+
ctx.renderWorkers();
|
|
150
|
+
return true;
|
|
151
|
+
}
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
|
|
137
155
|
if (msg.controlKind === "result" && msg.controlName === "get_worker_detail" && msg.payload && msg.payload.worker) {
|
|
138
156
|
ctx.workerDetail = msg.payload.worker || null;
|
|
139
157
|
ctx.renderWorkerDetailPanel();
|