mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-06 23:49:41 +02:00
fix: subagent windows not opening — two cascading bugs
1. handleInit crash: commit cdc822d removed Map initializations for
teammateTerminals, teammatePanesByName, teams, teamTasks, teammateMap
from the constructor but left cleanup code that iterates them.
cleanupAllFloatingWindows() crashed on "not iterable", preventing
ALL frontend data (sessions, subagents) from loading.
2. claudeSessionId null on recovered sessions: only set inside
startInteractive(), never in constructor or persisted. After server
restart, recovered sessions had null claudeSessionId, so the
hasMatchingTab check always failed → no subagent windows.
Fixes:
- Re-add all 5 missing Map initializations in app.js constructor
- Set _claudeSessionId = this.id in Session constructor (Claudeman
always passes --session-id to Claude, so they always match)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -23,7 +23,7 @@ class MockSession extends EventEmitter {
|
||||
this.writeBuffer.push(data);
|
||||
}
|
||||
|
||||
writeViaScreen(data: string): boolean {
|
||||
async writeViaScreen(data: string): Promise<boolean> {
|
||||
this.writeBuffer.push(data);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ export class MockSession extends EventEmitter {
|
||||
}
|
||||
|
||||
/** Write via screen (used by respawn controller) */
|
||||
writeViaScreen(data: string): boolean {
|
||||
async writeViaScreen(data: string): Promise<boolean> {
|
||||
this.writeBuffer.push(data);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -120,17 +120,17 @@ describe('TmuxManager (unit)', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should return true for registered session (no-op in test mode)', () => {
|
||||
expect(manager.sendInput('test-id', '/clear\r')).toBe(true);
|
||||
it('should return true for registered session (no-op in test mode)', async () => {
|
||||
expect(await manager.sendInput('test-id', '/clear\r')).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false for unknown session', () => {
|
||||
expect(manager.sendInput('nonexistent', 'hello\r')).toBe(false);
|
||||
it('should return false for unknown session', async () => {
|
||||
expect(await manager.sendInput('nonexistent', 'hello\r')).toBe(false);
|
||||
});
|
||||
|
||||
it('should not call any tmux commands in test mode', () => {
|
||||
it('should not call any tmux commands in test mode', async () => {
|
||||
mockedExecSync.mockClear();
|
||||
manager.sendInput('test-id', 'hello\r');
|
||||
await manager.sendInput('test-id', 'hello\r');
|
||||
const sendKeyCalls = mockedExecSync.mock.calls.filter(
|
||||
([cmd]) => typeof cmd === 'string' && cmd.includes('send-keys')
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user