Skip to content

feat: Add GPT-5.4 system prompt optimizations#38953

Closed
rmashate wants to merge 1 commit intoopenclaw:mainfrom
rmashate:feature/gpt-54-prompt-optimizations
Closed

feat: Add GPT-5.4 system prompt optimizations#38953
rmashate wants to merge 1 commit intoopenclaw:mainfrom
rmashate:feature/gpt-54-prompt-optimizations

Conversation

@rmashate
Copy link
Copy Markdown

@rmashate rmashate commented Mar 7, 2026

Summary

Adds a GPT-5.4-inspired prompt section to the agent system prompt in source code, inserted between Tool Call Style and Safety.

What it adds

  • Output contract to reduce verbose or off-format responses
  • Verbosity controls for concise but still complete answers
  • Tool persistence rules to avoid premature stopping in multi-step workflows
  • Dependency checks so prerequisite discovery/lookup happens before action
  • Verification loop before finalizing results or taking side-effecting actions
  • Missing context gating to avoid guessing when context is retrievable or missing

Why

These patterns come from OpenAI's official GPT-5.4 prompting guidance and are model-agnostic. They should improve token efficiency, workflow reliability, action safety, and grounding quality for both OpenAI and Anthropic-backed agents.

Cost

Estimated prompt overhead: ~500 tokens, which seems acceptable relative to the expected gains in answer quality and execution reliability.

Source

Notes

  • Change is made in source (src/agents/system-prompt.ts), not compiled dist/
  • PR opened as draft for discussion and review

Based on OpenAI's GPT-5.4 prompting guide, adds:
- Output contract (prevents verbose/off-format responses)
- Verbosity controls (concise but complete)
- Tool persistence rules (prevents incomplete workflows)
- Dependency checks (ensures prerequisites aren't skipped)
- Verification loop (pre-flight checks before actions)
- Missing context gating (prevents hallucination)

Benefits both OpenAI and Anthropic models.
Token cost: ~500 tokens (acceptable overhead).

Source: https://developers.openai.com/api/docs/guides/prompt-guidance
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Mar 7, 2026
@openclaw-barnacle
Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Apr 22, 2026
@steipete
Copy link
Copy Markdown
Contributor

Thanks for the draft. Closing because this approach has been superseded by the current provider-scoped GPT-5 prompt overlay.

Why this should not land now:

  • The PR adds broad GPT-5.4 prompt text into the global system prompt path.
  • Main now keeps the GPT-5 behavior contract in extensions/openai/prompt-overlay.ts, scoped to the OpenAI/OpenAI Codex provider surface instead of every model/provider.
  • docs/providers/openai.md documents the current OpenAI-specific prompt contribution.

That provider-owned path avoids changing prompts for unrelated providers and is the maintained direction. If we need more GPT-5 prompt tuning later, it should update the current overlay and tests, not add a second global prompt block.

@steipete steipete closed this Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling size: XS stale Marked as stale due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants