Skip to content

captureModel should default to the session's model — event.model is already delivered to every hook and never read #139

Closed

Description

@abogartz

Problem

autoCapture: true requires a second config key, captureModel: "provider/id", or capture disables itself (src/index.ts:1152-1163). The justification on offer is consent ("zero-token default"), but that argument does not survive contact with the code:

  • autoCapture: true is already the explicit opt-in. Requiring a second piece of configuration knowledge is not consent, it is a syntax tax — and its failure mode is a console.warn nobody reads, i.e. the same silent shape as the dead-pipeline bug.
  • Inheritance is nearly free, and the data is already in hand. The SDK's SessionRequest type declares a readonly model: Model.Ref, so every session hook the plugin registers already carries the session's actual model — including the session.context hook at src/index.ts:984, which reads event.sessionID and never event.model (grep for a .model property read in src/index.ts returns zero hits). ctx.model.default.get() → {providerID, modelID} | undefined is the fallback.

Fix

  1. Omitted captureModel resolves to the per-session ref last seen on session.context; else ctx.model.default.get(); only if both are missing warn and disable. Today's behaviour becomes the last resort, not the first.
  2. Record model= on every capture evidence line so cost is attributable to a named model — this is the real answer to the cost-surprise concern.
  3. Keep autoCapture default off; the zero-token default is unchanged.

Acceptance

Red-first: autoCapture: true with no captureModel, against a fake host whose session.context carries a model ref, must fire a capture pass with that ref. Red on main today, where it disables instead.

Activity

  1. added
    enhancement
    capture
    severity:low
    agent:ready
    on Oct 26, 2026
  2. abogartz commented on Nov 3, 2026

    @abogartz
    OwnerAuthor

    Triage 2026-11-03: marked agent:ready. Spec reviewed against main 3d34a63: finding stands — src/capture/runtime.ts still disables the whole subscription when captureModel is missing/invalid (no .model read from the session.context event). Acceptance is explicit red-first: autoCapture: true with no captureModel against a fake host whose session.context carries a model ref must fire a capture pass with that ref; red on main today, green after. No overlap with open PR #269.

  3. ocsi-triager commented on Nov 3, 2026

    @ocsi-triager

    osi-spec-hash: 3ae9e1424330770a 2026-11-03T17:21:43Z - acceptance criteria frozen at this text. A later edit to the body changes this hash, and the reviewer will withhold approval until a maintainer replies spec ok.

  4. added
    fix:pr-open
    on Nov 3, 2026
  5. added a commit that references this issue on Nov 3, 2026
  6. abogartz-opencode-self-improvement commented on Nov 3, 2026

    @abogartz-opencode-self-improvement

    🎉 This issue has been resolved in version 0.15.15 🎉

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:readycaptureenhancementfix:pr-openreleasedseverity:low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions