fix(sessions): resolve agent version lookup#1500
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Purpose / Description
Fix new Kiro session attribution so traces and insights use the agent version from the global Observal lockfile instead of falling back to legacy 1.0.0 when the hook cwd is empty or unrelated.
Fixes
No issue linked.
Approach
The session resolver now reads the global lockfile and matches by explicit agent name or id when
OBSERVAL_AGENT_NAMEis available. Directory remains a disambiguation signal and cwd-only lookup remains available when no agent name exists.The sessions API now returns
agent_versionfor trace list and detail views. The frontend shows agent version in the traces list and Session Info tab.How Has This Been Tested?
Ran:
The smoke test resolved
testto version1.1.2from~/.observal/lockfile.jsonfor both empty and unrelated cwd values.Learning (optional, can help others)
The bug was in CLI-side attribution before ingest. The hook had
OBSERVAL_AGENT_NAME, but version lookup was cwd-first. Kiro user-scoped installs can storedirectoryas~/.observal, while hook cwd can be empty or a repo path, so version was sent as null. Insights intentionally treats null version as legacy1.0.0.No external links used.
Checklist
AI Assistance
Generative AI tooling was used to co-author this PR.