Skip to content

agents: split GPT-5 prompt and retry behavior#65597

Merged
pashpashpash merged 8 commits into
openclaw:mainfrom
pashpashpash:codex/pr-65257-behavior-slice
Apr 13, 2026
Merged

agents: split GPT-5 prompt and retry behavior#65597
pashpashpash merged 8 commits into
openclaw:mainfrom
pashpashpash:codex/pr-65257-behavior-slice

Conversation

@pashpashpash

Copy link
Copy Markdown
Contributor

Summary

Excluded From This PR

  • auto-continuation loop changes in src/agents/pi-embedded-runner/run.ts
  • continuation config/schema/docs work
  • per-agent continuation typing changes

Testing

  • pnpm test extensions/openai/index.test.ts
  • pnpm test src/agents/pi-embedded-runner/run.incomplete-turn.test.ts
  • pnpm check

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling extensions: openai size: S maintainer Maintainer-authored PR labels Apr 12, 2026
@greptile-apps

greptile-apps Bot commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR splits two concerns out of a larger GPT-5 runtime work item: (1) the GPT-5 prompt overlay, now organized into three exported named constants (OPENAI_GPT5_OUTPUT_CONTRACT, OPENAI_GPT5_TOOL_CALL_STYLE, OPENAI_GPT5_EXECUTION_BIAS) alongside the existing friendly overlay; and (2) the one-action-then-narrative retry loophole fix in incomplete-turn.ts, which adds isSingleActionThenNarrativePattern plus an updated SINGLE_ACTION_NARRATIVE_RE that correctly excludes "let me know" via a negative lookahead while capturing "i can do that" as a planning cue.

Confidence Score: 5/5

Safe to merge — logic is correct, regex patterns are well-tested, no breaking changes.

All findings are P2 or lower. The regex patterns (SINGLE_ACTION_NARRATIVE_RE, PLANNING_ONLY_PROMISE_RE) behave correctly across the tested edge cases including the 'let me know' exclusion and 'i can do that' cue. The control flow in resolvePlanningOnlyRetryInstruction correctly gates the single-action-narrative bypass so that the outer text.includes('```') and other null returns still fire as expected.

No files require special attention.

Reviews (1): Last reviewed commit: "agents: split GPT-5 prompt and retry beh..." | Re-trigger Greptile

@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: 2c0d6da010

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread extensions/openai/prompt-overlay.ts Outdated
Comment thread src/agents/pi-embedded-runner/run/incomplete-turn.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: 007c83dad4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/pi-embedded-runner/run/incomplete-turn.ts Outdated
@pashpashpash
pashpashpash force-pushed the codex/pr-65257-behavior-slice branch from 007c83d to 6b40925 Compare April 13, 2026 00:24

@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: 012963962d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/pi-embedded-runner/run/incomplete-turn.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: 57cf940866

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/pi-embedded-runner/run/incomplete-turn.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: 8d8d473cc6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/pi-embedded-runner/run/incomplete-turn.ts Outdated
@openclaw-barnacle openclaw-barnacle Bot added the commands Command implementations label Apr 13, 2026

@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: 5569a935cd

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +58 to +59
const SINGLE_ACTION_EXPLICIT_CONTINUATION_RE =
/\b(?:going to|first[, ]+i(?:'ll| will)|next[, ]+i(?:'ll| will)|then[, ]+i(?:'ll| will)|i can do that next|let me (?!know\b)\w+(?:\s+\w+){0,3}\s+(?:next|then|first)\b)/i;

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.

P2 Badge Scope continuation regex to first-person intent

SINGLE_ACTION_EXPLICIT_CONTINUATION_RE currently matches bare going to, so factual answer text can be misread as plan-only narration. In resolvePlanningOnlyRetryInstruction, a turn with one safe tool call (read/grep/etc.) then an answer like “The parser is going to crash on empty input” now satisfies the single-action bypass and returns PLANNING_ONLY_RETRY_INSTRUCTION, even though the assistant already delivered content. That creates unnecessary retries and can escalate to strict-agentic blocked exits on valid completions; this cue should be limited to first-person continuation patterns (for example, I'm going to/I'll ... next) rather than generic going to.

Useful? React with 👍 / 👎.

lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
* agents: split GPT-5 prompt and retry behavior

* agents: fix GPT-5 review follow-ups

* agents: address GPT-5 review follow-ups

* agents: avoid replaying side-effectful GPT retries

* agents: mark subagent control as mutating

* agents: fail closed on single-action retries

* commands: stabilize channel legacy doctor migration test

* agents: narrow single-action retry promise trigger
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
* agents: split GPT-5 prompt and retry behavior

* agents: fix GPT-5 review follow-ups

* agents: address GPT-5 review follow-ups

* agents: avoid replaying side-effectful GPT retries

* agents: mark subagent control as mutating

* agents: fail closed on single-action retries

* commands: stabilize channel legacy doctor migration test

* agents: narrow single-action retry promise trigger
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
* agents: split GPT-5 prompt and retry behavior

* agents: fix GPT-5 review follow-ups

* agents: address GPT-5 review follow-ups

* agents: avoid replaying side-effectful GPT retries

* agents: mark subagent control as mutating

* agents: fail closed on single-action retries

* commands: stabilize channel legacy doctor migration test

* agents: narrow single-action retry promise trigger
globalcaos pushed a commit to globalcaos/tinkerclaw that referenced this pull request May 13, 2026
* agents: split GPT-5 prompt and retry behavior

* agents: fix GPT-5 review follow-ups

* agents: address GPT-5 review follow-ups

* agents: avoid replaying side-effectful GPT retries

* agents: mark subagent control as mutating

* agents: fail closed on single-action retries

* commands: stabilize channel legacy doctor migration test

* agents: narrow single-action retry promise trigger
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
* agents: split GPT-5 prompt and retry behavior

* agents: fix GPT-5 review follow-ups

* agents: address GPT-5 review follow-ups

* agents: avoid replaying side-effectful GPT retries

* agents: mark subagent control as mutating

* agents: fail closed on single-action retries

* commands: stabilize channel legacy doctor migration test

* agents: narrow single-action retry promise trigger
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
* agents: split GPT-5 prompt and retry behavior

* agents: fix GPT-5 review follow-ups

* agents: address GPT-5 review follow-ups

* agents: avoid replaying side-effectful GPT retries

* agents: mark subagent control as mutating

* agents: fail closed on single-action retries

* commands: stabilize channel legacy doctor migration test

* agents: narrow single-action retry promise trigger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations extensions: openai maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant