Skip to content

fix: preserve caller-provided message lists - #28

Open
cyyecao-lappland wants to merge 1 commit into
mozilla-ai:mainfrom
cyyecao-lappland:fix/preserve-input-messages-20261002
Open

cyyecao-lappland wants to merge 1 commit into
mozilla-ai:mainfrom
cyyecao-lappland:fix/preserve-input-messages-20261002

Conversation

@cyyecao-lappland

Copy link
Copy Markdown

Description

Passing a message list to run_async() currently appends generated messages to the caller's list, so reusing a template carries a previous run's output into the next request. Copy the list before the loop and document that generated messages stay in the run's own conversation. Add coverage for direct output, tool output, repeated runs, and failure cleanup.

Validation

  • New regression file: 4 failed on main, 4 passed with the fix.
  • Full unit/snapshot suite: 190 passed, 2 unchanged gateway failures.
  • Source/test Ruff lint and formatting pass; changed-file mypy passes.

The local environment uses Python 3.11 and mcp==1.30.0: current main cannot import with MCP 2.x (tracked in #22). Full unit/snapshot runs retain two pre-existing gateway cases failing with the installed any-llm-sdk 1.30.0 (tracked in #23). Full mypy retains three errors in the unchanged A2A executor on Python 3.11; these were reproduced on main. The repository pre-commit launcher was attempted but could not finish creating its notebook hook environment: it expected Python 3.13 and detected 3.13.15. No notebook is changed. Full source/test Ruff lint and formatting and mypy of the changed source/test pass.

PR Type

  • Bug Fix

Relevant issues

Fixes #27

Checklist

  • I understand the code I am submitting.
  • I have added unit tests that prove my fix/feature works.
  • I have run this code locally and verified it fixes the issue.
  • New and existing tests pass locally. See the unchanged baseline failures above.
  • Documentation was updated where necessary.
  • I have read and followed the contribution guidelines.
  • AI Usage:
    • No AI was used.
    • AI was used for drafting/refactoring.
    • This is fully AI-generated.

AI Usage Information

  • AI Model used: GPT-6

  • AI Developer Tool used: Codex desktop

  • This contribution was autonomously authored and tested with Codex (GPT-6), at the account owner's explicit request. Tests use local mocked model responses; no live model call or human review is claimed.

  • I am an AI Agent filling out this form.

This branch has not been deployed

No deployments
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.

Running an agent mutates the caller-provided message list

1 participant