fix(runners): classify plugin output before persisting events - #7185
Open
jaywang172 wants to merge 1 commit into
Open
jaywang172 wants to merge 1 commit into
jaywang172 wants to merge 1 commit into
Conversation
Contributor
Author
ValidationFull local validation is complete.
Python 3.14 additionally reported 87 skipped, 27 xfailed, and 2 non-strict xpassed tests; tox exited successfully. Additional validation:
All four wheel-installed smoke cases yielded the transformed final event, persisted it to the session, and applied its state delta. The initial Python 3.14 run produced two environment-specific import-loading failures because the local interpreter preloaded GitHub-hosted CI is currently |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to Issue or Description of Change
Closes #7184. Related context: #3990 and #5161.
Problem:
When
on_event_callbackreturns a replacement Event, Runner yields and appends that output but still evaluates persistence eligibility against the original Event. A replacement that changespartial=TruetoFalsereaches the caller as final while its event and state delta are missing from the session. Live content replacements can also be incorrectly excluded or bypass the inline-media filter. Equivalent in-place callbacks behave differently.Solution:
Base persistence eligibility on the effective post-callback Event in node event consumption and plugin execution, including before-run early exits. This preserves the existing callback contract and introduces no new API. It complements #3990's callback-before-persistence behavior; it does not add the separate post-persistence hook proposed in #5161.
Testing Plan
Unit Tests:
Revalidated against
mainat5bc9e8c9:Related-suite command (Python 3.11.9):
Changed-file
pre-commitandgit diff --checkpass.Manual End-to-End (E2E) Tests:
Ran the public Runner reproducer included in #7184 locally with a custom BaseAgent and real InMemorySessionService; no model/network calls. It emits a partial Event and compares in-place modification with replacement from
on_event_callback.This is local Runner E2E, not a real model/backend live session.
Checklist