-
Notifications
You must be signed in to change notification settings - Fork 109
Codex: move system prompts into user input for Responses API #1683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/openai-subscription-auth
Are you sure you want to change the base?
Codex: move system prompts into user input for Responses API #1683
Conversation
all-hands-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found several issues that need attention: overly broad model matching, potential data loss bug, and missing test coverage. Details in inline comments.
| input_items = normalized | ||
|
|
||
| # For subscription Codex transport, use a small, stable instructions string | ||
| # (required by the endpoint) and move the full system prompt into user content. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is actually the right idea, though I’m not sure about the details of the messages.
It seems codex wants its own system prompt basically, more or less
Summary
This PR fixes OpenHands Codex subscription model support by making the Responses API payload Codex-compatible. Codex subscription endpoints can reject complex/long top-level instructions (often returning 400 / “Instructions are not valid”), which breaks agent flows that rely on a large system prompt.
What changed
Why this is needed
Codex subscription endpoints require server-validated instructions and can reject the complex, tool-heavy system prompts typically used by agent frameworks. Moving that content into user input avoids the strict validation while preserving the same guidance/context for the model.
Tests