fix(observer): v9 - stop treating Running N commands as approval button, add DOM-climbing context extraction
This commit is contained in:
@@ -267,14 +267,16 @@ function _handlePending(req: any, res: any, ctx: HttpBridgeContext) {
|
||||
return;
|
||||
}
|
||||
// "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
|
||||
// Only filter when step_probe IS actively tracking a session
|
||||
if (/^(?:Always\s*)?Run\b/i.test(cmd)) {
|
||||
if (!ctx.sessionStalled || ctx.lastPendingStepIndex >= 0) {
|
||||
ctx.logToFile(`[HTTP] filtered "Run" — ${!ctx.sessionStalled ? 'not stalled' : 'step_probe pending exists'}`);
|
||||
if (ctx.activeSessionId && (!ctx.sessionStalled || ctx.lastPendingStepIndex >= 0)) {
|
||||
ctx.logToFile(`[HTTP] filtered "Run" — ${!ctx.sessionStalled ? 'not stalled' : 'step_probe pending exists'} (session=${ctx.activeSessionId.substring(0, 8)})`);
|
||||
res.writeHead(200, { 'Content-Type': 'application/json' });
|
||||
res.end(JSON.stringify({ ok: false, filtered: true }));
|
||||
return;
|
||||
}
|
||||
// v9: When step_probe has no active session, let DOM observer handle approval
|
||||
ctx.logToFile(`[HTTP] allowing "Run" — step_probe has no active session`);
|
||||
}
|
||||
|
||||
const rid = data.request_id || Date.now().toString();
|
||||
|
||||
Reference in New Issue
Block a user