Skip to content

prompt parameter does not work when being passed via an Agent #558

@MarkMurphy

Description

@MarkMurphy

Describe the bug

I'm passing the id to a prompt I've created on the OpenAI platform however it doesn't seem that the agent is using it. I tested it with a simple prompt that states the Agents name is Joe. When I then ask the agent its name it doesn't seem to be using the prompt, here's example of the input/output:

User

What is your name?

Assistant

I'm ChatGPT — an AI assistant.


Here's a simplified version of my code to illustrate how I'm using it:

const agent = new Agent({
  name: 'Agent',
  model: 'gpt-5',
  prompt: {
    promptId: 'pmpt_67dd91dbefbc8195aeab57120734d05809a1f2314c1284c6',
  },
})

const result = await run(agent, 'What is your name?')

Assistant

I'm ChatGPT — an AI assistant.

  • Agents SDK version: v0.1.8
  • Runtime environment: Node.js 22.16.0

When I tried the same thing using the responses API directly, it works just fine. e.g.

const response = await openai.responses.create({
  model: 'gpt-5',
  input: 'What is your name?',
  prompt: {
    id: 'pmpt_67dd91dbefbc8195aeab57120734d05809a1f2314c1284c6',
  },
})

In case it's of any significance, there's an inconsistency in the properties/field names that the prompt parameter takes when calling new Agent({ ... }) vs. openai.responses.create({ ... }) as you can see by comparing the examples above (i.e. id vs. promptId).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions