Skip to content

bug: manual /compact ignores user intent due to boundary hard-stop #382

@larock22

Description

@larock22

Problem

Manual /compact currently calls force_compact(), but force mode still requires a valid retention boundary. If calculate_retention_boundary() returns 0, the command exits with:

Compaction skipped (no eligible boundary).

For users this is a hard-stop on an explicit command.

Why this is a UX bug

Auto-compaction can be conservative and boundary-safe.
Manual compaction should be user-authoritative (or provide an explicit override mode), not blocked by the same boundary gate.

Current behavior (proof points)

  • src/tunacode/ui/commands/compact.py
    • calls controller.force_compact(...)
    • shows Compaction skipped (no eligible boundary). when outcome is non-compacted
  • src/tunacode/core/compaction/controller.py
    • force_compact() delegates into _compact(...)
    • _compact(...) computes boundary via calculate_retention_boundary(...)
    • returns no_valid_boundary when boundary <= 0
  • src/tunacode/core/compaction/summarizer.py
    • strict boundary validity rules (role/stop_reason/tool_result constraints)

Expected behavior

When the user explicitly runs /compact, command should not dead-end on no_valid_boundary.

Acceptable solutions:

  1. Add manual override mode (/compact --unsafe or equivalent), or
  2. Make /compact path use a fallback policy that still compacts with explicit warning semantics.

Acceptance criteria

  • Repro session that currently returns no_valid_boundary no longer ends with dead skip on manual command.
  • Auto-compaction safety policy remains unchanged for background/threshold triggers.
  • Tests cover manual command outcome contract and boundary/override behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcompact-uxIssues related to /compact command user experience

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions