osborn 0.9.185 → 0.9.186
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/index.js +21 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4528,21 +4528,10 @@ async function main() {
|
|
|
4528
4528
|
console.log('💓 Sending agent_ready signal...');
|
|
4529
4529
|
let readySent = false;
|
|
4530
4530
|
// (realtime provider removed)
|
|
4531
|
-
//
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
// Prepare sessions for frontend (up to 50)
|
|
4536
|
-
const sessionsForFrontend = allSessions.slice(0, 50).map(s => ({
|
|
4537
|
-
sessionId: s.sessionId,
|
|
4538
|
-
projectSlug: s.projectSlug,
|
|
4539
|
-
projectPath: s.projectPath,
|
|
4540
|
-
cwd: s.cwd,
|
|
4541
|
-
timestamp: s.timestamp.toISOString(),
|
|
4542
|
-
lastMessage: s.lastMessage,
|
|
4543
|
-
messageCount: s.messageCount,
|
|
4544
|
-
fileSize: s.fileSize,
|
|
4545
|
-
}));
|
|
4531
|
+
// Session list state — populated async so it doesn't block the first sendReady
|
|
4532
|
+
let sessionsForFrontend = [];
|
|
4533
|
+
let recentSessionId = null;
|
|
4534
|
+
let hasRecentSession = false;
|
|
4546
4535
|
const sendReady = async () => {
|
|
4547
4536
|
if (readySent)
|
|
4548
4537
|
return;
|
|
@@ -4564,11 +4553,28 @@ async function main() {
|
|
|
4564
4553
|
});
|
|
4565
4554
|
};
|
|
4566
4555
|
const readyInterval = setInterval(sendReady, 2000);
|
|
4556
|
+
// Fire immediately (empty session list) so the frontend unblocks right away
|
|
4567
4557
|
await sendReady();
|
|
4568
4558
|
setTimeout(() => {
|
|
4569
4559
|
clearInterval(readyInterval);
|
|
4570
4560
|
console.log('✅ agent_ready retries complete');
|
|
4571
4561
|
}, 20000);
|
|
4562
|
+
// Load session list in background — re-send agent_ready once populated
|
|
4563
|
+
listAllClaudeSessions().then(allSessions => {
|
|
4564
|
+
recentSessionId = allSessions.length > 0 ? allSessions[0].sessionId : null;
|
|
4565
|
+
hasRecentSession = allSessions.length > 0;
|
|
4566
|
+
sessionsForFrontend = allSessions.slice(0, 50).map(s => ({
|
|
4567
|
+
sessionId: s.sessionId,
|
|
4568
|
+
projectSlug: s.projectSlug,
|
|
4569
|
+
projectPath: s.projectPath,
|
|
4570
|
+
cwd: s.cwd,
|
|
4571
|
+
timestamp: s.timestamp.toISOString(),
|
|
4572
|
+
lastMessage: s.lastMessage,
|
|
4573
|
+
messageCount: s.messageCount,
|
|
4574
|
+
fileSize: s.fileSize,
|
|
4575
|
+
}));
|
|
4576
|
+
sendReady();
|
|
4577
|
+
}).catch(err => console.warn('listAllClaudeSessions background load failed:', err));
|
|
4572
4578
|
// Stop agent_ready retries on user speech
|
|
4573
4579
|
session.on('input_speech_started', () => {
|
|
4574
4580
|
readySent = true;
|