Skip to content

Handle list content when stripping think blocks - #66557

Closed
chaserobertsonn wants to merge 1 commit into
NousResearch:mainfrom
chaserobertsonn:fix/list-content-think-blocks
Closed

Handle list content when stripping think blocks#66557
chaserobertsonn wants to merge 1 commit into
NousResearch:mainfrom
chaserobertsonn:fix/list-content-think-blocks

Conversation

@chaserobertsonn

Copy link
Copy Markdown

Summary

  • flatten list-shaped assistant content before stripping think/tool-call blocks
  • add regression coverage for content-part lists reaching strip_think_blocks

Verification

  • ./venv/bin/python -m pytest tests/agent/test_message_content.py -q
  • ./venv/bin/python -m pytest tests/agent/test_memory_provider.py::TestFlattenMessageContent -q

This fixes a production Donna failure where interim assistant delivery retried until API call #99 with: expected string or bytes-like object, got 'list'.

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P1 High — major feature broken, no workaround duplicate This issue or pull request already exists labels Jul 17, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of #66218: both PRs add list-to-text coercion in strip_think_blocks before regex processing. #66218 is the earlier open implementation.

@kshitijk4poor

Copy link
Copy Markdown
Collaborator

Closing as duplicate — this bug is already fixed on main.

#66567 (by @teknium1, merged Jul 17) added the same list-content coercion at the exact same chokepoint in strip_think_blocks (agent/agent_runtime_helpers.py), with comprehensive block-type handling for thinking/text/output_text blocks. #66945 (by @kshitijk4poor, merged Jul 18) added belt-and-suspenders flatten_message_text() at the _interim_assistant_visible_text call site plus a traceback-based error classifier.

Your fix was correct and targeted the right spot. Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint duplicate This issue or pull request already exists P1 High — major feature broken, no workaround type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants