Skip to content

Compaction: Telemetry and /status for context + decisions #52

@riatzukiza

Description

@riatzukiza

Epic: #46

Summary

Add observability for compaction and pruning decisions to make behavior transparent and debuggable.

Problem

  • Hard to see which messages were kept/dropped and why. No easy token breakdown.

Proposal

  • Log boundaries: preserved turns, summary index, message IDs included.
  • Log pruning: tokens pruned/protected, count of parts affected.
  • Provide /status (or extend existing status) to show token usage by category (user/assistant/tool/reasoning) and compaction readiness.

Code Refs

  • packages/opencode/src/session/compaction.ts (boundary and prune points)
  • packages/opencode/src/session/message-v2.ts (message/part conversions)

Tasks

  • Implement structured logs (with service=, ids, token counts)
  • Implement /status details for compaction/prune state

Acceptance Criteria

  • Developers can see boundary/prune decisions and token breakdowns without reading code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions