Skip to content

Fix issue #8: CompositeSampler allows later samplers to upgrade RecordOnly to RecordAndSample#9

Closed
thumbrise wants to merge 2 commits into
mainfrom
openhands-fix-issue-8
Closed

Fix issue #8: CompositeSampler allows later samplers to upgrade RecordOnly to RecordAndSample#9
thumbrise wants to merge 2 commits into
mainfrom
openhands-fix-issue-8

Conversation

@thumbrise

@thumbrise thumbrise commented Mar 18, 2026

Copy link
Copy Markdown
Owner

This pull request fixes #8.

The new logic iterates through the samplers and maintains a finalResult. If any sampler returns Drop, that result is immediately returned, preserving the short-circuiting behavior for drops. If a sampler returns RecordOnly, this is noted, and finalResult is updated to RecordOnly. If a sampler returns RecordAndSample, it only updates finalResult if RecordOnly has not yet been encountered. This ensures that if any sampler returns RecordOnly, the final decision will be RecordOnly, effectively implementing an AND-like behavior where any sampler can restrict the decision (to RecordOnly or Drop), but not upgrade it.

@thumbrise

Copy link
Copy Markdown
Owner Author

@openhands-agent Run lint and add godoc to sampler about restrict strategy

@thumbrise thumbrise force-pushed the openhands-fix-issue-8 branch from 584bcac to 66938a5 Compare March 18, 2026 14:14
@thumbrise thumbrise added the fix-me Try solve automatically via AI label Mar 18, 2026
@thumbrise

Copy link
Copy Markdown
Owner Author

OpenHands started fixing the pr! You can monitor the progress here.

@thumbrise thumbrise removed the fix-me Try solve automatically via AI label Mar 18, 2026
@thumbrise thumbrise closed this Mar 18, 2026
@thumbrise thumbrise deleted the openhands-fix-issue-8 branch March 18, 2026 16:34
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.

CompositeSampler allows later samplers to upgrade RecordOnly to RecordAndSample

2 participants