Skip to content

Commit the host teardown probe under e2e/support/ and re-measure the handler-await boundary per host release #481

Done

Description

@abogartz

The claim

The contract that auto-capture depends on — does the opencode host await plugin event handlers before exiting? — was measured three separate times during PR #474 with three hand-written probe plugins, and the answer determined the PR's design. Nothing in the repo re-measures it. The finding: on opencode v2.3.0 the host delivers session.execution.succeeded (10/10) but abandons any handler that awaits a timer — the boundary is below 50 ms (0/10 at 50, 200, and 2000 ms). Sync writes, async-first writes, and microtasks all flush; anything awaiting I/O that needs a macrotask is cut.

What to do

  1. Commit one probe plugin under e2e/support/: register a handler on the turn-end event that awaits a ladder of durations (0, 10, 50, 200 ms) and records which completions land before process exit. Deterministic, self-contained, no model call needed.
  2. Run it as part of the release checklist — or as an e2e test tagged to run only against the installed host — and record the boundary per host version in docs/internals/auto-capture-evidence.md.
  3. If a future host completes the 50 ms rung, two things become reconsiderable and should be flagged automatically rather than remembered: the pre-receipt blind band in src/capture/runtime.ts (a cut during the context read or the awaited knownRowsFor/loadAll leaves no line) can shrink, and auto_capture_dispose can be upgraded from predictive to a real diagnosis.

Why it matters

The whole capture teardown design is built on a measurement of someone else's release cadence. A host change can invalidate it in either direction — silently re-breaking delivery assumptions, or leaving mitigations in place that the host no longer needs — and today nobody would notice until a user did.

Where

Probes written during PR #474 (author's and two reviewers'); the follow-up the PR body files. The ladder result (below 50 ms) comes from the round-2 review's measurements.

Activity

  1. added
    enhancement
    capture
    severity:low
    agent:ready
    on Nov 21, 2026
  2. added
    tier:micro
    on Nov 23, 2026
  3. removed
    agent:ready
    on Nov 25, 2026
  4. WhollyMindless commented on Nov 26, 2026

    @WhollyMindless
    Contributor

    Note

    🤖 GPT-6.2 Sol responding on behalf of WhollyMindless

    I’ll take #481. I’ll add the reusable teardown probe, record the observed handler-await behavior by host version, and flag any host that completes the 50 ms wait before shutdown. The probe will stay separate from capture behavior.

  5. abogartz-opencode-self-improvement commented on Nov 27, 2026

    @abogartz-opencode-self-improvement

    🎉 This issue has been resolved in version 0.37.2 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

  6. WhollyMindless commented on Nov 27, 2026

    @WhollyMindless
    Contributor

    Note

    🤖 gpt-6-astra responding on behalf of WhollyMindless

    Filed the Windows cleanup finding upstream: anomalyco/opencode#66868.

    The independent 16-line probe records setup but no cleanup entry after a successful run --standalone on OpenCode 2.4.2 and 2.0.26. Closing an explicit server's stdin ownership lease invokes and completes the same asynchronous cleanup. The report includes the standalone runner, exact output, and discovery context from #554 / PR #560.

    This differs from the earlier fixed plugin-side cancellation issue in #404: here the host never calls plugin cleanup. The upstream report links both project issues and the reproduction.

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

    captureenhancementreleasedseverity:lowtier:micro

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions