fix: filter DOM Observer Run-only pendings when step_probe already has pending
This commit is contained in:
@@ -474,13 +474,16 @@ function startObserverHttpBridge() {
|
||||
res.end(JSON.stringify({ ok: false, filtered: true }));
|
||||
return;
|
||||
}
|
||||
// "Run" button → only accept if session is actually stalled (waiting for approval)
|
||||
if (/^Run/i.test(cmd) && !sessionStalled) {
|
||||
logToFile(`[HTTP] filtered "Run" — session not stalled`);
|
||||
// "Run" button → step_probe handles these with full command detail
|
||||
// Only let through if session is stalled AND step_probe hasn't created a pending yet
|
||||
if (/^Run$/i.test(cmd)) {
|
||||
if (!sessionStalled || lastPendingStepIndex >= 0) {
|
||||
logToFile(`[HTTP] filtered "Run" — ${!sessionStalled ? 'not stalled' : 'step_probe pending exists'}`);
|
||||
res.writeHead(200, { 'Content-Type': 'application/json' });
|
||||
res.end(JSON.stringify({ ok: false, filtered: true }));
|
||||
return;
|
||||
}
|
||||
}
|
||||
const rid = data.request_id || Date.now().toString();
|
||||
// Write pending file for Discord bot
|
||||
const pendingDir = path.join(bridgePath, 'pending');
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -453,13 +453,16 @@ function startObserverHttpBridge(): Promise<number> {
|
||||
res.end(JSON.stringify({ ok: false, filtered: true }));
|
||||
return;
|
||||
}
|
||||
// "Run" button → only accept if session is actually stalled (waiting for approval)
|
||||
if (/^Run/i.test(cmd) && !sessionStalled) {
|
||||
logToFile(`[HTTP] filtered "Run" — session not stalled`);
|
||||
// "Run" button → step_probe handles these with full command detail
|
||||
// Only let through if session is stalled AND step_probe hasn't created a pending yet
|
||||
if (/^Run$/i.test(cmd)) {
|
||||
if (!sessionStalled || lastPendingStepIndex >= 0) {
|
||||
logToFile(`[HTTP] filtered "Run" — ${!sessionStalled ? 'not stalled' : 'step_probe pending exists'}`);
|
||||
res.writeHead(200, { 'Content-Type': 'application/json' });
|
||||
res.end(JSON.stringify({ ok: false, filtered: true }));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const rid = data.request_id || Date.now().toString();
|
||||
// Write pending file for Discord bot
|
||||
|
||||
Reference in New Issue
Block a user