Skip to content

Event collector and user feedback tracking #13209

Closed as not planned
Closed as not planned

Description

@florianleibert

Task: Event collector and user feedback tracking

Description

Implement the event collection layer that subscribes to opencode's event bus to capture quality-relevant signals. This includes session events, LSP diagnostics, command execution, and inferred user feedback (accept, revert, redo, edit-after-apply). The collector aggregates signals and triggers the scoring engine.

Acceptance Criteria

  • packages/opencode/src/quality/collector.ts created
  • Subscribes to Session.Event.Updated — captures model_id, provider_id, tokens, cost, tool results, errors per assistant message
  • Subscribes to Session.Event.Diff — captures file changes (additions, deletions) for correctness signals
  • Subscribes to LSPClient.Event.Diagnostics — snapshots diagnostic state before/after response for static analysis delta
  • Detects revert signals from Session.Info.revert population — updates feedback score retroactively
  • Detects redo signals via prompt similarity heuristic (same topic within short time window)
  • Detects edit-after-apply via file change tracking (user edits files AI just modified)
  • All feedback signals trigger retroactive score update in SQLite via scorer
  • packages/opencode/src/quality/index.ts created — public API, initializes collector via Instance.state(), exposes Quality.init() and Quality.dispose()
  • Quality system initialized during project bootstrap when quality.enabled is true
  • All event subscriptions cleaned up on dispose

Technical Details

  • Use Bus.subscribe() for event subscriptions following existing patterns
  • Store LSP diagnostic snapshots in memory (Map<path, Diagnostic[]>) to compute deltas
  • For redo detection: hash prompt topics and compare against last N prompts — simple substring/keyword overlap, not full semantic similarity
  • For edit-after-apply: track which files were modified by the last AI response, watch for user modifications to same files within a time window (e.g., 60 seconds)
  • Initialize in packages/opencode/src/quality/index.ts using Instance.state(init, dispose) pattern

Dependencies

  • Task 001: SQLite storage layer
  • Task 002: Quality configuration
  • Task 003: Scoring engine

Effort Estimate

  • Size: L
  • Hours: 8-10
  • Parallel: false (depends on 001-003)

Activity

  1. github-actions commented on Feb 11, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • This issue doesn't use one of our required templates. All issues must use one of these three templates:
      1. Bug Report — for reporting bugs (requires a Description field with real content)
      2. Feature Request — for suggesting enhancements (requires verification checkbox and description, with title starting with [FEATURE]:)
      3. Question — for asking questions (requires the Question field with real content)

    Please edit this issue to follow one of these templates within 2 hours, or it will be automatically closed.

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. github-actions commented on Feb 11, 2026

    @github-actions
    Contributor

    This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

    Feel free to open a new issue that follows our issue templates.

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

Metadata

Metadata

Assignees

Labels

needs:complianceThis means the issue will auto-close after 2 hours.

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions