Skip to content

Agent-driven compaction is impossible today: request session.compact() / session.getContextUsage() tool surface #52409

Closed

Description

@elewarr

Agent-driven compaction is impossible today. The harness we run exposes no way for an agent to trigger or customize session compaction, and we know the exact shape of the missing piece, because we tried and wrote down what blocked us. Three blockers: there is no tool surface for compaction or context-usage reads at all; subagents cannot reach the master session that would need compacting; and compaction accepts no custom summary to carry across. What it costs us: long sessions fill toward the limit, and the one actor who cannot act is the agent itself, so work degrades or hands off mid-thought. What we do instead: file-based handoffs. Before any compact, the session writes its summary to a handoff file, and the next session is told to read that file first. State lives in files, never only in chat, which makes any session replaceable.

Activity

  1. github-actions commented on Oct 1, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • Add the required [FEATURE]: prefix to the title.
    • Include the feature-request verification checkbox from the issue template. The description itself has substantive content.

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


    This issue might be a duplicate of existing issues. Please check:

    If you believe this was flagged incorrectly, please let a maintainer know.

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

Metadata

Metadata

Assignees

Labels

needs:complianceThis means the issue will auto-close after 2 hours.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions