Skip to content

fix: auto-resume Kiro CLI panes after server restart - #4363

Closed
sahilk335 wants to merge 1 commit into
herdrdev:masterfrom
sahilk335:fix/kiro-session-resume
Closed

sahilk335 wants to merge 1 commit into
herdrdev:masterfrom
sahilk335:fix/kiro-session-resume

Conversation

@sahilk335

Copy link
Copy Markdown

Summary

Fixes Kiro panes coming back as empty shells after a Herdr server restart when resume_agents_on_restore = true.

  • Adds hook-free Kiro session discovery by scanning stock lock files under ~/.kiro/sessions and matching the lock owner pid against the pane's process tree
  • Reports discovered session ids via the existing AgentSessionReported / agent_session persistence path (source: herdr:kiro)
  • Registers Kiro in the resume planner with kiro-cli chat [--v3] --resume-id <SESSION_ID> (V3 ids get --v3)
  • Adds parent_process_id on macOS and Linux; stubs on Windows/fallback

Follow-up to #749 / #4358: Herdr 0.9.1 detects Kiro and persists managed_agent_kind, but never records the conversation session id, so restore has nothing to resume.

Test plan

  • cargo test --bin herdr kiro_session — 4/4 pass
  • cargo test --bin herdr agent_resume — includes new Kiro planner and report validation cases
  • End-to-end on macOS with kiro-cli 2.22.0: V2 and V3 engines survive kill -9 on the Herdr server and restore into the same conversation
  • Linux /proc parent lookup (straightforward, not run here)
  • Windows (discovery stub only)

Made with Cursor

Discover Kiro session ids from stock lock files while the agent is
running, persist them via the existing agent_session path, and relaunch
with `kiro-cli chat [--v3] --resume-id <id>` on restore.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • ai-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 871e8ba4-97a0-4e92-9514-b6bd237eab50

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kangal-bot

Copy link
Copy Markdown
Collaborator

Hi @sahilk335, thanks for your interest in contributing.

Herdr does not accept unsolicited implementation pull requests from contributors who are not listed in .github/APPROVED_CONTRIBUTORS.

The pull request author is not an approved contributor.

If you encountered a reproducible bug, report the observed behavior through the bug issue template. A report does not reserve the work or authorize a pull request; accepted fixes are normally implemented by Herdr’s maintainer-controlled agents.

Feature requests, behavior changes, and other proposals belong in GitHub Discussions. Do not open an issue merely to justify an implementation that was already written.

If a maintainer explicitly wants this implementation, they can reopen the pull request. Reopening by anyone else will be closed again automatically.

See https://github.com/herdrdev/herdr/blob/master/CONTRIBUTING.md for the contribution policy.

@kangal-bot kangal-bot closed this Sep 18, 2026
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.

3 participants