Skip to content

feat(openai): add act-don't-ask and tool retry directives for GPT-5 [v3 2/6]#66372

Closed
100yenadmin wants to merge 3 commits into
openclaw:mainfrom
electricsheephq:gpt5-v3/act-dont-ask-tool-retry
Closed

feat(openai): add act-don't-ask and tool retry directives for GPT-5 [v3 2/6]#66372
100yenadmin wants to merge 3 commits into
openclaw:mainfrom
electricsheephq:gpt5-v3/act-dont-ask-tool-retry

Conversation

@100yenadmin

Copy link
Copy Markdown
Contributor

GPT 5.4 Enhancement v3 — PR 2/6

Tracking: #66345 | Issue: #66347
Priority: P0 — HIGH | Gap closure: ~25%

Problem

GPT 5.4 on OpenClaw exhibits two failure modes Hermes avoids:

  User: "Is port 8080 open?"         Tool returns empty result
           │                                   │
  ┌────────┴─────────┐               ┌────────┴─────────┐
  │                  │               │                  │
  ▼                  ▼               ▼                  ▼
Hermes             OpenClaw        Hermes             OpenClaw
  │                  │               │                  │
  │ "act on obvious  │ "prerequisite │ "retry with      │ (no retry
  │  defaults" +     │  lookup"      │  different       │  guidance)
  │  examples        │ (too vague)   │  strategy"       │
  ▼                  ▼               ▼                  ▼
Runs               Asks user:      Retries with       Reports:
`ss -tlnp |        "Which host     broader query      "No results
 grep 8080`        should I check?"                    found."
✅ ACTS             ❌ STALLS        ✅ PERSISTS         ❌ SURRENDERS

Changes

extensions/openai/prompt-overlay.ts — Enhanced OPENAI_GPT5_EXECUTION_BIAS with two new subsections:

  1. Act, Don't Ask: Concrete examples showing when to act on obvious defaults vs when to ask
  2. Tool Persistence: Retry-on-failure directive — diagnose and adjust instead of surrendering

Defense-in-Depth

  ┌──────────────────────────────────────────────┐
  │          Defense-in-Depth Stack               │
  │                                               │
  │  Layer 1: PROMPT (this PR)                    │
  │  ├─ Act-don't-ask → prevents stall           │
  │  ├─ Tool retry → prevents surrender           │
  │  │                                             │
  │  Layer 2: RUNTIME (already exists)             │
  │  ├─ Planning-only detection → catches misses   │
  │  ├─ Ack fast path → "ok do it" acceleration    │
  │  └─ Strict-agentic blocked exit                │
  └──────────────────────────────────────────────┘

Hermes Reference

  • agent/prompt_builder.py:221-229<act_dont_ask> block
  • agent/prompt_builder.py:199-202 — retry-with-different-strategy directive

Verification

  • "Is port 8080 open?" → runs ss/netstat, doesn't ask "where?"
  • "Find all TODO comments" → if first grep misses, retries with different pattern
  • "What packages are outdated?" → runs npm outdated, doesn't ask which project

GPT 5.4 exhibits two failure modes that Hermes avoids:

1. Clarification stalling: asks "open where?" instead of checking the
   local machine. Stalls on ambiguity that has an obvious default.
2. First-failure surrender: reports tool failure instead of retrying
   with a different strategy.

Add two new subsections to OPENAI_GPT5_EXECUTION_BIAS:
- "Act, Don't Ask" with concrete examples (port check, OS check, time)
- "Tool Persistence" with retry-on-failure directive

These complement the runtime planning-only retry guard in
incomplete-turn.ts by preventing stalls at the prompt level,
avoiding wasted turns.

Part of GPT 5.4 Enhancement v3 sprint. Closes #66347.
Tracking issue: #66345.
@greptile-apps

greptile-apps Bot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds two subsections to OPENAI_GPT5_EXECUTION_BIAS in the OpenAI extension's prompt overlay: ### Act, Don't Ask (act on obvious defaults instead of asking for clarification) and ### Tool Persistence (retry with a different strategy instead of surrendering on empty results). The change is narrowly scoped to prompt text within the extension boundary and follows existing patterns in the file.

