Skip to content

fix(kiro): follow KIRO_HOME wherever lich reads Kiro's root - #918

Merged
omartelo merged 1 commit into
mainfrom
ccr-c6db335b-vkapfc
Oct 23, 2026
Merged

omartelo merged 1 commit into
mainfrom
ccr-c6db335b-vkapfc

Conversation

@omartelo

Copy link
Copy Markdown
Collaborator

Fixes #766.

What

Kiro CLI moves its whole root (agents, skills, settings, conversations) with KIRO_HOME (2.21.0, already recorded in docs/providers/kiro.md), but every reader in lich built ~/.kiro off the home alone. With KIRO_HOME set:

  • no transcript: cost, context and the filed title came back empty, and resume said the conversation was gone (kiroSessionPath)
  • History listed no Kiro conversation (kiroConversations)
  • the lich agent carrying the hooks was installed under ~/.kiro/agents, where Kiro never looks (providers.KiroAgentPath), and its global skills resource pointed at ~/.kiro/skills
  • a sandboxed session was not bound the directory it writes into (internal/sandbox)

How

providers.KiroHome(home) is the one resolver: $KIRO_HOME when absolute, else ~/.kiro. A relative value is ignored, the same rule as CursorConfigDir and the sandbox's envDir. All five sites above go through it. The stale KiroAgentPath comment ("honours no environment variable") is corrected.

Tests

  • internal/providers/kiro_test.go: precedence, relative value ignored, agent path under KIRO_HOME
  • TestKiroConversationsFollowKiroHome: the list and kiroSessionPath read under KIRO_HOME and ignore ~/.kiro. It fails without the fix.
  • TestStateDirsFollowsHarnessEnvironment: the sandbox binds KIRO_HOME
  • The existing helpers that plant under ~/.kiro (conversationHome, kiroHome, plantKiroSession, kiroTestHome, repairHome, the resume test, clearHarnessEnv) now clear KIRO_HOME, so a developer's own environment can't move the root out from under them. No assertion changed.

Local gate: gofmt -l . clean, go vet ./... clean, go test ./... green. No OS seam touched.

CHANGELOG.md [Unreleased] › Fixed has an entry. Provider parity: this is a Kiro-only path bug with no new gap, so docs/ceilings.md and the README table are unchanged.


Generated by Claude Code

Every reader built ~/.kiro off the home alone, while Kiro CLI moves its
whole root (agents, skills, settings, conversations) with KIRO_HOME. A
user who set it got no transcript, cost or History rows, an agent
installed where Kiro never looks, and a sandbox that did not bind the
directory the session writes into.

providers.KiroHome is now the one resolver: $KIRO_HOME when absolute,
else ~/.kiro. The transcript lookup, the conversation list, the agent
path, the agent's skill resource and the sandbox bind all go through it.
Test helpers that plant files under ~/.kiro clear KIRO_HOME so a
developer's environment cannot move the root from under them.

Fixes #766

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q26HT8mThLBwUdXqSqzWpd

Copy link
Copy Markdown
Collaborator Author

The red macos job (run 39948953947) is not this PR's failure. Every build, test and smoke step in it passed, including mac-native-smoke.sh ("lich-native came up, connected, drew and closed with lich"). It failed afterwards, in actions/upload-artifact, with Failed to CreateArtifact: Unable to make request: ENOTFOUND, a DNS lookup failure reaching GitHub's artifact service. This PR changes no workflow and nothing about artifacts. All other checks are green: test, both os-tests, windows, windows-build, native-test. I'm re-running the failed job once to confirm.


Generated by Claude Code

@omartelo
omartelo merged commit d0fd628 into main Oct 23, 2026
10 of 11 checks passed
@omartelo
omartelo deleted the ccr-c6db335b-vkapfc branch October 23, 2026 13:13
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.

Kiro CLI transcripts ignore KIRO_HOME

2 participants