openclaw - 💡(How to fix) Fix `executionContract: "strict-agentic"` planning-only retry skips on common imperatives and present-continuous narration [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#71658Fetched 2026-04-26 05:10:10
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

Root Cause

Two separate regex allowlists in dist/selection-JV4r6_BA.js are too narrow to cover real GPT-5.4 behavior.

Code Example

{
  "agents": {
    "defaults": {
      "embeddedPi": { "executionContract": "strict-agentic" }
    }
  }
}

---

const DIRECTIVE = /^\s*(?:please\s+)?(?:check|look(?:\s+into|\s+at)?|read|write|edit|update|fix|investigate|debug|run|search|find|implement|add|remove|refactor|explain|summari(?:s|z)e|analy(?:s|z)e|review|tell|show|make|restart|deploy|prepare)\b/i;
const REQUEST = /\b(?:can|could|would|will)\s+you\b|\b(?:please|pls)\b|\b(?:help|explain|summari(?:s|z)e|analy(?:s|z)e|review|investigate|debug|fix|check|look(?:\s+into|\s+at)?|read|write|edit|update|run|search|find|implement|add|remove|refactor|show|tell me|walk me through)\b/i;
const p = "do another pass then put this draft through the opus polish";
DIRECTIVE.test(p); // false
REQUEST.test(p);   // false
RAW_BUFFERClick to expand / collapse

Problem

executionContract: "strict-agentic" advertises that GPT-5-family runs will keep acting through plan-only turns. In practice the retry silently skips when:

  • Gap A: The user prompt uses a common imperative verb not in the actionable allowlist
  • Gap B: The assistant's planning narration uses a present-continuous form ("I'm running it") instead of "I'll" / "I will"

Both produce the same observed outcome: a planning-only turn ends cleanly, no retry fires, the session goes idle.

Repro

Config:

{
  "agents": {
    "defaults": {
      "embeddedPi": { "executionContract": "strict-agentic" }
    }
  }
}

Model: openai-codex/gpt-5.4 (other GPT-5 family models also reproduce).

Repro A: non-allowlisted user verb

User: do another pass then put this draft through the opus polish

Assistant (0 tool calls, turn ends):

On it. I'll do this in two steps:

  1. Rewrite it to match your exact blog voice and structure.
  2. Run that version through your Opus polish lane for final refinement, then post the polished draft back here.

Repro B: short confident narration after an ack prompt

User: GO

Assistant (0 tool calls, turn ends):

Great. I'm running it now.

Expected for both: planning-only retry fires, injects retry instruction, model acts. Actual: turn ends cleanly; session idle until next user message.

Root cause

Two separate regex allowlists in dist/selection-JV4r6_BA.js are too narrow to cover real GPT-5.4 behavior.

Gap A: user-prompt actionable gate (Repro A)

resolvePlanningOnlyRetryInstruction short-circuits when isLikelyActionableUserPrompt(prompt) === false. Both gate regexes are allowlists of ~30 verbs:

  • ACTIONABLE_PROMPT_DIRECTIVE_RE (selection-JV4r6_BA.js:1173)
  • ACTIONABLE_PROMPT_REQUEST_RE (selection-JV4r6_BA.js:1174)

They miss common imperatives: do, put, post, draft, polish, rewrite, pass, send, build, finish, create, generate, compose.

Node repro:

const DIRECTIVE = /^\s*(?:please\s+)?(?:check|look(?:\s+into|\s+at)?|read|write|edit|update|fix|investigate|debug|run|search|find|implement|add|remove|refactor|explain|summari(?:s|z)e|analy(?:s|z)e|review|tell|show|make|restart|deploy|prepare)\b/i;
const REQUEST = /\b(?:can|could|would|will)\s+you\b|\b(?:please|pls)\b|\b(?:help|explain|summari(?:s|z)e|analy(?:s|z)e|review|investigate|debug|fix|check|look(?:\s+into|\s+at)?|read|write|edit|update|run|search|find|implement|add|remove|refactor|show|tell me|walk me through)\b/i;
const p = "do another pass then put this draft through the opus polish";
DIRECTIVE.test(p); // false
REQUEST.test(p);   // false

Swap do to update and DIRECTIVE.test returns true; retry fires as expected.

Gap B: assistant-narration planning-only detection (Repro B)

Even when the user prompt passes (GO is caught by isLikelyExecutionAckPrompt), the assistant text "Great. I'm running it now." matches none of the planning-only detectors:

  • PLANNING_ONLY_PROMISE_RE requires i'll / i will / i'm going to / let me / i can do that. Misses i'm <verb>ing (running, doing, working on, starting on), on it, doing that now, handling.
  • hasStructuredPlanningOnlyFormat requires bullets + planning cue line. Not present.
  • resolveEmptyResponseRetryInstruction only fires with zero assistant text.

Result: a confident 5-word narration skips all three guards.

Proposed fix

For Gap A (user prompts)

Either:

  1. Extend the verb allowlist with: do|put|post|draft|polish|rewrite|pass|send|build|finish|create|generate|compose.
  2. Flip to a denylist approach: skip strict-agentic retry only for obvious chit-chat (thanks, ok cool, lol, nice, got it). More durable since allowlists keep growing.

For Gap B (assistant narration)

Either:

  1. Extend PLANNING_ONLY_PROMISE_RE to catch present-continuous self-narration: i(?:'m| am)\s+(?:running|doing|working|starting|handling|processing|polishing) and standalone on it\b / doing that now\b / got it\b.
  2. Add a fourth guard: a "zero-tool confident assertion" check. Any assistant turn with 0 tool calls, 0 yields, no client tool response, that asserts ongoing or imminent action ("running", "doing", "on it", "handling") triggers retry. Simpler than continuing to grow the regex.

Impact

strict-agentic is advertised as the remedy for GPT-5.4 stalling after planning. That remedy works only when the user's phrasing happens to include a verb from the list. Common imperative forms (do X, put X through Y) silently fall through to default behavior. Users on the Pro plan who opt into strict-agentic to fix this exact failure will still see GPT-5.4 narrate instead of act.

Environment

  • OpenClaw: 2026.4.x (regex names confirmed in current dist)
  • Model: openai-codex/gpt-5.4
  • Config: executionContract: "strict-agentic"

extent analysis

TL;DR

Update the regex allowlists in dist/selection-JV4r6_BA.js to include more imperative verbs and present-continuous forms to fix the strict-agentic execution contract issue.

Guidance

  • Extend the verb allowlist with common imperative verbs like do, put, post, draft, polish, rewrite, pass, send, build, finish, create, generate, and compose to cover real GPT-5.4 behavior.
  • Update PLANNING_ONLY_PROMISE_RE to catch present-continuous self-narration like i'm running or i'm doing to improve planning-only detection.
  • Consider flipping to a denylist approach for user prompts to skip strict-agentic retry only for obvious chit-chat.
  • Add a "zero-tool confident assertion" check to trigger retry when the assistant asserts ongoing or imminent action without tool calls or yields.

Example

const updatedDIRECTIVE = /^\s*(?:please\s+)?(?:check|look(?:\s+into|\s+at)?|read|write|edit|update|fix|investigate|debug|run|search|find|implement|add|remove|refactor|explain|summari(?:s|z)e|analy(?:s|z)e|review|tell|show|make|restart|deploy|prepare|do|put|post|draft|polish|rewrite|pass|send|build|finish|create|generate|compose)\b/i;
const updatedREQUEST = /\b(?:can|could|will|would)\s+you\b|\b(?:please|pls)\b|\b(?:help|explain|summari(?:s|z)e|analy(?:s|z)e|review|investigate|debug|fix|check|look(?:\s+into|\s+at)?|read|

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix `executionContract: "strict-agentic"` planning-only retry skips on common imperatives and present-continuous narration [1 participants]