Add kata federation lease renew to extend a timed lease before it expires - #334
Merged
Conversation
roborev: Combined Review (
|
roborev: Combined Review (
|
Member
|
looking |
kata federation lease renew to extend a timed lease before it expires
…ction The federation operations guide lists the lease commands operators run, but it did not show the new renew command that the CLI reference and design doc already list. Operators reading only that guide would not know a timed lease can be extended without release and re-acquire. Renew applies only to timed leases. A lease acquired without --ttl is a hard lease, and the hub rejects renewing it. The CLI relied on the daemon for that behavior with no test at the command surface, so this adds one that asserts the user-visible error. The renew command also checked for an empty --ttl itself before calling the shared TTL parser, which already reports whether a TTL was given. The command now uses that result instead of a second check. 🤖 Generated with [Claude Code](https://claude.com/claude-code) (claude-fable-5-1) Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
roborev: Combined Review (
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Timed federation write leases could be acquired from the CLI with
kata federation lease acquire --ttl, but there was no CLI way to extend one. A holder whose lease was about to expire had to release and re-acquire, which drops the lease identity and opens a window for another actor to take the issue. The daemon and the MCP lease tool already supported renewal; only the CLI lacked it.kata federation lease renew <issue-ref> --ttl <duration>now posts to the daemon's existing renew action. The lease keeps its claim UID, its revision advances, and the new expiry is computed from the hub's clock, so the holder keeps exclusive coordination without a gap.--ttlis required and accepts the same whole-unit 60s–24h durations as acquire.Renewal applies only to timed leases. Renewing a hard lease (one acquired without
--ttl) fails with the daemon'shard claims cannot be renewedvalidation error, and renewing a lease held by someone else or no lease at all fails withclaim not held. Both surface as ordinary CLI errors with non-zero exit; there is no path that reports success without the hub extending the lease.Human output prints
renewed lease on <ref> as <holder>, agent output reportsState: renewed, and JSON output is the daemon's lease response unchanged. The command is documented in the CLI reference and the federation design doc.