Skip to content

fix(s06): wire compact tool's focus parameter into auto_compact#287

Merged
Gui-Yue merged 1 commit into
shareAI-lab:mainfrom
123456wda:fix/s06-compact-focus-param
May 22, 2026
Merged

fix(s06): wire compact tool's focus parameter into auto_compact#287
Gui-Yue merged 1 commit into
shareAI-lab:mainfrom
123456wda:fix/s06-compact-focus-param

Conversation

@123456wda
Copy link
Copy Markdown
Contributor

@123456wda 123456wda commented May 17, 2026

Summary

  • The compact tool in s06_context_compact.py declares a focus parameter in its schema ("What to preserve in the summary") but the handler ignores it entirely
  • The focus value is never passed to auto_compact(), so the parameter has no effect
  • Fixes compact tool declares focus parameter but never uses it #250

Changes

File Change
agents/s06_context_compact.py auto_compact() now accepts optional focus: str parameter
agents/s06_context_compact.py When focus is non-empty, the summarization prompt includes: "Pay special attention to preserving details about: {focus}"
agents/s06_context_compact.py agent_loop captures focus from block.input and passes it to auto_compact

Before / After

Before: Calling compact with {"focus": "the auth refactor"} would compress the conversation but ignore the focus entirely.

After: The focus is passed to the summarization prompt, so the LLM prioritizes preserving details about the specified topic.

Test plan

  • python -m py_compile agents/s06_context_compact.py passes
  • Manual test: calling compact with {"focus": "task system"} produces a summary that emphasizes task system details

The compact tool schema declares a "focus" parameter ("What to preserve
in the summary") but the handler ignored it entirely -- the parameter
was never passed to auto_compact(). Now the focus value is captured from
block.input and included in the summarization prompt so the LLM knows
what details to prioritize when compressing the conversation.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 17, 2026

@123456wda is attempting to deploy a commit to the crazyboym's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Gui-Yue Gui-Yue merged commit 06ac34e into shareAI-lab:main May 22, 2026
3 of 5 checks passed
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.

compact tool declares focus parameter but never uses it

2 participants