mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-30 03:00:41 -04:00
docs(backend/copilot): document tool_calls flattening in extract_context_messages
Add a note to the extract_context_messages docstring explaining that assistant messages derived from JSONL entries have tool_use blocks flattened to text (same behaviour as the old _compress_session_messages path — no regression). Gap messages from DB preserve their structured tool_calls field.
This commit is contained in:
@@ -846,6 +846,12 @@ def extract_context_messages(
|
||||
- Returns *prior* messages only (excluding the current user turn at
|
||||
``session_messages[-1]``). Callers that need the current turn append
|
||||
``session_messages[-1]`` themselves.
|
||||
- **Tool calls from transcript entries are flattened to text**: assistant
|
||||
messages derived from the JSONL use ``_flatten_assistant_content``, which
|
||||
serialises ``tool_use`` blocks as human-readable text rather than
|
||||
structured ``tool_calls``. Gap messages (from DB) preserve their
|
||||
original ``tool_calls`` field. This is the same trade-off as the old
|
||||
``_compress_session_messages(session.messages)`` approach — no regression.
|
||||
|
||||
Args:
|
||||
download: The ``TranscriptDownload`` from GCS, or ``None`` when no
|
||||
|
||||
Reference in New Issue
Block a user