mirror of
https://github.com/langgenius/dify.git
synced 2026-09-08 19:15:59 +08:00
The console agent log builds one entry per name in the ";"-joined tool column, then looks each name up in a dict keyed by tool name. A tool called twice in one turn produced two entries reading the same key, so both showed the same data -- the display the reproduction in #16220 describes. Keeping every call's input and observation apart, as this branch already did, changed what those two entries show without making them right: each one showed both calls' data instead of one call's data twice. Read the persisted payloads per call instead. MessageAgentThought now exposes tool_inputs_per_call, tool_outputs_per_call and tool_metas_per_call, one entry per entry in tools, in call order, and get_agent_logs walks them alongside the names. A name whose stored value is not one value per call gives the same value to each of its calls, so every record written before those calls were kept apart renders exactly as it renders today. That makes tool_invoke_meta safe to group the same way, which it now is. It carries the provider, the duration and the error the log shows for each displayed call, so leaving it name-keyed would have left a repeated tool showing the last call's provider and duration against both entries. Its other reader, the tool trace, covers the tool rather than one call of it and takes the last call's meta -- the only one it had before. The occurrence selector moves to models.model so the reader that builds the log and the reader that replays history share one definition. Its behaviour is unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_base_trace_instance.py | ||
| test_config_entity.py | ||
| test_lookup_helpers.py | ||
| test_ops_trace_manager.py | ||
| test_trace_queue_manager.py | ||
| test_trace_session_metadata.py | ||
| test_utils.py | ||