fix(bridge): v16 terminal output filter + v15 stale LS auto-fix + heartbeat probe (v0.5.50) #task-619

- http-bridge v16: Block terminal OUTPUT as enriched cmd — if description has no prompt marker (> » $ #), it's stdout from code block, not an actual command. Prevents 'No extension.log found' etc. from reaching Discord.
- step-probe v15: Stale LS auto-detection — if all sessions are >5min old, periodically retry fixLSConnection(). Heartbeat probe every 10 polls to detect step changes when summary API returns frozen stepCount.
- extension.ts v15: fixLSConnection() fallback — match LS processes without --workspace_id (common after AG restart)
This commit is contained in:
Variet Worker
2026-04-16 04:58:05 +09:00
parent 66233bd9cb
commit 7ade31e4cf
6 changed files with 135 additions and 29 deletions

View File

@@ -243,8 +243,8 @@ async function fixLSConnection() {
logToFile(`[LS-FIX] found ${lines.length} LS process(es), hint="${hint}"`);
// Find the line whose workspace_id matches our workspace (case-insensitive)
let matchedLine = null;
let fallbackLine = null; // v15: LS without workspace_id (AG restart)
for (const line of lines) {
const lower = line.toLowerCase();
// Match workspace_id arg against our hint
const wsMatch = line.match(/--workspace_id[= ](\S+)/i);
if (wsMatch) {
@@ -254,10 +254,25 @@ async function fixLSConnection() {
break;
}
}
else {
// v15: LS without --workspace_id (new AG main LS after restart)
// Skip --enable_lsp processes (secondary/old LSP instances)
if (!line.includes('--enable_lsp') && !fallbackLine) {
fallbackLine = line;
logToFile(`[LS-FIX] found fallback LS (no workspace_id): PID=${line.split('|')[0]?.trim()}`);
}
}
}
if (!matchedLine) {
logToFile(`[LS-FIX] No LS process matched hint="${hint}" (${lines.length} processes)`);
return false;
if (fallbackLine) {
// v15: Use workspace_id-less LS as fallback (common after AG restart)
logToFile(`[LS-FIX] No workspace_id match — using fallback LS`);
matchedLine = fallbackLine;
}
else {
logToFile(`[LS-FIX] No LS process matched hint="${hint}" (${lines.length} processes)`);
return false;
}
}
// Extract port and csrf_token from matched line
const csrfMatch = matchedLine.match(/--csrf_token[= ](\S+)/);

File diff suppressed because one or more lines are too long