Compactor tool for the agent #105

Open
opened 2026-05-23 16:33:51 -04:00 by jasoncouture · 0 comments
jasoncouture commented 2026-05-23 16:33:51 -04:00 (Migrated from github.com)

MCP tool exposing compaction so the agent can request it explicitly instead of waiting for the framework to fire automatically. Lets the model say "I'm done with this task, fold the working set" at a natural seam.

Surface:

  • Tool name like `compact_context` or `fold_session`.
  • Optional argument: `focus` (free-form hint about what to keep verbatim) — heuristics may honor or ignore.
  • Returns: tokens-before / tokens-after, count of turns collapsed, summary preview.
  • Idempotent: a fresh call right after a compaction is a no-op (or returns the prior result) until new turns accumulate.

Considerations:

  • Cooldown to prevent the agent looping on compaction.
  • Audit/event so operators see when compaction was agent-initiated vs. framework-initiated.

Depends on the framework-side compaction work (#11 + heuristics sibling) — tool is a thin wrapper once the engine is solid.

MCP tool exposing compaction so the agent can request it explicitly instead of waiting for the framework to fire automatically. Lets the model say \"I'm done with this task, fold the working set\" at a natural seam. Surface: - Tool name like \`compact_context\` or \`fold_session\`. - Optional argument: \`focus\` (free-form hint about what to keep verbatim) — heuristics may honor or ignore. - Returns: tokens-before / tokens-after, count of turns collapsed, summary preview. - Idempotent: a fresh call right after a compaction is a no-op (or returns the prior result) until new turns accumulate. Considerations: - Cooldown to prevent the agent looping on compaction. - Audit/event so operators see when compaction was agent-initiated vs. framework-initiated. Depends on the framework-side compaction work (#11 + heuristics sibling) — tool is a thin wrapper once the engine is solid.
Sign in to join this conversation.
No description provided.