Skip to content

Conversation

@langong347
Copy link

@langong347 langong347 commented Oct 13, 2025

Right now the code couples a role (the system prompt) to an agent instance that also holds the API client. That forces recreating the agent (and its client) every time you want to change role or role behavior, making it harder to:

  • reuse a single client with multiple roles,
  • swap roles quickly in the REPL without reinitializing network clients,
  • test roles in isolation from client configuration.

Proposal: Decouple role (system prompt) from the client by adding a small agent API: set_system_prompt

  • Make set_system_prompt part of the BaseAgent interface.
  • Implement it for OpenAIAgent, AnthropicAgent, and MockAgent

Usage Example:

from openai import AsyncOpenAI
from vibecoder.agents.agent import OpenAIAgent

client = AsyncOpenAI(api_key="OPENAI_API_KEY")
agent = OpenAIAgent(client, system_prompt=<swe_prompt>, tools=...)

# Later switch role without touching the client
agent.set_system_prompt(<analyst_prompt>)

Resolve #1

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

needs a /provider command

1 participant