Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/mcp_agent/llm/providers/augmented_llm_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,9 @@ async def _openai_completion(
# Calculate new conversation messages (excluding prompts)
new_messages = messages[len(prompt_messages) :]

# Update conversation history
if system_prompt:
new_messages = new_messages[1:]

self.history.set(new_messages)

self._log_chat_finished(model=self.default_request_params.model)
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/smoke/base/test_e2e_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
from pydantic import BaseModel, Field

from mcp_agent.core.prompt import Prompt
from mcp_agent.llm.memory import Memory

if TYPE_CHECKING:
from mcp_agent.llm.memory import Memory
from mcp_agent.mcp.prompt_message_multipart import PromptMessageMultipart


Expand Down Expand Up @@ -74,7 +74,7 @@ async def test_open_ai_history(fast_agent, model_name):
async def agent_function():
async with fast.run() as agent:
await agent.send("MESSAGE ONE")
await agent.send("MEESAGE TWO")
await agent.send("MESSAGE TWO")

provider_history: Memory = agent.agent._llm.history
multipart_history = agent.agent.message_history
Expand Down
Loading