Skip to content

fix: silence bootstrap lifecycle events (plugin.added, connector.updated, reference.updated)#58

Merged
pruiz merged 2 commits into
masterfrom
fix/silence-bootstrap-lifecycle-events
Jun 12, 2026
Merged

fix: silence bootstrap lifecycle events (plugin.added, connector.updated, reference.updated)#58
pruiz merged 2 commits into
masterfrom
fix/silence-bootstrap-lifecycle-events

Conversation

@pruiz

@pruiz pruiz commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Problem

New opencode versions emit plugin.added, connector.updated, and reference.updated SSE events during server bootstrap. These hit the UnknownEventRenderer fallback, producing dozens of unknown event type lines per run.

Solution

Drop them silently in StateTracker.ingest() alongside the existing session.updated filter. Events are still recorded in the JSONL transcript for debugging.

Changes

  • tools/events/state_tracker.py — Added the three event types to the silent-drop block.
  • tests/test_new_serve_stack.py — Parametrized test verifying all three return [] from ingest().

Testing

make tests — 844 passed.

…ted, reference.updated)

New opencode versions emit plugin.added, connector.updated and
reference.updated SSE events during server bootstrap.  These are
informational lifecycle signals with no user-facing value and were
hitting the UnknownEventRenderer fallback, producing dozens of
'unknown event type' lines per run.

Drop them silently in StateTracker.ingest() alongside the existing
session.updated filter.  Events are still recorded in the JSONL
transcript for debugging.
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@pruiz, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 38 minutes and 25 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 65646955-0f56-4c8a-abd8-3e22c01257e2

📥 Commits

Reviewing files that changed from the base of the PR and between cb06ce2 and 4888237.

📒 Files selected for processing (2)
  • tests/test_new_serve_stack.py
  • tools/events/state_tracker.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/silence-bootstrap-lifecycle-events

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps

greptile-apps Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Silences three bootstrap-phase SSE events (plugin.added, connector.updated, reference.updated) by adding them to the existing silent-drop branch in StateTracker.ingest(), eliminating the spurious unknown event type noise produced by new opencode versions on startup.

  • tools/events/state_tracker.py: The three new event types join session.updated in a single in-tuple check that returns [], following the exact same pattern already in place.
  • tests/test_new_serve_stack.py: A parametrized test covers all three types, confirming each produces an empty list from ingest().

Confidence Score: 5/5

Safe to merge — the change is a narrow, well-tested addition to an existing silent-drop guard with no effect on other event paths.

The diff touches only two places: a single conditional in ingest() and a matching parametrized test. The three new event types are dropped the same way session.updated has always been dropped, and the test suite (844 passing) validates this directly. No existing behaviour is altered.

No files require special attention.

Important Files Changed

Filename Overview
tools/events/state_tracker.py Added three bootstrap lifecycle event types to the existing silent-drop branch; logic is minimal and follows the established pattern exactly.
tests/test_new_serve_stack.py Parametrized test covering all three new silent-drop event types; each assertion checks that ingest() returns [], which correctly captures the intended behaviour.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[SSE Event received] --> B{event_type?}
    B -- session.error --> C[Return mapped error event]
    B -- session.diff --> D[Return mapped diff event]
    B -- session.updated\nplugin.added\nconnector.updated\nreference.updated --> E[Silent drop — return empty list]
    B -- session.status / session.idle\npermission.asked / server.connected\nserver.heartbeat --> F[Pass-through — return event as-is]
    B -- anything else --> G[Unknown pass-through — return event as-is]
Loading

Reviews (2): Last reviewed commit: "Update tools/events/state_tracker.py" | Re-trigger Greptile

Comment thread tools/events/state_tracker.py Outdated
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown

Coverage Report

Metric Value
Line Coverage 75.8%
Lines Covered 0 / 0

Download detailed HTML coverage reports per OS/Python from the workflow artifacts.

Generated by pytest-cov on 2026-06-12T19:44:42.793Z

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Signed-off-by: Pablo Ruiz García <pruiz@users.noreply.github.com>
@pruiz pruiz merged commit d38d514 into master Jun 12, 2026
7 checks passed
@greptile-apps

greptile-apps Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Want your agent to iterate on Greptile's feedback? Try greploops.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant