@teamvibe/poller 0.1.29 → 0.1.30
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 +8 -2
- package/dist/config.js +2 -2
- package/dist/poller.js +4 -2
- package/dist/slack-client.js +5 -1
- package/package.json +1 -1
package/dist/claude-spawner.js
CHANGED
|
@@ -243,8 +243,11 @@ async function runClaudeCode(msg, sessionLog, cwd, sessionId, isFirstMessage = t
|
|
|
243
243
|
stderr += chunk;
|
|
244
244
|
sessionLog.claude('stderr', chunk.trimEnd());
|
|
245
245
|
});
|
|
246
|
+
let timedOut = false;
|
|
247
|
+
const timeoutMinutes = Math.round(config.CLAUDE_TIMEOUT_MS / 60000);
|
|
246
248
|
const timeout = setTimeout(() => {
|
|
247
|
-
|
|
249
|
+
timedOut = true;
|
|
250
|
+
logger.error(`Claude Code process timed out after ${timeoutMinutes} minutes`);
|
|
248
251
|
proc.kill('SIGTERM');
|
|
249
252
|
setTimeout(() => proc.kill('SIGKILL'), 5000);
|
|
250
253
|
}, config.CLAUDE_TIMEOUT_MS);
|
|
@@ -256,7 +259,10 @@ async function runClaudeCode(msg, sessionLog, cwd, sessionId, isFirstMessage = t
|
|
|
256
259
|
output: stdout,
|
|
257
260
|
exitCode: code,
|
|
258
261
|
};
|
|
259
|
-
if (
|
|
262
|
+
if (timedOut) {
|
|
263
|
+
result.error = `Session timed out after ${timeoutMinutes} minutes. The task was still running when the time limit was reached. Consider breaking complex tasks into smaller steps.`;
|
|
264
|
+
}
|
|
265
|
+
else if (code !== 0) {
|
|
260
266
|
result.error = stderr || `Process exited with code ${code}`;
|
|
261
267
|
}
|
|
262
268
|
resolve(result);
|
package/dist/config.js
CHANGED
|
@@ -19,8 +19,8 @@ const configSchema = z.object({
|
|
|
19
19
|
POLL_WAIT_TIME_SECONDS: z.coerce.number().default(20),
|
|
20
20
|
VISIBILITY_TIMEOUT_SECONDS: z.coerce.number().default(60),
|
|
21
21
|
HEARTBEAT_INTERVAL_MS: z.coerce.number().default(40000), // 40 seconds
|
|
22
|
-
CLAUDE_TIMEOUT_MS: z.coerce.number().default(
|
|
23
|
-
STALE_LOCK_TIMEOUT_MS: z.coerce.number().default(
|
|
22
|
+
CLAUDE_TIMEOUT_MS: z.coerce.number().default(3600000), // 60 minutes
|
|
23
|
+
STALE_LOCK_TIMEOUT_MS: z.coerce.number().default(3900000), // 65 minutes
|
|
24
24
|
// Paths
|
|
25
25
|
TEAMVIBE_DATA_DIR: z.string().default(DEFAULT_DATA_DIR),
|
|
26
26
|
BRAINS_PATH: z.string().default(''),
|
package/dist/poller.js
CHANGED
|
@@ -151,8 +151,10 @@ async function processMessage(received) {
|
|
|
151
151
|
else {
|
|
152
152
|
sessionLog.error(`Claude Code failed: ${result.error}`);
|
|
153
153
|
if (hasSlackContext) {
|
|
154
|
-
|
|
155
|
-
|
|
154
|
+
const errorMessage = result.error || `Process exited with code ${result.exitCode}`;
|
|
155
|
+
const isTimeout = errorMessage.includes('timed out');
|
|
156
|
+
await sendSlackError(queueMessage, errorMessage);
|
|
157
|
+
await addReaction(queueMessage, isTimeout ? 'hourglass' : 'x');
|
|
156
158
|
}
|
|
157
159
|
if (lockToken) {
|
|
158
160
|
await releaseSessionLock(threadId, lockToken, 'idle');
|
package/dist/slack-client.js
CHANGED
|
@@ -60,10 +60,14 @@ export async function sendSlackError(msg, error) {
|
|
|
60
60
|
return;
|
|
61
61
|
const { channel, thread_ts } = msg.response_context.slack;
|
|
62
62
|
const slack = getSlackClient(msg.teamvibe.botToken);
|
|
63
|
+
const isTimeout = error.includes('timed out');
|
|
64
|
+
const text = isTimeout
|
|
65
|
+
? `:warning: ${error}`
|
|
66
|
+
: `Error processing your request:\n\`\`\`\n${error}\n\`\`\``;
|
|
63
67
|
await slack.chat.postMessage({
|
|
64
68
|
channel,
|
|
65
69
|
thread_ts,
|
|
66
|
-
text
|
|
70
|
+
text,
|
|
67
71
|
});
|
|
68
72
|
}
|
|
69
73
|
export async function addReaction(msg, emoji) {
|