fix(http-bridge): remove incorrect extracted===rawDesc skip in enrichment (v0.5.44) #task-619

This commit is contained in:
Variet Worker
2026-04-15 07:47:56 +09:00
parent 7ee5947b32
commit 4684376c78

View File

@@ -272,10 +272,9 @@ function _handlePending(req: any, res: any, ctx: HttpBridgeContext) {
extracted = promptMatch[1].trim();
}
// v12: Validate extracted text is not just a prompt fragment
// Skip enrichment if extracted is the same as rawDesc (no > found) or looks like a bare prompt
// Skip enrichment only if it looks like a bare prompt (e.g. "\\gravity_control >")
const PROMPT_ONLY_RE = /^[\s\\\/]*[\w_.-]+\s*[>»$#]\s*$/;
const isPromptOnly = PROMPT_ONLY_RE.test(extracted) || extracted === rawDesc;
if (!isPromptOnly && extracted.length > 3) {
if (!PROMPT_ONLY_RE.test(extracted) && extracted.length > 3) {
enrichedCmd = extracted.substring(0, 200);
enrichedDesc = `[${rawCmd}] ${rawDesc}`;
ctx.logToFile(`[HTTP] command enriched: "${rawCmd}" → "${enrichedCmd.substring(0, 60)}"`);