Skip to content

fix(sessions): resolve agent version lookup#1500

Merged
Haz3-jolt merged 1 commit into
BlazeUp-AI:mainfrom
Haz3-jolt:fix/session-agent-version
Jun 23, 2026
Merged

fix(sessions): resolve agent version lookup#1500
Haz3-jolt merged 1 commit into
BlazeUp-AI:mainfrom
Haz3-jolt:fix/session-agent-version

Conversation

@Haz3-jolt

@Haz3-jolt Haz3-jolt commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

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_NAME is available. Directory remains a disambiguation signal and cwd-only lookup remains available when no agent name exists.

The sessions API now returns agent_version for trace list and detail views. The frontend shows agent version in the traces list and Session Info tab.

How Has This Been Tested?

Ran:

python -m pytest tests/test_resolve_agent_version.py
python -m ruff check observal_cli/sessions/base.py tests/test_resolve_agent_version.py observal-server/api/routes/sessions.py
pnpm --dir web typecheck
OBSERVAL_AGENT_NAME=test python - <<'PY'
from observal_cli.sessions.base import _resolve_agent
print(_resolve_agent('', [], None))
print(_resolve_agent('/tmp/not-lockfile-dir', [], None))
PY
image image

The smoke test resolved test to version 1.1.2 from ~/.observal/lockfile.json for 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 store directory as ~/.observal, while hook cwd can be empty or a repo path, so version was sent as null. Insights intentionally treats null version as legacy 1.0.0.

No external links used.

Checklist

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)

AI Assistance

Generative AI tooling was used to co-author this PR.

  • Yes(Please Specify the tool): Pi coding agent
  • Was the generated code manually reviewed and tested?

@github-actions github-actions Bot added cli CLI changes server Pull request touches server code tests Pull request adds or modifies tests web Pull request touches web frontend code labels Jun 23, 2026
@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 17 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
observal-server/api/routes/sessions.py 0.00% 12 Missing ⚠️
observal_cli/sessions/base.py 77.27% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Haz3-jolt Haz3-jolt merged commit 418f06d into BlazeUp-AI:main Jun 23, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI changes server Pull request touches server code tests Pull request adds or modifies tests web Pull request touches web frontend code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant