mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-07 16:09:43 +02:00
ui: improve subagent window titles and readability
- Extract better titles from task description (first line/sentence) - Make subagent window text white for better readability - Expand monitor panel to 700px when subagents tab is active - Add smooth width transition when switching tabs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1635,6 +1635,21 @@ export class WebServer extends EventEmitter {
|
||||
return { success: true, data: transcript };
|
||||
});
|
||||
|
||||
// Kill a subagent
|
||||
this.app.delete('/api/subagents/:agentId', async (req) => {
|
||||
const { agentId } = req.params as { agentId: string };
|
||||
const info = subagentWatcher.getSubagent(agentId);
|
||||
if (!info) {
|
||||
return createErrorResponse(ApiErrorCode.NOT_FOUND, 'Subagent not found');
|
||||
}
|
||||
|
||||
const killed = await subagentWatcher.killSubagent(agentId);
|
||||
if (killed) {
|
||||
return { success: true, data: { agentId, status: 'killed' } };
|
||||
}
|
||||
return createErrorResponse(ApiErrorCode.OPERATION_FAILED, 'Subagent not found or already completed');
|
||||
});
|
||||
|
||||
// ========== Hook Events ==========
|
||||
|
||||
this.app.post('/api/hook-event', async (req) => {
|
||||
@@ -1767,6 +1782,15 @@ export class WebServer extends EventEmitter {
|
||||
private async _doCleanupSession(sessionId: string, killScreen: boolean): Promise<void> {
|
||||
const session = this.sessions.get(sessionId);
|
||||
|
||||
// Kill all subagents spawned by this session
|
||||
if (session && killScreen) {
|
||||
try {
|
||||
await subagentWatcher.killSubagentsForSession(session.workingDir);
|
||||
} catch (err) {
|
||||
console.error(`[Server] Failed to kill subagents for session ${sessionId}:`, err);
|
||||
}
|
||||
}
|
||||
|
||||
// Stop and remove respawn controller - but save config first for restart recovery
|
||||
const controller = this.respawnControllers.get(sessionId);
|
||||
if (controller) {
|
||||
|
||||
Reference in New Issue
Block a user