Skip to content

Use reasoning content for context summaries#14847

Closed
cocojojo5213 wants to merge 1 commit into
NousResearch:mainfrom
cocojojo5213:codex/context-compressor-reasoning-content
Closed

Use reasoning content for context summaries#14847
cocojojo5213 wants to merge 1 commit into
NousResearch:mainfrom
cocojojo5213:codex/context-compressor-reasoning-content

Conversation

@cocojojo5213

Copy link
Copy Markdown

Summary

  • Route context-compression summaries through extract_content_or_reasoning().
  • Preserve existing non-string content handling by making the helper tolerate non-string message.content payloads.
  • Add a regression test for reasoning-only summary responses.

Why

Some OpenAI-compatible reasoning runtimes can return message.content=None while placing usable text in structured reasoning fields. Context compression previously read response.choices[0].message.content directly, which caused the generated summary to be empty even when extract_content_or_reasoning() could recover the text.

This also keeps the existing llama.cpp-style non-string content path working after switching the compressor to the shared extraction helper.

Validation

  • python -m pytest tests/agent/test_context_compressor.py -q

@alt-glitch alt-glitch added type/bug Something isn't working P1 High — major feature broken, no workaround comp/agent Core agent loop, run_agent.py, prompt builder labels Apr 24, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely overlaps with #4603 which targets the same code path (extract_content_or_reasoning for compression). Please coordinate or close one.

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

Labels

comp/agent Core agent loop, run_agent.py, prompt builder 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.

2 participants