Skip to content

Session compaction API returns "not available yet" — compact-now skill non-functional #38085

Closed as not planned

Description

@piemanny

Bug Description

The session compaction API POST /api/session/{sessionID}/compact returns:

{"_tag":"ServiceUnavailableError","message":"Session compact is not available yet","service":"session.compact"}

This causes the compact-now skill to return true without performing any actual session compaction.

Reproduction

  1. Start opencode serve: opencode serve --port 4096
  2. Call POST /api/session/{sessionID}/compact on any session
  3. Response: {"_tag":"ServiceUnavailableError","message":"Session compact is not available yet"}

Expected Behavior

The API should either perform session compaction and return success, or return a proper error if genuinely unavailable.

Environment

  • OpenCode version: 1.18.4
  • Server running on port 4096
  • Models: big-pickle (opencode/big-pickle), MiniMax-M2.7-highspeed, deepseek-v4-flash-free

Additional Context

The internal agent=compaction engine runs (visible in server logs) and makes AI calls to generate summaries, but time_compacting is never set in the database — compaction never completes.

Log excerpt showing compaction failures:

level=ERROR message="stream error" agent=compaction error.error="AI_APICallError: Token Plan usage limit reached"
level=ERROR message="stream error" agent=compaction error.error="AI_APICallError: Unauthorized"
level=ERROR message="stream error" agent=compaction error.error="This model's maximum context length is 196608 tokens. However, your messages resulted in 280703 tokens."

Compaction appears to target a dedicated session rather than the session being compacted, and the summarization result is never persisted back to the database (time_compacting stays NULL for all sessions).

Activity

  1. github-actions commented on Sep 20, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions