Skip to content

fix(kiro): attribute sessions by agent id#1505

Merged
Haz3-jolt merged 1 commit into
BlazeUp-AI:mainfrom
Haz3-jolt:fix/kiro-agent-id-attribution
Jun 23, 2026
Merged

fix(kiro): attribute sessions by agent id#1505
Haz3-jolt merged 1 commit into
BlazeUp-AI:mainfrom
Haz3-jolt:fix/kiro-agent-id-attribution

Conversation

@Haz3-jolt

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

Copy link
Copy Markdown
Contributor

Purpose / Description

Fix Kiro session attribution so each pulled agent carries its Observal UUID in its own hook command. This avoids cwd-based guessing and prevents sessions from being assigned to the wrong agent when multiple agents exist.

Fixes

No issue linked.

Approach

Kiro hooks now use OBSERVAL_AGENT_ID=<uuid> instead of agent name. Session push resolves that UUID through ~/.observal/lockfile.json and sends the lockfile id/version. If the UUID is missing or not found, Kiro sessions stay unattributed instead of falling back to cwd.

doctor patch no longer rewrites Kiro agent files with generic hooks because Kiro attribution must be installed per pulled agent.

How Has This Been Tested?

Ran:

python -m pytest tests/test_resolve_agent_version.py tests/test_agent_config_generator.py tests/test_pull_and_agent_cli.py tests/test_cli_harness_adapters.py -q
python -m ruff check observal_cli/harness_specs/kiro_hooks_spec.py observal_cli/sessions/base.py observal_cli/lockfile.py observal_cli/cmd_pull.py observal_cli/hooks/kiro_session_push.py observal_cli/cmd_doctor.py observal-server/services/harness/kiro.py tests/test_resolve_agent_version.py tests/test_agent_config_generator.py tests/test_pull_and_agent_cli.py
python -m ruff format --check observal_cli/harness_specs/kiro_hooks_spec.py observal_cli/sessions/base.py observal_cli/lockfile.py observal_cli/cmd_pull.py observal_cli/hooks/kiro_session_push.py observal_cli/cmd_doctor.py observal-server/services/harness/kiro.py tests/test_resolve_agent_version.py tests/test_agent_config_generator.py tests/test_pull_and_agent_cli.py

Manual smoke:

OBSERVAL_AGENT_ID=a11c53be-a763-44c0-802a-fe15f82fb7fb python - <<'PY'
from observal_cli.sessions.base import _resolve_agent
print(_resolve_agent('', [], None, harness='kiro'))
PY

Result:

('a11c53be-a763-44c0-802a-fe15f82fb7fb', '1.1.2')
image

Learning (optional, can help others)

Kiro JSONL files do not include a reliable top-level active agent identity. The reliable source is the per-agent Kiro hook configuration, so the hook must carry the Observal agent UUID.

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)

No UI changes.

AI Assistance

Was generative AI tooling 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 labels Jun 23, 2026
@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Patch % Lines
observal_cli/lockfile.py 11.11% 8 Missing ⚠️
observal_cli/sessions/base.py 68.42% 6 Missing ⚠️
observal_cli/cmd_doctor.py 0.00% 2 Missing ⚠️
observal_cli/harness_specs/kiro_hooks_spec.py 75.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Co-authored-by: Hemalatha Madeswaran <HemalathaMadeswaran18@users.noreply.github.com>
@Haz3-jolt Haz3-jolt force-pushed the fix/kiro-agent-id-attribution branch from 9c9add1 to 1bffb2a Compare June 23, 2026 13:51
@Haz3-jolt Haz3-jolt merged commit be5c85a into BlazeUp-AI:main Jun 23, 2026
21 checks passed
@Haz3-jolt Haz3-jolt deleted the fix/kiro-agent-id-attribution branch June 23, 2026 13:55
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant