perf: speed up session creation by ~500ms — remove redundant sleep, reduce tmux wait, fire-and-forget config

This commit is contained in:
arkon
2026-02-20 04:30:02 +01:00
parent 544ef67aeb
commit 99ad44e907
6 changed files with 54 additions and 34 deletions
+2 -6
View File
@@ -878,9 +878,7 @@ export class Session extends EventEmitter {
// Create a new mux session
this._muxSession = await this._mux.createSession(this.id, this.workingDir, 'claude', this._name, this._niceConfig, this._model);
console.log('[Session] Created mux session:', this._muxSession.muxName);
// Wait a moment for mux to fully start
await new Promise(resolve => setTimeout(resolve, MUX_STARTUP_DELAY_MS));
// No extra sleep — createSession() already waits for tmux readiness
}
// Attach to the mux session via PTY
@@ -1176,9 +1174,7 @@ export class Session extends EventEmitter {
// Create a new mux session
this._muxSession = await this._mux.createSession(this.id, this.workingDir, 'shell', this._name, this._niceConfig);
console.log('[Session] Created mux session:', this._muxSession.muxName);
// Wait a moment for mux to fully start
await new Promise(resolve => setTimeout(resolve, MUX_STARTUP_DELAY_MS));
// No extra sleep — createSession() already waits for tmux readiness
}
// Attach to the mux session via PTY