commandmate 0.3.0 → 0.3.1
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/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +9 -9
- package/.next/app-path-routes-manifest.json +1 -1
- package/.next/build-manifest.json +2 -2
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/1.pack +0 -0
- package/.next/cache/webpack/client-production/2.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack.old +0 -0
- package/.next/cache/webpack/edge-server-production/0.pack +0 -0
- package/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/required-server-files.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/update-check/route.js +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/page.js +1 -1
- package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +10 -10
- package/.next/server/chunks/7536.js +1 -1
- package/.next/server/chunks/7566.js +2 -2
- package/.next/server/functions-config-manifest.json +1 -1
- package/.next/server/middleware-manifest.json +5 -5
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/app/worktrees/[id]/{page-9418e49bdc1de02c.js → page-a556551ce5c69dec.js} +1 -1
- package/.next/trace +5 -5
- package/dist/server/src/lib/claude-session.js +31 -6
- package/dist/server/src/lib/cli-patterns.js +1 -1
- package/dist/server/src/lib/response-poller.js +3 -2
- package/package.json +1 -1
- /package/.next/static/{clTo9tuAoPMLcGRuVENfO → hmAjbCPjxX_C0Os7rphI1}/_buildManifest.js +0 -0
- /package/.next/static/{clTo9tuAoPMLcGRuVENfO → hmAjbCPjxX_C0Os7rphI1}/_ssgManifest.js +0 -0
|
@@ -136,6 +136,17 @@ exports.CLAUDE_PROMPT_POLL_INTERVAL = 200;
|
|
|
136
136
|
* 40 is an empirical threshold with safety margin.
|
|
137
137
|
*/
|
|
138
138
|
const MAX_SHELL_PROMPT_LENGTH = 40;
|
|
139
|
+
/**
|
|
140
|
+
* Number of tail lines used for error pattern detection in isSessionHealthy()
|
|
141
|
+
*
|
|
142
|
+
* Error patterns are only searched within the last N lines of pane output,
|
|
143
|
+
* not the entire buffer. This prevents false negatives where historical
|
|
144
|
+
* (already recovered) errors in the scrollback trigger unhealthy detection.
|
|
145
|
+
*
|
|
146
|
+
* 10 lines provides sufficient window to catch recent errors while ignoring
|
|
147
|
+
* historical ones that have scrolled up.
|
|
148
|
+
*/
|
|
149
|
+
const HEALTH_CHECK_ERROR_TAIL_LINES = 10;
|
|
139
150
|
/**
|
|
140
151
|
* Cached Claude CLI path
|
|
141
152
|
*/
|
|
@@ -265,21 +276,31 @@ async function isSessionHealthy(sessionName) {
|
|
|
265
276
|
if (trimmed === '') {
|
|
266
277
|
return { healthy: false, reason: 'empty output' };
|
|
267
278
|
}
|
|
268
|
-
//
|
|
279
|
+
// Active state detection: check for Claude prompt BEFORE error patterns.
|
|
280
|
+
// This prevents false negatives where historical (recovered) errors in
|
|
281
|
+
// the pane scrollback cause a currently-active session to be marked unhealthy.
|
|
282
|
+
if (cli_patterns_1.CLAUDE_PROMPT_PATTERN.test(trimmed)) {
|
|
283
|
+
return { healthy: true };
|
|
284
|
+
}
|
|
285
|
+
// S2-F010: Error pattern detection - limited to tail lines only.
|
|
286
|
+
// Only the last HEALTH_CHECK_ERROR_TAIL_LINES lines are searched, so
|
|
287
|
+
// historical errors that have scrolled up do not trigger false negatives.
|
|
288
|
+
const allLines = trimmed.split('\n').filter(line => line.trim() !== '');
|
|
289
|
+
const tailLines = allLines.slice(-HEALTH_CHECK_ERROR_TAIL_LINES);
|
|
290
|
+
const tailText = tailLines.join('\n');
|
|
269
291
|
// MF-001: Check error patterns from cli-patterns.ts (SRP - pattern management centralized)
|
|
270
292
|
for (const pattern of cli_patterns_1.CLAUDE_SESSION_ERROR_PATTERNS) {
|
|
271
|
-
if (
|
|
293
|
+
if (tailText.includes(pattern)) {
|
|
272
294
|
return { healthy: false, reason: `error pattern: ${pattern}` };
|
|
273
295
|
}
|
|
274
296
|
}
|
|
275
297
|
for (const regex of cli_patterns_1.CLAUDE_SESSION_ERROR_REGEX_PATTERNS) {
|
|
276
|
-
if (regex.test(
|
|
298
|
+
if (regex.test(tailText)) {
|
|
277
299
|
return { healthy: false, reason: `error pattern: ${regex.source}` };
|
|
278
300
|
}
|
|
279
301
|
}
|
|
280
302
|
// S2-F002: Extract last line after empty line filtering
|
|
281
|
-
const
|
|
282
|
-
const lastLine = lines[lines.length - 1]?.trim() ?? '';
|
|
303
|
+
const lastLine = allLines[allLines.length - 1]?.trim() ?? '';
|
|
283
304
|
// F006: Line length check BEFORE SHELL_PROMPT_ENDINGS check (early return)
|
|
284
305
|
if (lastLine.length >= MAX_SHELL_PROMPT_LENGTH) {
|
|
285
306
|
// Long lines are not shell prompts -> treat as healthy (early return)
|
|
@@ -415,7 +436,11 @@ async function isClaudeRunning(worktreeId) {
|
|
|
415
436
|
// MF-S3-001: Verify session health to avoid reporting broken sessions as running
|
|
416
437
|
// S2-F001: await + extract .healthy to maintain boolean return type
|
|
417
438
|
const result = await isSessionHealthy(sessionName);
|
|
418
|
-
|
|
439
|
+
if (!result.healthy) {
|
|
440
|
+
console.warn(`[isClaudeRunning] Session ${sessionName} unhealthy: ${result.reason}`);
|
|
441
|
+
return false;
|
|
442
|
+
}
|
|
443
|
+
return true;
|
|
419
444
|
}
|
|
420
445
|
/**
|
|
421
446
|
* Get Claude session state
|
|
@@ -268,7 +268,7 @@ exports.CLAUDE_SESSION_ERROR_PATTERNS = [
|
|
|
268
268
|
* SEC-SF-004: See CLAUDE_SESSION_ERROR_PATTERNS JSDoc for pattern maintenance process.
|
|
269
269
|
*/
|
|
270
270
|
exports.CLAUDE_SESSION_ERROR_REGEX_PATTERNS = [
|
|
271
|
-
|
|
271
|
+
/^Error:.*Claude Code/,
|
|
272
272
|
];
|
|
273
273
|
function buildDetectPromptOptions(cliToolId) {
|
|
274
274
|
if (cliToolId === 'claude') {
|
|
@@ -35,9 +35,10 @@ const cli_patterns_1 = require("./cli-patterns");
|
|
|
35
35
|
*/
|
|
36
36
|
const POLLING_INTERVAL = 2000;
|
|
37
37
|
/**
|
|
38
|
-
* Maximum polling duration in milliseconds (default:
|
|
38
|
+
* Maximum polling duration in milliseconds (default: 30 minutes)
|
|
39
|
+
* Previously 5 minutes, which caused silent polling stops for long-running tasks.
|
|
39
40
|
*/
|
|
40
|
-
const MAX_POLLING_DURATION =
|
|
41
|
+
const MAX_POLLING_DURATION = 30 * 60 * 1000;
|
|
41
42
|
/**
|
|
42
43
|
* Number of tail lines to check for active thinking indicators in response extraction.
|
|
43
44
|
*
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|