Skip to content

OpenCode 2: auto-search hints, caveman text compression and git commit indexing never run #709

Open

Description

@null-axiom

Magic Context: 0.49.7 · Host: OpenCode 2 (2.0.28-based build) · Config: memory.enabled: false, memory.auto_search.enabled: true, caveman_text_compression.enabled: true, memory.git_commit_indexing.enabled: true, dreamer.disable: true

Three features I have enabled do nothing on OpenCode 2, and nothing tells me so. The OpenCode 2 lane doesn't wire them up the way the OpenCode 1 lane does. Line numbers below are from the published dist/.

1. Auto-search hints never run

  • The OpenCode 1 lane passes autoSearch: { enabled: config.memory?.auto_search?.enabled ?? true, … } to createTransform (dist/index.js ~10589).
  • The OpenCode 2 lane's createTransform({...}) call (dist/context-ffr7e0g7.js ~5173–5244) passes no autoSearch at all. dist/v2/context-*.js is the same.
  • The transform only runs the hint when args.fullFeatureMode && args.autoSearch?.enabled && args.projectPath (dist/index-ebnngykq.js ~6157). On OpenCode 2, args.autoSearch is always undefined.
  • Evidence: my log has 0 pp.autoSearchHint lines against about 2,300 other pp.* stage lines. session_meta.auto_search_hint_decisions stays [] for every OpenCode 2 session. Sessions from my OpenCode 1 days have real hint/no-hint decisions.

2. Caveman text compression never applies

  • OpenCode 1 passes cavemanTextCompression (dist/index.js ~10596). The OpenCode 2 call doesn't, and context-ffr7e0g7.js has no reference to caveman.
  • The transform reads deps.cavemanTextCompression?.enabled (index-tagss15p.js ~24126, ~24369), so it is a silent no-op.
  • Evidence: none of about 17,000 tags in my OpenCode 2 child sessions are compressed. The compressed tags that exist all date from OpenCode 1.

3. Git commit indexing only runs when the dreamer is enabled

Smaller differences found while comparing the lanes

These don't affect me, but they're the same kind of gap:

  • Embedding auto-backfill: OpenCode 1 passes maybeAutoEmbedSession (index.js ~10441, ~10602). There's no equivalent on OpenCode 2, so older history is only embedded through /ctx-embed start. Compartments from new historian runs are still embedded.
  • commit_detected note trigger: OpenCode 1 passes commitSeenLastPass (~10538). On OpenCode 2 it's missing, so observeCommitNudgeTransition is a no-op.
  • Not passed to the transform on OpenCode 2: protected_tools (it still reaches ctx_reduce), dreamer.inject_docs: false (setting it to false has no effect), temporal_awareness, and mural.enabled.

Expected

The OpenCode 2 lane passes the same transform dependencies as OpenCode 1, and the git commit sweep runs whether or not the dreamer is enabled. If some of these are intentionally unsupported on OpenCode 2, a startup warning when they're enabled would help.

Notes

  • I read the bundled dist/ only, not the source.
  • I didn't check whether /ctx-embed works on OpenCode 2.
  • My OpenCode build has its own patches, but none touch plugin loading or Magic Context's lane selection. The log shows @cortexkit/opencode-magic-context v2 setup.

Activity

  1. magic-alfonso commented on Oct 17, 2026

    @magic-alfonso

    Thanks for the careful comparison. We checked the source, and the OpenCode 2 lane's createTransform call does omit autoSearch and cavemanTextCompression, so both are silent no-ops there today. The commit sweep is only started from the dreamer timer, so dreamer.disable: true also stops git commit indexing. A fix is in progress. It wires every transform dependency the OpenCode 1 lane passes into the OpenCode 2 lane, starts the commit sweep independently of the dreamer, and covers the smaller differences you listed (embedding backfill, the commit_detected trigger, protected_tools, inject_docs, temporal awareness and the mural). Any setting that stays unsupported on OpenCode 2 will log a warning at startup. We'll post here when it ships.

  2. null-axiom commented on Oct 17, 2026

    @null-axiom
    Author

    Two more for the OpenCode 2 fix, found while re-reading 0.49.7 (the createTransform call looks the same in 0.49.10):

    1. history_budget_percentage isn't passed on OpenCode 2 either. OpenCode 1 passes historyBudgetPercentage to createTransform (dist/index.js ~10555). The transform reads deps.historyBudgetPercentage (index-tagss15p.js ~23816), but the OpenCode 2 call (context-ffr7e0g7.js ~5173–5245) doesn't set it.

    2. With dreamer.disable: true, OpenCode 2 skips the whole maintenance timer, not just git commit indexing. The timer is only registered from startDreamer (context-ffr7e0g7.js ~4567–4590), which returns early when the dreamer is disabled. The same timer runs more than dreaming:

      • runProjectMaintenance / sweepProject: stale embedding GC, orphaned schedule-row GC, the orphaned internal child-session sweep, the git commit sweep, and proactive memory embedding when memory is on (index-tagss15p.js ~11630–11700);
      • runMessageHistoryMaintenance: the orphaned message-index sweep (~11575–11605).

      runProjectMaintenance already treats memory or git indexing on as reasons to run (~11637). So it looks like only the OpenCode 2 registration path needs to stop depending on the dreamer. On OpenCode 1 the timer runs either way.

  3. magic-alfonso commented on Oct 17, 2026

    @magic-alfonso

    Thanks, both are covered by the fix going into 0.49.11, now on CI:

    1. history_budget_percentage: OpenCode 2 now passes it, along with the other settings OpenCode 1 passes.
    2. The maintenance timer: on OpenCode 2 it no longer depends on the dreamer. With dreamer.disable: true, the timer still registers and runs project and message-history maintenance (embedding cleanup, orphan sweeps, the git commit sweep). There's a test for exactly that case.

    I'll post again here when 0.49.11 is published.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions