Repository navigation
Conversation
provides_for stays ('*', 'agent'), so judge selection still lands here.
A judge evaluation raises before events() runs, and the judge does not score.
_input_messages kept only string history and always appended user_input, so structured history never reached invoke_agent and an empty turn did.
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.
Judges still match this handler because
provides_forstays("*", "agent"). A judge evaluation now raises beforeevents()runs, so the judge prompt does not open the OpenCode session and the judge does not score._input_messagesrecords block-array history on theinvoke_agentspan, using the same text flattening as the other handlers, and does not append an emptyuser_input.provides_foris unchanged. This does not change #159.Note
Overview
The OpenCode handler now detects judge evaluations via OpenTelemetry context and raises before
events()runs, so a judged config does not reopen the OpenCode session on the judge prompt or produce a bogus score. Callers can still useskip_judges=Trueonconfig()to avoid selecting a judge attempt entirely. Docs and examples no longer treatskip_judges=Trueas required for normal agent streaming._input_messagesnow buildsinvoke_agentspan input withcompose_historyandcontent_to_text, matching other handlers: block-array turns are flattened to text, system messages are omitted fromgen_ai.input.messages, and an emptyuser_inputdoes not add a blank user turn.Tests cover judged streaming (
eventscalled once, nojudge_results) and block-array history on the span.Reviewed by Cursor Bugbot for commit e54111d. Bugbot is set up for automated code reviews on this repo. Configure here.