Skip to content

feat(capture): arm auto-capture by default - #436

Merged
abogartz merged 2 commits into
mainfrom
feature/autocapture-default-on
Nov 18, 2026
Merged

abogartz merged 2 commits into
mainfrom
feature/autocapture-default-on

Conversation

@abogartz

@abogartz abogartz commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

What changes

Auto-capture is armed unless the config sets autoCapture: false. Before this, both read sites required an explicit true:

const wantCapture = ctx.options?.autoCapture === true;   // src/index.ts
if (ctx.options?.autoCapture === true) {                 // src/capture/runtime.ts

Both now read !== false. captureModel stays optional: an omitted value inherits the session's model, then the host default, so a plain install needs no option to capture. An explicit value that is not provider/id still disables capture rather than substituting a model the user did not type.

This also fixes the README sentence that prompted it — "To turn it on you must also name the model it may use" was stale twice over: the model has not been required since the inheritance work, and the default is now on.

What the states mean now

plugin_load capture= before after
on autoCapture: true + valid model the default
off the default autoCapture: false
switch_mismatch captureOnCompact: true, autoCapture absent autoCapture: false and captureOnCompact: true
invalid_model unchanged unchanged
no_capabilities unchanged unchanged

captureOnCompact: true alone is now simply on, so the runtime warning fires only on a real contradiction. memory_status says off (autoCapture: false) instead of off (default).

The cost of this decision, stated plainly

Every install now makes one model call per turn-end and per compaction, and that call carries a redacted copy of the conversation to the configured model over the user's provider. Reasoning content is excluded, redactSecrets runs first, and candidates face the same write gates as manual writes — but the read leaves the machine. The README says this outright in a "What that default means for your data" paragraph, and the honest caveat keeps the fact that quality and cost are still unmeasured, now beside the fact that the pass runs on installs that set nothing. docs/injection-cost.md gains the matching clause, because "read from session numbers, the plugin's own cost is exactly zero" is more misleading than it was when capture was opt-in.

Test plan — every line run on d789ad9

  • bun run gate green: comment policy (41 added comment lines), tsc, biome, 1,482 unit / 21 skip across 132 files, 35 e2e on the real host
  • new e2e scenario default options: no key set, and the pass still starts — a real opencode run turn with {} as the options object, plugin_load reporting capture=on, pass started on attempt 1, trigger=idle, prompt_chars=[1-9]
  • the five tests that pinned the old default now pin the new one, and each keeps a case for the explicit false:
    • autoCapture false: only the zero-model measured listener subscribes
    • default options: capture is armed, so the capture listener subscribes
    • autoCapture false: the compaction hook stays model-free
    • default options: capture=on, and the subscribed vocabulary is visible + autoCapture false: capture=off, the one opt-out
    • switch mismatch: autoCapture false with captureOnCompact true + captureOnCompact alone is plain on
  • e2e/capture.test.ts control (autoCapture: false → nothing fires, nothing written) still green, so the new default cannot be confused with an always-on pipeline

Notes for review

  • ctx.options is bound to a local at the top of configureAutoCapture. The old === true comparison narrowed the type; !== false does not, so two reads became possibly undefined under tsc.
  • Docs updated where the default is stated: README.md (feature bullet, Auto-capture section, options table, "Am I armed?", troubleshooting row), docs/options.md (autoCapture, captureModel, captureOnCompact), docs/injection-cost.md.
  • ## What memory is worth, measured is untouched, so test/claims.test.ts still pins the published numbers.

Merge order

Base is main. This branch was stacked on docs/voice-on-main (#435), whose Auto-capture section it rewrites; #435 merged as c141779, and the base was retargeted to main by hand because GitHub left it pointing at the closed branch.

git log --oneline origin/main..origin/feature/autocapture-default-on is this one commit, d789ad9, and the diff against main is the 13 files listed above. GitHub reports BEHIND only because the branch lacks c141779 itself, which adds no content beyond the 769f001 this branch already carries.

Read the switch as an opt-out: capture runs unless the config sets
autoCapture:false. An omitted captureModel still inherits the session's
model, then the host default, so a plain install needs no option at all to
capture.

The plugin_load heartbeat and the memory_status line now name the states
against the new default: capture=on is the default, off means an explicit
false, and switch_mismatch requires autoCapture:false with
captureOnCompact:true. captureOnCompact alone is simply on.

The README states what the default means for the user's data: installing the
plugin sends a redacted copy of the conversation to the configured model at
every turn end and compaction, and autoCapture:false is the one-line opt-out.
The honest caveat keeps the fact that quality and cost are still unmeasured,
now beside the fact that the pass runs on installs that set nothing.

Tests: the five cases that pinned the old default now pin the new one, and
each keeps a case for the explicit false. e2e/capture.test.ts adds the
shipping path on a real host - no options at all, pass starts on the first
turn - which passed on attempt 1.

ctx.options is bound to a local at the top of configureAutoCapture: the old
=== true comparison narrowed the type, !== false does not.
@abogartz
abogartz changed the base branch from docs/voice-on-main to main November 18, 2026 22:12
@abogartz
abogartz merged commit aec2247 into main Nov 18, 2026
4 checks passed
@abogartz-opencode-self-improvement

Copy link
Copy Markdown

🎉 This PR is included in version 0.31.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant