Skip to content

Support top-level instructions for OpenAI Responses-compatible providers #8388

Description

@CaiJichang212

What do you want to change?

For the regular openai-responses API, Pi currently serializes context.systemPrompt
as a developer or system message inside input.

I would like to add an explicit compatibility option that can instead serialize
that prompt in the top-level Responses instructions field. The current input
behavior would remain the default.

Why?

Some Responses-compatible gateways only inspect the top-level instructions
field. When it is missing, they may inject their own default agent prompt even
though Pi already supplied a system prompt inside input.

This can cause the gateway prompt to override or interfere with Pi's dynamic
system prompt.

How? (optional)

Add a systemPromptFormat option with input and instructions values.

The instructions mode would move the existing system prompt to the top-level
field rather than copying it. Empty prompts would remain omitted, and request
sampling parameters would retain their existing final override behavior.

I have a local implementation and tests ready.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    no-actionThis issue has been rejected after triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions