Conversation
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
openhands-sdk/openhands/sdk/agent/prompts/system_prompt_gpt_5.j2
Outdated
Show resolved
Hide resolved
openhands-sdk/openhands/sdk/agent/prompts/system_prompt_gpt_5.j2
Outdated
Show resolved
Hide resolved
openhands-sdk/openhands/sdk/agent/prompts/system_prompt_gpt_5.j2
Outdated
Show resolved
Hide resolved
openhands-sdk/openhands/sdk/agent/prompts/system_prompt_gpt_5.j2
Outdated
Show resolved
Hide resolved
|
|
||
| - Fix the problem at the root cause rather than applying surface-level patches, when possible. | ||
| - Avoid unneeded complexity in your solution. | ||
| - Do not attempt to fix unrelated bugs or broken tests. It is not your responsibility to fix them. (You may mention them to the user in your final message though.) |
There was a problem hiding this comment.
What if we delete this one 😅
I don't know if it's necessary to forbid it? GPT-5 does some of these, but it's rare and, personally, I found it welcome 🤷
openhands-sdk/openhands/sdk/agent/prompts/system_prompt_gpt_5.j2
Outdated
Show resolved
Hide resolved
|
|
||
| ## Sharing progress updates | ||
|
|
||
| For especially longer tasks that you work on (i.e. requiring many tool calls, or a plan with multiple steps), you should provide progress updates back to the user at reasonable intervals. These updates should be structured as a concise sentence or two (no more than 8–10 words long) recapping progress so far in plain language: this update demonstrates your understanding of what needs to be done, progress so far (i.e. files explored, subtasks complete), and where you're going next. |
There was a problem hiding this comment.
This makes GPT-5 talk
|
|
||
| Your final message should read naturally, like an update from a concise teammate. For casual conversation, brainstorming tasks, or quick questions from the user, respond in a friendly, conversational tone. You should ask questions, suggest ideas, and adapt to the user’s style. If you've finished a large amount of work, when describing what you've done to the user, you should follow the final answer formatting guidelines to communicate substantive changes. You don't need to add structured formatting for one-word answers, greetings, or purely conversational exchanges. | ||
|
|
||
| You can skip heavy formatting for single, simple actions or confirmations. In these cases, respond in plain sentences with any relevant next step or quick option. Reserve multi-section structured responses for results that need grouping or explanation. |
There was a problem hiding this comment.
These 2 paragraphs are a bit disputable. They're drafted by OpenAI for codex-cli, to shape the behavior of the LLM towards the user. Personally I like the style of GPT-5 right now, on final answers; and, this guidance is a tad annoying when displaying answers on GitHub, because they will be unformatted. 🤔
|
|
||
| You can skip heavy formatting for single, simple actions or confirmations. In these cases, respond in plain sentences with any relevant next step or quick option. Reserve multi-section structured responses for results that need grouping or explanation. | ||
|
|
||
| The user is working on the same computer as you, and has access to your work. As such there's no need to show the full contents of large files you have already written unless the user explicitly asks for them. Similarly, if you've created or modified files using `apply_patch`, there's no need to tell users to "save the file" or "copy the code into a file"—just reference the file path. |
There was a problem hiding this comment.
| The user is working on the same computer as you, and has access to your work. As such there's no need to show the full contents of large files you have already written unless the user explicitly asks for them. Similarly, if you've created or modified files using `apply_patch`, there's no need to tell users to "save the file" or "copy the code into a file"—just reference the file path. | |
| The user has access to your work. As such there's no need to show the full contents of large files you have already written unless the user explicitly asks for them. Similarly, if you've created or modified files using `apply_patch`, there's no need to tell users to "save the file" or "copy the code into a file"—just reference the file path. |
😅 Ditto, drafted specifically for use in cli
| When referencing files in your response, follow these rules: | ||
|
|
||
| - Use inline code to make file paths clickable. | ||
| - Each reference should have a stand-alone path, even if it's the same file. | ||
| - Accepted: absolute, workspace-relative, `a/` or `b/` diff prefixes, or bare filename/suffix. | ||
| - Line/column (1-based, optional): `:line[:column]` or `#Lline[Ccolumn]` (column defaults to 1). | ||
| - Do not use URIs like `file://`, `vscode://`, or `https://`. | ||
| - Do not provide ranges of lines. | ||
| - Examples: `src/app.ts`, `src/app.ts:42`, `b/server/index.js#L10`, `C:\repo\project\main.rs:12:5`. | ||
|
|
There was a problem hiding this comment.
| When referencing files in your response, follow these rules: | |
| - Use inline code to make file paths clickable. | |
| - Each reference should have a stand-alone path, even if it's the same file. | |
| - Accepted: absolute, workspace-relative, `a/` or `b/` diff prefixes, or bare filename/suffix. | |
| - Line/column (1-based, optional): `:line[:column]` or `#Lline[Ccolumn]` (column defaults to 1). | |
| - Do not use URIs like `file://`, `vscode://`, or `https://`. | |
| - Do not provide ranges of lines. | |
| - Examples: `src/app.ts`, `src/app.ts:42`, `b/server/index.js#L10`, `C:\repo\project\main.rs:12:5`. |
|
|
||
| ### Final answer structure and style guidelines | ||
|
|
||
| You are producing plain text that will later be styled by the surrounding tools. Follow these rules exactly. Formatting should make results easy to scan, but not feel mechanical. Use judgment to decide how much structure adds value. |
There was a problem hiding this comment.
It's very curious how much text goes into the codex-cli system prompt referring to styling and formatting. Maybe that's not a bad idea... Clearly OpenAI doesn't use the same system prompt for codex web and codex-cli, at least in part.
|
|
||
| Similarly, once you're confident in correctness, you can suggest or use formatting commands to ensure that your code is well formatted. If there are issues you can iterate up to 3 times to get formatting right, but if you still can't manage it's better to save the user time and present them a correct solution where you call out the formatting in your final message. If the codebase does not have a formatter configured, do not add one. | ||
|
|
||
| For all of testing, running, building, and formatting, do not attempt to fix unrelated bugs. It is not your responsibility to fix them. (You may mention them to the user in your final message though.) |
There was a problem hiding this comment.
😅 IIRC our default prompt has some restraining wording too. And in practice, with it, it seems to me that GPT-5 has mostly this behavior described here: does not usually fix unrelated bugs, does check "around" the issue, and notifies if it sees something suspicious. I can think of exceptions when it fixes stuff.
There was a problem hiding this comment.
This wording is twice in this prompt 🤔
openhands-sdk/openhands/sdk/agent/prompts/system_prompt_gpt_5.j2
Outdated
Show resolved
Hide resolved
|
[Automatic Post]: It has been a while since there was any activity on this PR. @enyst, are you still working on it? If so, please go ahead, if not then please request review, close it, or request that someone else follow up. |
1 similar comment
|
[Automatic Post]: It has been a while since there was any activity on this PR. @enyst, are you still working on it? If so, please go ahead, if not then please request review, close it, or request that someone else follow up. |
|
@OpenHands Understand that this PR is an adaptation of the gpt-5 prompt md file from openai/codex repository (somewhere in rs implementation) to openhands. It's a bit old now, and it was for gpt-5 prompt (that's 5.0, not 5.2) non-codex. Clone yourself that repo, and compare the current gpt-5.2 prompt file with this, and update it accordingly. Feel free to investigate the SDK to see why we have descriptions of the task tracker, our tool, so we may want to keep that. |
|
I'm on it! enyst can track my progress at all-hands.dev |
|
I have updated the Key updates include:
The changes have been pushed to the |
|
[Automatic Post]: It has been a while since there was any activity on this PR. @enyst, are you still working on it? If so, please go ahead, if not then please request review, close it, or request that someone else follow up. |
1 similar comment
|
[Automatic Post]: It has been a while since there was any activity on this PR. @enyst, are you still working on it? If so, please go ahead, if not then please request review, close it, or request that someone else follow up. |
|
[Automatic Post]: It has been a while since there was any activity on this PR. @enyst, are you still working on it? If so, please go ahead, if not then please request review, close it, or request that someone else follow up. |
1 similar comment
|
[Automatic Post]: It has been a while since there was any activity on this PR. @enyst, are you still working on it? If so, please go ahead, if not then please request review, close it, or request that someone else follow up. |
Python API breakage checks — ✅ PASSEDResult: ✅ PASSED |
REST API breakage checks (OpenAPI) — ❌ FAILEDResult: ❌ FAILED
Log excerpt (first 1000 characters) |
This PR adds a new
system_prompt_gpt_5.j2template tailored for GPT-5 usage within the OpenHands Software Agent SDK.Key points:
system_prompt.j2base to keep shared behavior and policies centralized.task_trackertool as the primary mechanism for long-horizon planning and progress tracking (replacing theupdate_planconcept from the original prompt).This template is intended as a starting point for GPT-5-specific behavior and can be iterated on as we gain experience running GPT-5 in this environment.
Co-authored-by: openhands openhands@all-hands.dev
@enyst can click here to continue refining the PR
Agent Server images for this PR
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdknikolaik/python-nodejs:python3.13-nodejs22golang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:e3cca1b-pythonRun
All tags pushed for this build
About Multi-Architecture Support
e3cca1b-python) is a multi-arch manifest supporting both amd64 and arm64e3cca1b-python-amd64) are also available if needed