fix(observer/bridge): v13 _promptOnlySkipped fallback guard + generic button no-context filter (v0.5.46) #task-619
This commit is contained in:
@@ -279,9 +279,20 @@ function _handlePending(req: any, res: any, ctx: HttpBridgeContext) {
|
||||
enrichedDesc = `[${rawCmd}] ${rawDesc}`;
|
||||
ctx.logToFile(`[HTTP] command enriched: "${rawCmd}" → "${enrichedCmd.substring(0, 60)}"`);
|
||||
} else {
|
||||
// Keep original button text as command, but use desc as-is
|
||||
// v13: Enrichment failed — description is prompt-only or empty
|
||||
// If cmd is still generic button text, unconditionally filter it
|
||||
ctx.logToFile(`[HTTP] enrichment skipped (prompt-only): "${rawCmd}" desc="${rawDesc.substring(0, 60)}"`);
|
||||
ctx.logToFile(`[HTTP] filtered generic+prompt-only: "${rawCmd}"`);
|
||||
res.writeHead(200, { 'Content-Type': 'application/json' });
|
||||
res.end(JSON.stringify({ ok: false, filtered: true, reason: 'generic_btn_prompt_only' }));
|
||||
return;
|
||||
}
|
||||
} else if (GENERIC_BTN_RE.test(rawCmd) && (rawDesc.length <= 10 || rawDesc === rawCmd)) {
|
||||
// v13: Generic button with no useful description (observer prompt-only context)
|
||||
ctx.logToFile(`[HTTP] filtered generic button no-context: "${rawCmd}" desc="${rawDesc.substring(0, 30)}"`);
|
||||
res.writeHead(200, { 'Content-Type': 'application/json' });
|
||||
res.end(JSON.stringify({ ok: false, filtered: true, reason: 'generic_btn_no_context' }));
|
||||
return;
|
||||
}
|
||||
|
||||
// ── Server-side false positive filter (uses enriched cmd) ──
|
||||
|
||||
Reference in New Issue
Block a user