mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-07 07:59:42 +02:00
ui: improve respawn controller layout and filter action log noise
- Stack timers row vertically (timers on top, action log below) - Reduce action log height to 60px since it's now full width - Filter action log to show only important entries: - Commands sent to console - Plan-check with action taken - Step completions - Skip timer starts/cancels, detection updates, ai-check status Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -227,6 +227,7 @@ export class SpawnOrchestrator extends EventEmitter {
|
||||
|
||||
/**
|
||||
* Cancel an agent by ID.
|
||||
* Cascades cancellation to all child agents before cleaning up the parent.
|
||||
*/
|
||||
async cancelAgent(agentId: string, reason: string = 'Cancelled by parent'): Promise<void> {
|
||||
const agent = this._agents.get(agentId);
|
||||
@@ -241,6 +242,28 @@ export class SpawnOrchestrator extends EventEmitter {
|
||||
return;
|
||||
}
|
||||
|
||||
// Cancel all child agents first (cascade)
|
||||
// Child agents have their parentSessionId set to this agent's sessionId
|
||||
if (agent.sessionId) {
|
||||
for (const [childId, childAgent] of this._agents) {
|
||||
if (childAgent.parentSessionId === agent.sessionId && childAgent.status !== 'cancelled') {
|
||||
await this.cancelAgent(childId, `Parent ${agentId} cancelled`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Also remove any queued tasks that depend on this agent's session
|
||||
if (agent.sessionId) {
|
||||
const queuedChildren = this._queue.filter(t => t.parentSessionId === agent.sessionId);
|
||||
for (const task of queuedChildren) {
|
||||
const idx = this._queue.indexOf(task);
|
||||
if (idx >= 0) {
|
||||
this._queue.splice(idx, 1);
|
||||
this.emit('cancelled', { agentId: task.spec.agentId, reason: `Parent ${agentId} cancelled` });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
agent.status = 'cancelled';
|
||||
this.emit('cancelled', { agentId, reason });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user