InMemoryBackend: deep-copy values on Set/Get to fix data race#807
InMemoryBackend: deep-copy values on Set/Get to fix data race#807AbirAbbas wants to merge 2 commits into
Conversation
…d Set/Get and SetVector/GetVector to prevent data races
Performance
✓ No regressions detected |
📊 Coverage gateThresholds from
✅ Gate passedNo surface regressed past the allowed threshold and the aggregate stayed above the floor. |
📐 Patch coverage gateThreshold: 80% on lines this PR touches vs
✅ Patch gate passedEvery surface whose lines were touched by this PR has patch coverage at or above the threshold. |
… paths Exercises the previously-uncovered branches in deepCopyAny ([]any recursion, []float64 copying, default passthrough) and deepCopyFloat64Slice (nil input handling) to satisfy the patch-coverage gate at 80%. No production code changes.
|
|
Summary
deepCopyAnyformap[string]any,[]any, and[]float64applied onSet,Get,SetVector,GetVectorgo vetclean andgo test -race ./agent/Changes
agent/backend/inmemory/inmemory.go— AddeddeepCopyAnyhelper and applied it toSet,Get,SetVector,GetVectoragent/backend/inmemory/inmemory_test.go— Added regression tests that mutate originals and returned values, asserting stored state is unchanged; concurrent access testTest plan
go vet ./agent/...— passes cleango test -race ./agent/...— all tests pass with race detector enabledCloses #432
🤖 Built with AgentField SWE-AF
🔌 Powered by AgentField