Skip to content

fix(compressor): rename 'Pending User Asks' / 'Remaining Work' to historical framing (#38364)#38368

Closed
ferminquant wants to merge 2 commits into
NousResearch:mainfrom
ferminquant:fix/38364-rename-actionable-compaction-sections
Closed

fix(compressor): rename 'Pending User Asks' / 'Remaining Work' to historical framing (#38364)#38368
ferminquant wants to merge 2 commits into
NousResearch:mainfrom
ferminquant:fix/38364-rename-actionable-compaction-sections

Conversation

@ferminquant

@ferminquant ferminquant commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Renames two compaction summary section headers from actionable framing to purely historical framing:

  • ## Pending User Asks## Outstanding Context
  • ## Remaining Work## Prior Activity

The SUMMARY_PREFIX is also updated to reference the new names. All section descriptions and LLM-prompt instructions are preserved — only the headers change.

Root Cause

The compaction summary body (generated by the LLM summarizer) used section headers with actionable language: "## Pending User Asks" and "## Remaining Work." While the SUMMARY_PREFIX meta-instruction correctly says "latest message WINS" for contradictions and topic changes, its carveout for consistency ("if consistent, use as background") creates a trap: when the user's latest message is vague but topically consistent, the model reads the actionable-sounding headers as the real task definition and silently expands scope beyond what the skill's filters allow.

Format beats framing: the structured task-like headers "## Remaining Work" and "## Pending User Asks" in the body carry more weight than the meta-instruction in the prefix telling the model they are background.

Fix

Ten replacements in agent/context_compressor.py:

Location Old New
Line 9 (docstring) "Remaining Work" replaces "Next Steps" "Prior Activity" replaces "Next Steps"
Lines 49-50 (SUMMARY_PREFIX) '## Pending User Asks' / '## Remaining Work' '## Outstanding Context' / '## Prior Activity'
Line 1171 (fallback template) ## Pending User Asks ## Outstanding Context
Line 1177 (fallback template) ## Remaining Work ## Prior Activity
Line 1225 (docstring) Questions, Files, Remaining Work Questions, Files, Prior Activity
Line 1327 (LLM template header) ## Pending User Asks ## Outstanding Context
Line 1333 (LLM template header) ## Remaining Work ## Prior Activity
Line 1709 (code comment) "Pending User Asks" "Outstanding Context"

Verification

  • scripts/run_tests.sh tests/agent/test_context_compressor.py — 91 passed
  • scripts/run_tests.sh tests/agent/test_summary_prefix_semantics.py — 5 passed
  • scripts/run_tests.sh tests/agent/test_context_compressor_summary_continuity.py — 3 passed
  • scripts/run_tests.sh tests/agent/test_compressor_historical_media.py tests/agent/test_compressor_image_tokens.py — passed
  • scripts/run_tests.sh tests/agent/test_resume_stale_active_task.py — passed
  • python3 -c "import ast; ast.parse(open('agent/context_compressor.py').read()); print('Syntax OK')" — OK
  • grep confirms all 10 occurrences of old names are replaced with new names

Scope Boundaries

Test Plan

  • All compressor-related tests pass (99+ tests across 6 test files)
  • SUMMARY_PREFIX references new section names
  • Both LLM template paths (initial summary + iterative update) use new headers
  • Fallback deterministic template uses new headers
  • No test or source file references old names

Security & Privacy Impact

  • No credentials, tokens, chat IDs, message content, database files, or local session handles are included.
  • The change only renames section header strings in the compaction summarizer prompt template.
  • No new dependencies, API calls, or data access paths.

Checklist

Code

  • I've read the Contributing Guide.
  • My commit messages follow Conventional Commits (fix(scope):).
  • I searched for existing PRs to make sure this isn't a duplicate.
  • My PR contains only changes related to this fix (one file, agent/context_compressor.py).
  • Relevant checks pass: scripts/run_tests.sh on all compressor-related test files, Python syntax check.
  • I've tested on my platform: Linux x86_64 via local pytest + CI Ubuntu runner.

Documentation & Housekeeping

  • Documentation update: N/A — no user-facing behavior, config, CLI, or API docs changed.
  • cli-config.yaml.example update: N/A — no config keys changed.
  • CONTRIBUTING.md / AGENTS.md update: N/A — no workflow or architecture changed.
  • Cross-platform impact considered: Python-only text template change; no OS-specific behavior.
  • Tool descriptions/schemas update: N/A — no tool behavior changed.

For New Skills

  • N/A — this PR does not add or modify a skill.

Screenshots / Logs

  • Test pass logs and syntax verification results are summarized in the Verification section above.

Closes #38364.

…torical framing

'## Pending User Asks' → '## Outstanding Context'
'## Remaining Work' → '## Prior Activity'

These section headers in the compaction summary body used actionable
language that, when combined with a vague but topically consistent user
instruction, caused the model to treat them as active task definitions
rather than background reference. The SUMMARY_PREFIX meta-instruction
('latest message WINS') was correct for contradictions and topic changes,
but the body sections' framing overrode it for the consistent-but-vague
case.

All section descriptions and instructions in the LLM template are
preserved; only the headers changed to unambiguously historical framing.
The SUMMARY_PREFIX text is also updated to reference the new section
names.

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

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

Verdict: Approved

Pure string rename in the context compressor template. The change is exactly what the description says, with no behavioral regressions:

  • "Pending User Asks" → "Outstanding Context"
  • "Remaining Work" → "Prior Activity"

All references in the preamble, template, docstring, and inline comment are updated consistently.

✅ Looks Good

  • Single file changed, scope is surgical
  • Template references updated atomically (preamble, inline comments, docstring)
  • No logic changes, no risk of regression

Reviewed by Hermes Agent

@teknium1

Copy link
Copy Markdown
Contributor

Closing as superseded by PR #44454 (merged), which lands the historical-heading rename across all three template sites plus removal of the "consistent → use as background" carveout — the carveout was the load-bearing part for the scope-expansion you reported in #38364, so renaming alone wouldn't have closed it. Thanks for the report and the PR; both are credited in the merged fix.

#44454

@teknium1 teknium1 closed this Jun 11, 2026
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.

[Bug]: Compaction summary 'Remaining Work' sections silently expand scope of vague but consistent user instructions

4 participants