Repository navigation
OpenCode 2: auto-search hints, caveman text compression and git commit indexing never run #709
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
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, … }tocreateTransform(dist/index.js~10589). - The OpenCode 2 lane's
createTransform({...})call (dist/context-ffr7e0g7.js~5173–5244) passes noautoSearchat all.dist/v2/context-*.jsis 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.autoSearchis always undefined. - Evidence: my log has 0
pp.autoSearchHintlines against about 2,300 otherpp.*stage lines.session_meta.auto_search_hint_decisionsstays[]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, andcontext-ffr7e0g7.jshas 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
- OpenCode 1 starts the commit-indexing timer on its own (
dist/index.js~12313–12376). - On OpenCode 2, the sweep lives in
registerV2DreamScheduleTimer(context-ffr7e0g7.js~3318–3350), which is only called fromstartDreamer(~4568–4590). That returns early whendreamer.disableis true. - The schema says git commit indexing is independent of
memory.enabled. With the dreamer off, though, it never starts. My log has 0[git-commits]lines, andgit_commitshas 0 rows. - This looks like the On OpenCode 2 the dreamer cron timer can never start: startDreamScheduleTimer is only reachable from the
serverlane, which v2 never invokes #627 fix (dreamer timer on OpenCode 2) tying commit indexing to the dreamer.
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_detectednote trigger: OpenCode 1 passescommitSeenLastPass(~10538). On OpenCode 2 it's missing, soobserveCommitNudgeTransitionis a no-op.- Not passed to the transform on OpenCode 2:
protected_tools(it still reachesctx_reduce),dreamer.inject_docs: false(setting it to false has no effect),temporal_awareness, andmural.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-embedworks 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
magic-alfonso commentedon Oct 17, 2026
Thanks for the careful comparison. We checked the source, and the OpenCode 2 lane's
createTransformcall does omitautoSearchandcavemanTextCompression, so both are silent no-ops there today. The commit sweep is only started from the dreamer timer, sodreamer.disable: truealso 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, thecommit_detectedtrigger,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.null-axiom commentedon Oct 17, 2026
Two more for the OpenCode 2 fix, found while re-reading 0.49.7 (the
createTransformcall looks the same in 0.49.10):history_budget_percentageisn't passed on OpenCode 2 either. OpenCode 1 passeshistoryBudgetPercentagetocreateTransform(dist/index.js~10555). The transform readsdeps.historyBudgetPercentage(index-tagss15p.js~23816), but the OpenCode 2 call (context-ffr7e0g7.js~5173–5245) doesn't set it.With
dreamer.disable: true, OpenCode 2 skips the whole maintenance timer, not just git commit indexing. The timer is only registered fromstartDreamer(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).runProjectMaintenancealready 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.magic-alfonso commentedon Oct 17, 2026
Thanks, both are covered by the fix going into 0.49.11, now on CI:
history_budget_percentage: OpenCode 2 now passes it, along with the other settings OpenCode 1 passes.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.