Skip to content

fix: add instruction back to provider options for codex oauth models to prevent BAD REQUEST error on Agent Create#20887

Open
OpeOginni wants to merge 5 commits intoanomalyco:devfrom
OpeOginni:fix/create-agent-oai-bad-request
Open

fix: add instruction back to provider options for codex oauth models to prevent BAD REQUEST error on Agent Create#20887
OpeOginni wants to merge 5 commits intoanomalyco:devfrom
OpeOginni:fix/create-agent-oai-bad-request

Conversation

@OpeOginni
Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #20820

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

It adds back the instructions option for oauth openai provider connections, to the Agent Creation function as when removed returns a 400 BAD REQUEST and a responseBody with Instructions are required.

This PR follows the way instructions are passed in the llm.ts file, adding the instruction as providerOptions only for openai oauth connection models in the streamObject function.

How did you verify your code works?

Tested with bun run agent create --log-level=DEBUG --print-logs --pure --model openai/gpt-5.4, and the agent is created without the BAD REQUEST error. Also tested with the gpt-5.3-codex model.

Screenshots / recordings

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@OpeOginni OpeOginni changed the title fix: add instruction back to params for codex oauth provider to prevent BAD REQUEST error fix: add instruction back to provider options for codex oauth models to prevent BAD REQUEST error on Agent Create Apr 3, 2026
@OpeOginni
Copy link
Copy Markdown
Contributor Author

Added back the conditional system message, since its already added to the Instruction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] opencode agent create throws error when using OpenAI as provider

1 participant