chore: standardize agent_name JSON tag in Message struct#3471
Merged
Conversation
Sayt-0
approved these changes
Jul 6, 2026
Member
|
Hello @Piyush0049 your commits must be signed in this repo |
0348c3d to
26bff6d
Compare
Contributor
Author
|
Done! I've amended the commit with the signature, and force-pushed. |
Member
|
Nice ! Thanks for the contribution ! |
Sayt-0
pushed a commit
that referenced
this pull request
Jul 6, 2026
Adds a compatibility UnmarshalJSON so session/eval JSON exported before the agent_name tag rename (PR #3471) still loads the agent name. Assisted-By: Claude
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.
What does this PR do?
This PR addresses a piece of technical debt by resolving an outstanding
TODOinpkg/session/session.go. It standardizes the JSON serialization tag forMessage.AgentNamefrom camelCase (agentName) to snake_case (agent_name), aligning it with the repository's JSON schema conventions.Changes made:
AgentNameinpkg/session/session.go.// TODO: rename to agent_namecomment.examples/eval/evals/andexamples/golibrary/tool/to match the newagent_nameschema.Backwards Compatibility
This is a safe change with zero downtime or backwards-incompatibility for end users:
session.Messagestruct itself is not marshaled to the database; it maps directly to a dedicatedagent_nameSQL column, so existing local databases are completely unaffected.encoding/jsonpackage falls back to a case-insensitive field match (AgentName->"agentName") if the struct tag ("agent_name") isn't found in older JSON files. This means legacy exported sessions or evaluation files will still load successfully without dropping the agent name. Future exports will correctly emit"agent_name".