Repository navigation
fix(tracing): preserve string payloads in HDF5 round trips - #585
Open
Cookie0103 wants to merge 1 commit into
Open
Cookie0103 wants to merge 1 commit into
Cookie0103 wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
HDF5 trace loading still interprets every
{/[-prefixed string as JSON. For example, anEvolutionTrace.llm_responseof{"code": "result = 42"}is returned as a dictionary after an export/load round trip; valid Python expression code such as[1, 2]also changes type. This corrupts the original code/response payload used for trace analysis.Extend the encoding-key marker already used for file-level metadata to each trace group. Only attributes explicitly encoded as JSON are decoded, while unmarked legacy trace groups retain their current loading behavior. This follows the metadata fix in #580/#574 and addresses the remaining per-trace path.
Tests cover an actual
EvolutionTracewith JSON-looking code, response and change-description strings, numeric datasets, JSON-encoded lists/nested artifacts, and an old file without the marker.Validation (Python 3.12, optional
h5pyinstalled):EvolutionTraceround-trip test failed (1 failure out of 8 HDF5 tests).OPENAI_API_KEY=test-key-for-unit-tests python -m unittest discover tests: 1072 tests ran, OK (2 skipped).git diff --checkpassed.No live model request was used. AI assistance: Codex investigated, implemented and validated this contribution on behalf of the account owner, who has not independently reviewed or tested it.