Skip to content

fix: show tool names in history and return the model answer - #695

Open
anxkhn wants to merge 1 commit into
a2aproject:mainfrom
anxkhn:fix/no-llm-framework-tool-history
Open

fix: show tool names in history and return the model answer#695
anxkhn wants to merge 1 commit into
a2aproject:mainfrom
anxkhn:fix/no-llm-framework-tool-history

Conversation

@anxkhn

@anxkhn anxkhn commented Aug 20, 2026

Copy link
Copy Markdown

Fixes #438.

Agent.stream stored each MCP call as {'tool': name, ...}, but called_tools_history.jinja reads tool.name. The next decide prompt showed a blank tool name, so the agent could not see what it already called.

When no further tools were needed, the complete event also replaced the last model response with Task completed. Clients that read the final artifact got the placeholder instead of the <Answer> body.

This change stores the history record under name (and includes isError in the template), keeps the last model response as the complete content, and stops emitting Step N / raw history strings as artifact text. Tests render the real Jinja template and check the complete event.

Tested with:

uv run --with pytest --directory samples/python/agents/a2a-mcp-without-framework pytest tests/test_tool_history.py -q

@anxkhn
anxkhn force-pushed the fix/no-llm-framework-tool-history branch 2 times, most recently from 0f2fc95 to 33a6f14 Compare August 25, 2026 18:04
Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
@anxkhn
anxkhn force-pushed the fix/no-llm-framework-tool-history branch from 33a6f14 to be5b333 Compare August 25, 2026 18:05
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.

Bug in pure mcp example (missing tool name)

1 participant