Skip to content

Avoid tool JSON in utility history summaries - #1872

Open
Algorithm-zh wants to merge 1 commit into
agent0ai:mainfrom
Algorithm-zh:fix/utility-history-transcript
Open

Algorithm-zh wants to merge 1 commit into
agent0ai:mainfrom
Algorithm-zh:fix/utility-history-transcript

Conversation

@Algorithm-zh

Copy link
Copy Markdown

Summary

  • add a utility-model transcript view that converts assistant tool envelopes into plain text
  • use the sanitized view for topic/bulk summaries and manual chat compaction
  • keep stored history, raw output_text(), and pre-compaction backups lossless

Why

Small utility models can imitate Agent Zero structured tool JSON when raw assistant envelopes are included in summary prompts. The new view keeps final response text or a concise tool headline while omitting reasoning and tool arguments.

Tests

  • python -m pytest -q tests/test_history.py tests/test_chat_compaction.py (10 passed)
  • python -m py_compile helpers/history.py plugins/_chat_compaction/helpers/compactor.py tests/test_history.py tests/test_chat_compaction.py
  • git diff --check

Fixes #1750

@Algorithm-zh
Algorithm-zh force-pushed the fix/utility-history-transcript branch from 0d2fe65 to 9d8290a Compare September 4, 2026 12:36
@Algorithm-zh Algorithm-zh reopened this Sep 20, 2026
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: history.output_text() serializes AI messages as raw JSON, polluting utility-model context

1 participant