Skip to content

[Feature Request]: A turn's prompt= should extend the agent's prompt, not silently replace it #3324

Closed as not planned

Description

@Lancetnik

Is your feature request related to a problem? Please describe.

Agent._prepare_turn seeds the turn's prompt from the agent's system prompt and dynamic prompts only when the caller passes none (ag2/agent.py:1264: if not context.prompt: ...). A caller that passes prompt= to run() / ask() to add per-turn context therefore silently replaces everything the agent was built with — including the text plugins contribute, such as SkillPlugin's <available_skills> catalog — and dynamic prompts never run.

We hit this in ag2-assistant: the gateway passed per-turn guidance as prompt=, and for months no skill description reached the model; skills were only discovered when the user named them. The fix was to prepend agent.system_prompt by hand, which still skips dynamic prompts.

Describe the solution you'd like

A way to extend the agent's prompt per turn rather than replace it, e.g.:

  • run(..., extra_prompt=[...]) appended after the agent's system + dynamic prompts, or
  • prompt= semantics changed to extend by default, with an explicit replace_prompt=True for today's behaviour.

Either way dynamic prompts (and plugin prompts) should still run for a turn that adds its own text. At minimum, document the replacing behaviour on run() / ask().

Additional context

Activity

  1. added
    type:featureNew functionality or API extension
    status:needs-triageNew: waiting for triage; humans pick it up from here
    area:coreAgent runtime core: ag2/*.py, ag2/events, ag2/response, ag2/streams
    on Sep 30, 2026
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

    area:coreAgent runtime core: ag2/*.py, ag2/events, ag2/response, ag2/streamsstatus:needs-triageNew: waiting for triage; humans pick it up from heretype:featureNew functionality or API extension

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions