anomalyco / anomalyco/opencode

Perf: session bootstrap/compaction becomes very slow after ~50 rounds of conversation

Open
#50,063 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Summary

After roughly 50 rounds of conversation, resuming / bootstrapping an existing session becomes noticeably slow — session load, restore, and compaction latency all balloon, and the degradation feels super-linear in transcript size.

Environment

  • opencode (anomalyco/opencode), local CLI, Windows 11
  • Long-lived sessions (50+ rounds), resuming from disk

Expected vs Actual

  • Expected: load/resume time stays roughly proportional to transcript size; compaction runs in the background without blocking interaction.
  • Actual: at ~50 rounds, resuming the session takes a long time; larger transcripts make load/compaction markedly slower.

Suggested areas to investigate

  • Full-file transcript parsing on every resume (no incremental/streamed load)
  • Compaction running synchronously in the interactive/init path instead of backgrounded
  • No lazy hydration of large snapshots -> every resume re-parses the whole session

Acceptance criteria for a fix

  • Session resume time scales near-linearly (or better) with transcript size
  • Compaction is backgrounded / non-blocking
  • No functional regression in session fidelity after compaction

Additional context

Long agent sessions are the main use case for this tool; this is a day-one DX pain point for anyone running long-lived conversations. Happy to provide a profile or minimal repro transcript on request.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named in the report. Start by profiling session resume/load and compaction with a 50+ round transcript, focusing on full-file parsing, synchronous compaction, and snapshot hydration. Done means resume scales near-linearly, compaction does not block interaction, and session fidelity remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.