[fix][evaluation] persist records after eval target timeout#532
Merged
Conversation
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #532 +/- ##
==========================================
+ Coverage 77.29% 77.32% +0.02%
==========================================
Files 657 657
Lines 73820 73826 +6
==========================================
+ Hits 57061 57085 +24
+ Misses 13365 13349 -16
+ Partials 3394 3392 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
lvyingparker
approved these changes
May 25, 2026
ming845378603
approved these changes
May 25, 2026
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.
Summary
Fix evaluation failure persistence when the parent execution context is already canceled.
context.WithoutCancel(ctx), sotarget_recordcan still be written after an invoke timeout or parent context cancellation.logid,trace_id, and converted run error.Root Cause
The synchronous target execution path used the same parent context for both invoking the target and writing the resulting failure records. When the parent context was canceled before persistence, record creation and item/turn log updates could be skipped or fail through canceled context propagation, leaving experiment items stuck in
processingwithout a target record log ID.Validation
go test ./modules/evaluation/domain/service -run 'TestEvalTargetServiceImpl_ExecuteTarget_PersistsFailRecordAfterContextCanceled|Test_ExptItemEvalCtxExecutor_(CompleteSetItemRun|storeTurnRunResult)' -count=1go test ./modules/evaluation/domain/service -count=17590096110691533570failed with persistedtarget_record,logid,trace_id, and error.7590096105115854594, resultsuccesswith target output fieldsactual_outputandtrajectory.Deployment Note
The final branch was deployed through Bits dev self-test task
2401388for CN.stone.cozeloop.evaluationsucceeded with commercial dependency commit7cf57812f18ab36d71c191b69160cb68b14c7da3, which points to this backend pseudo-version.