instar 0.4.4 → 0.4.5
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/commands/server.js
CHANGED
|
@@ -67,7 +67,9 @@ async function respawnSessionForTopic(sessionManager, telegram, targetSession, t
|
|
|
67
67
|
bootstrapMessage = `[telegram:${topicId}] ${msg} (${relayNote})`;
|
|
68
68
|
}
|
|
69
69
|
const storedName = telegram.getTopicName(topicId);
|
|
70
|
-
|
|
70
|
+
// Use topic name, not tmux session name — tmux names include the project prefix
|
|
71
|
+
// which causes cascading names like ai-guy-ai-guy-ai-guy-topic-1 on each respawn.
|
|
72
|
+
const topicName = storedName || `topic-${topicId}`;
|
|
71
73
|
const newSessionName = await sessionManager.spawnInteractiveSession(bootstrapMessage, topicName);
|
|
72
74
|
telegram.registerTopicSession(topicId, newSessionName);
|
|
73
75
|
await telegram.sendToTopic(topicId, `Session respawned.`);
|
|
@@ -374,6 +374,10 @@ export class SessionManager extends EventEmitter {
|
|
|
374
374
|
execFileSync(this.config.tmuxPath, ['paste-buffer', '-t', exactTarget, '-p'], {
|
|
375
375
|
encoding: 'utf-8', timeout: 5000,
|
|
376
376
|
});
|
|
377
|
+
// Brief delay to let the terminal process the paste before sending Enter.
|
|
378
|
+
// Without this, the Enter arrives before paste processing completes and
|
|
379
|
+
// the message sits in the input buffer without being submitted.
|
|
380
|
+
execFileSync('/bin/sleep', ['0.3'], { timeout: 2000 });
|
|
377
381
|
// Send Enter to submit
|
|
378
382
|
execFileSync(this.config.tmuxPath, ['send-keys', '-t', exactTarget, 'Enter'], {
|
|
379
383
|
encoding: 'utf-8', timeout: 5000,
|