Confidence Score: 5/5

  • Safe to merge — purely additive prompt text change with no logic or schema impact.
  • Only finding is a P2 style suggestion to restate the existing "real blocker" escape hatch inside the new subsection for internal consistency. No correctness, data-integrity, or reliability concerns.
  • No files require special attention.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: extensions/openai/prompt-overlay.ts
Line: 81-84

Comment:
**Missing blocker escape hatch in Tool Persistence**

The parent block already says "keep calling tools until the task is done **or you hit a real blocker**", but the new `### Tool Persistence` subsection omits that exit condition. A model reading this subsection for retry guidance could interpret "keep calling tools until (1) complete AND (2) verified" as requiring indefinite retries even when the failure is permanent (e.g., `EACCES`, missing resource, auth error). Worth adding the escape hatch explicitly to stay internally consistent.

```suggestion
### Tool Persistence
If a tool returns empty or partial results, retry with a different query or strategy before giving up.
Keep calling tools until: (1) the task is complete, AND (2) you have verified the result — or you hit a real blocker with no viable alternative.
Do not abandon a viable approach after a single failure — diagnose why it failed and adjust.
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "feat(openai): add act-don't-ask and tool..." | Re-trigger Greptile

Comment thread extensions/openai/prompt-overlay.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the GPT-5 execution-bias prompt overlay for the OpenAI extension to reduce “clarification stalling” and “first-failure surrender” by adding more explicit agentic directives.

Changes:

  • Added an “Act, Don’t Ask” subsection with concrete examples to encourage acting on obvious defaults.
  • Added a “Tool Persistence” subsection instructing retries with alternate strategies when tools return empty/partial results.

Comment thread extensions/openai/prompt-overlay.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2a497f9b3b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread extensions/openai/prompt-overlay.ts
Comment thread extensions/openai/prompt-overlay.ts Outdated
- Replace em dashes with periods (per GPT-5 output contract)
- Add destructive-action escape hatch to act-don't-ask rule
- Remove mandatory verification from tool persistence (conflicts
  with execution bias principle of acting first)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

…tence

Parity audit: previous iteration drifted from Hermes based on bot
reviewer suggestions. Restore exact Hermes wording for both subsections.

Act, Don't Ask (Hermes prompt_builder.py lines 221-229):
- Restore single quotes in examples (Hermes style)
- Restore "don't use user profile" wording
- Remove destructive-action escape hatch (not in Hermes)

Tool Persistence (Hermes prompt_builder.py lines 198-204):
- Restore all four Hermes bullets including "improve correctness"
  and "do not stop early"
- Restore mandatory verification: "(1) task complete AND (2) verified"
- Remove "diagnose why it failed and adjust" rewording
@100yenadmin
100yenadmin requested a review from Copilot April 14, 2026 11:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment on lines +81 to +85
### Tool Persistence
- Use tools whenever they improve correctness, completeness, or grounding.
- Do not stop early when another tool call would materially improve the result.
- If a tool returns empty or partial results, retry with a different query or strategy before giving up.
- Keep calling tools until: (1) the task is complete, AND (2) you have verified the result.`;

Copilot AI Apr 14, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description’s proposed "Tool Persistence" block includes an additional directive ("Do not abandon a viable approach after a single failure. Diagnose why it failed and adjust."), but that sentence isn’t present in the updated OPENAI_GPT5_EXECUTION_BIAS string. Please either add the missing directive here or update the PR description so it matches what actually ships in this PR.

Copilot uses AI. Check for mistakes.
@100yenadmin

Copy link
Copy Markdown
Contributor Author

Superseded by consolidated final-sprint PRs. This PR's changes are incorporated into:

The v3 PRs were split across 6 separate PRs which made review harder and touched the same files redundantly. The final-sprint consolidation combines them into 3 clean, independently-mergeable PRs rebased on current main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants