Skip to content

chore: standardize agent_name JSON tag in Message struct#3471

Merged
Sayt-0 merged 1 commit into
docker:mainfrom
Piyush0049:chore/fix-agent-name-json-tag
Jul 6, 2026
Merged

chore: standardize agent_name JSON tag in Message struct#3471
Sayt-0 merged 1 commit into
docker:mainfrom
Piyush0049:chore/fix-agent-name-json-tag

Conversation

@Piyush0049

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR addresses a piece of technical debt by resolving an outstanding TODO in pkg/session/session.go. It standardizes the JSON serialization tag for Message.AgentName from camelCase (agentName) to snake_case (agent_name), aligning it with the repository's JSON schema conventions.

Changes made:

  • Updated the JSON struct tag for AgentName in pkg/session/session.go.
  • Removed the legacy // TODO: rename to agent_name comment.
  • Updated all legacy evaluation fixtures in examples/eval/evals/ and examples/golibrary/tool/ to match the new agent_name schema.

Backwards Compatibility

This is a safe change with zero downtime or backwards-incompatibility for end users:

  • SQLite Database: The session.Message struct itself is not marshaled to the database; it maps directly to a dedicated agent_name SQL column, so existing local databases are completely unaffected.
  • Legacy JSON Files: Go's encoding/json package 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".

@Piyush0049 Piyush0049 requested a review from a team as a code owner July 4, 2026 15:01
@aheritier aheritier added area/sessions For features/issues/fixes related to session lifecycle (resume, persistence, export) area/testing Test infrastructure, CI/CD, test runners, evaluation kind/chore Maintenance, deps, CI, tooling (maps to chore: commit prefix) labels Jul 4, 2026
@Sayt-0

Sayt-0 commented Jul 6, 2026

Copy link
Copy Markdown
Member

Hello @Piyush0049 your commits must be signed in this repo

@Piyush0049 Piyush0049 force-pushed the chore/fix-agent-name-json-tag branch from 0348c3d to 26bff6d Compare July 6, 2026 08:10
@Piyush0049

Copy link
Copy Markdown
Contributor Author

Done! I've amended the commit with the signature, and force-pushed.

@Sayt-0

Sayt-0 commented Jul 6, 2026

Copy link
Copy Markdown
Member

Nice ! Thanks for the contribution !

@Sayt-0 Sayt-0 merged commit 600ba1e into docker:main Jul 6, 2026
8 checks passed
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/sessions For features/issues/fixes related to session lifecycle (resume, persistence, export) area/testing Test infrastructure, CI/CD, test runners, evaluation kind/chore Maintenance, deps, CI, tooling (maps to chore: commit prefix)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants