fix: silence opencode lifecycle events and stabilize parity fixture#63
Conversation
📝 WalkthroughWalkthrough
ChangesStateTracker Silent Drop for New Event Types
Mock LLM Script Update
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~4 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Greptile SummaryThis PR silences three noisy lifecycle event types (
Confidence Score: 5/5Safe to merge — the change only adds event types to an existing silent-drop list and is backed by new parametrized tests. The diff is minimal and targeted: three well-understood lifecycle event types are moved out of the unknown-event path into the silent-drop path, exactly mirroring the volatile-config subset already listed in No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Event arrives at StateTracker.ingest] --> B{event_type?}
B -->|session.error| C[Return error event]
B -->|session.diff| D[Map and return]
B -->|lifecycle/config events| E["Silent drop — return []"]
B -->|passthrough events| F[Return event as-is]
B -->|other known types| G[Accumulate / handle]
B -->|unknown| H[UnknownEventRenderer]
subgraph "Silent-drop set (after PR)"
I["session.updated\nplugin.added\nplugin.updated\nconnector.updated\nreference.updated\ncatalog.updated\nintegration.updated"]
end
E --- I
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[Event arrives at StateTracker.ingest] --> B{event_type?}
B -->|session.error| C[Return error event]
B -->|session.diff| D[Map and return]
B -->|lifecycle/config events| E["Silent drop — return []"]
B -->|passthrough events| F[Return event as-is]
B -->|other known types| G[Accumulate / handle]
B -->|unknown| H[UnknownEventRenderer]
subgraph "Silent-drop set (after PR)"
I["session.updated\nplugin.added\nplugin.updated\nconnector.updated\nreference.updated\ncatalog.updated\nintegration.updated"]
end
E --- I
Reviews (3): Last reviewed commit: "test: avoid opencode shell output race i..." | Re-trigger Greptile |
Coverage Report
Generated by pytest-cov on |
… lifecycle events Add catalog.updated, integration.updated, and plugin.updated to the StateTracker's silent-drop set, consistent with existing handling of plugin.added, connector.updated, and reference.updated. Closes #62
3367187 to
4607f2a
Compare
|
Review follow-up summary:
The PR title/body have been updated to make these intentional scope additions explicit. Latest CI is green across all 6 matrix jobs. |
Adds
catalog.updated,integration.updated, andplugin.updatedto the StateTracker's silent-drop set, consistent with existing handling ofplugin.added,connector.updated, andreference.updated.These are volatile opencode startup/config lifecycle events already classified as ignorable in
_PARITY_IGNORED_TYPES. Without this fix they pass through toUnknownEventRendererand print noisyunknown event type:lines.Changes:
tools/events/state_tracker.py— extended the silent-drop tuple for lifecycle/config eventstests/test_new_serve_stack.py— added parametrized test cases for the new silently dropped event typestools/mock-llm-scripts/comprehensive.json— changed the deterministic bash fixture toprintf 'hello\n'; sleep 0.05to avoid the opencode 1.17.x shell output drain race observed in CIReview follow-up:
plugin.updatedwas added after review because it is already listed in_PARITY_IGNORED_TYPESand is the direct sibling of existingplugin.addedhandling.Validation:
tests/test_mock_llm_parity.py::TestMockLLMParity::test_parity_scriptpassed, 5/5tests/test_new_serve_stack.py::TestStateTracker::test_bootstrap_lifecycle_events_silently_droppedpassed, 6/6Closes #62