Skip to content

docs(coding-agents): Kiro CLI application session tracing (TH-8287) - #928

Merged
nik13 merged 8 commits into
mainfrom
feat/th-8287-kiro-cli
Nov 6, 2026
Merged

nik13 merged 8 commits into
mainfrom
feat/th-8287-kiro-cli

Conversation

@nik13

@nik13 nik13 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add Kiro CLI session, turn, and completed-tool tracing using the shared hook-to-OTLP emitter and maintained installer.
  • Register the guide in the integration catalog and remove the obsolete sidebar change and unavailable Kiro IDE link.
  • Replace verification notes with a task-focused guide for Kiro CLI 2.31.1 on macOS (Apple silicon), including project, global, and CLI agent-profile setup.
  • Preserve metadata-only defaults, observe-only guards, installation collision warnings, and session-resume limits.

Validation

GitHub CI runs the integration page contract, catalog/link checks, docs build, and macOS adapter/installer contracts. No local tests or builds are required.

TH-8287. Kiro IDE (TH-8286, #927) remains separate; this guide does not depend on its publication.

Generated with Claude Code

nik13 and others added 4 commits October 14, 2026 20:54
Kiro CLI hooks -> shared hook-to-OTLP emitter. New kiro_cli adapter:
SessionStart (or AgentSpawn/agentSpawn) .. SessionEnd -> session,
UserPromptSubmit .. Stop -> turn with assistant_response as opt-in output,
Pre/PostToolUse -> FIFO-paired tool spans. CLI 2.x camelCase names mapped.
Prints nothing on stdout.

Follows the current Kiro hook docs (CLI V3 SessionStart is canonical),
which supersede the PRD's Agent Spawn-only start. Adds the .kiro/hooks
templates, install.sh, run_e2e.sh, the docs page and nav entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Guard commands, use a CLI-specific install scope, remove PreToolUse, and document V3 tool ids.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… resume-safe SessionEnd (TH-8287)

- Every shipped command (project file, global file, agent-profile entries,
  page snippets) is the canonical subshell guard `(python3 -B <emit.py>
  kiro_cli <Trigger> 2>/dev/null || true)` with the trigger on argv. The
  bare `|| true` form fed a trailing heredoc to `true`.
- tests/test_kiro_cli_hooks_config.py runs every shipped command through
  sh/zsh/bash/dash with the payload on stdin and as a heredoc: emitter
  missing, python3 missing, installed (project, --user from another
  workspace, --user with KIRO_HOME, --agent-profile); exit 0, empty stdout,
  payload verbatim, no __pycache__, plus the unparenthesized regression and
  installer refusal cases.
- Observe-only: the global template no longer registers PreToolUse (gating)
  and the adapter ignores it; tool spans come from PostToolUse without a
  duration; kiro.tool.name (duplicate of gen_ai.tool.name) dropped.
- SessionEnd is not terminal (`kiro-cli chat --resume-id` reuses the session
  id): it closes a still-open turn (kiro.turn.ended_by=SessionEnd) and keeps
  the session state, so a resumed chat continues at turn-2 under the same
  root instead of overwriting turn-1. Tests for resume and Ctrl+C.
- Templates renamed to fi-hook-to-otlp-kiro-cli*.json (the names installed);
  no sed rewrite. install.sh honours KIRO_HOME (writes that path into the
  commands), refuses where the Kiro IDE recipe is installed (project or
  ~/.kiro/hooks) and a project install when the global one exists, says when
  an existing file is stale, and adds --agent-profile (emitter only, prints
  the agent-profile hooks from agent-profile-hooks.json).
- Fixture/page use the V3 tool id file_search; page: install paths and
  KIRO_HOME claim match the installer, guard explained, Windows caveat,
  IDE-in-same-project section with the agent-profile path, SessionEnd row
  with the 2.25 changelog source, kiro.hook.trigger on every 2.x span,
  /upgrade-agent instead of `agent migrate`, incomplete-turn text matches
  the code, Uninstall section.
- run_e2e.sh HOOK_TRANSPORT=stdin|heredoc runs the installed commands.
- Merged the foundation head 9b77d51 (emit.py prints nothing on failure).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
nik13 and others added 2 commits October 15, 2026 13:18
…er double exports (TH-8287)

--agent-profile skipped every collision check, but a CLI session that uses an
agent profile still loads every standalone .kiro/hooks/*.json file. It now
refuses when ~/.kiro/hooks (or $KIRO_HOME/hooks) has the Kiro IDE recipe or
this recipe's global file, and warns when the current directory's project has
either one.

--user now warns about a project install (or the Kiro IDE recipe) in the
directory it runs from and says to remove project installs elsewhere, since it
cannot see other projects. Project and --user installs warn when an agent
profile already runs the emitter. The IDE-collision refusal no longer suggests
--agent-profile, which does not avoid it. Tests and the page cover each case.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@nik13
nik13 marked this pull request as ready for review October 21, 2026 22:18
Base automatically changed from feat/th-8229-cursor-hook-to-otlp to main October 29, 2026 05:37
nik13 and others added 2 commits November 5, 2026 16:46
Merge main and replace the obsolete sidebar entry with shared catalog discovery. Keep installation on the maintained hook-to-OTLP helper, scope the guide to macOS CLI 2.31.1, remove verification diaries and the unavailable IDE link, and retain collision and privacy protections. Run the updated page and installer contracts in GitHub CI.

Co-Authored-By: Claude Code <[email protected]>
Bring in main's Ubuntu 24.04 build runner so the current-head docs checks use the supported Playwright environment.

Co-Authored-By: Claude Code <[email protected]>
@nik13
nik13 merged commit 0872f95 into main Nov 6, 2026
9 checks passed
@nik13
nik13 deleted the feat/th-8287-kiro-cli branch November 6, 2026 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant