feat(openai): add act-don't-ask and tool retry directives for GPT-5 [v3 2/6]#66372
feat(openai): add act-don't-ask and tool retry directives for GPT-5 [v3 2/6]#66372100yenadmin wants to merge 3 commits into
Conversation
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 SummaryAdds two subsections to Confidence Score: 5/5
Prompt To Fix All With AIThis 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
💡 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".
- 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)
…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
| ### 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.`; |
There was a problem hiding this comment.
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.
|
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 |
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:
Changes
extensions/openai/prompt-overlay.ts— EnhancedOPENAI_GPT5_EXECUTION_BIASwith two new subsections:Defense-in-Depth
Hermes Reference
agent/prompt_builder.py:221-229—<act_dont_ask>blockagent/prompt_builder.py:199-202— retry-with-different-strategy directiveVerification
ss/netstat, doesn't ask "where?"npm outdated, doesn't ask which project