@teamvibe/poller 0.1.5 → 0.1.6
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/claude-spawner.js +10 -1
- package/package.json +1 -1
package/dist/claude-spawner.js
CHANGED
|
@@ -182,7 +182,7 @@ function formatStreamEvent(event) {
|
|
|
182
182
|
return null;
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
|
|
185
|
+
async function runClaudeCode(msg, sessionLog, cwd, sessionId, isFirstMessage = true, lastMessageTs) {
|
|
186
186
|
const slackContext = msg.response_context.slack;
|
|
187
187
|
const isCronMessage = msg.source === 'cron';
|
|
188
188
|
if (!slackContext && !isCronMessage) {
|
|
@@ -307,6 +307,15 @@ export async function spawnClaudeCode(msg, sessionLog, cwd, sessionId, isFirstMe
|
|
|
307
307
|
});
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
|
+
export async function spawnClaudeCode(msg, sessionLog, cwd, sessionId, isFirstMessage = true, lastMessageTs) {
|
|
311
|
+
const result = await runClaudeCode(msg, sessionLog, cwd, sessionId, isFirstMessage, lastMessageTs);
|
|
312
|
+
// If --resume failed, retry as a fresh session (session files may have been lost on container restart)
|
|
313
|
+
if (!result.success && sessionId && !isFirstMessage) {
|
|
314
|
+
sessionLog.info('Resume failed, retrying as fresh session (session files may have been lost)');
|
|
315
|
+
return runClaudeCode(msg, sessionLog, cwd, sessionId, true, lastMessageTs);
|
|
316
|
+
}
|
|
317
|
+
return result;
|
|
318
|
+
}
|
|
310
319
|
const activeProcesses = new Map();
|
|
311
320
|
export function getActiveProcessCount() {
|
|
312
321
|
return activeProcesses.size;
|