Skip to content

desk: bring agent desks back after a reboot - #35

Merged
simoncrypta merged 1 commit into
review-pr-tuifrom
desk-reboot-restore
Nov 6, 2026
Merged

simoncrypta merged 1 commit into
review-pr-tuifrom
desk-reboot-restore

Conversation

@simoncrypta

Copy link
Copy Markdown
Owner

Part of v0.11.0, stacked on #33. Based on Getting my agents back after a reboot.

What:

  • Records each desk's agent session per Herdr terminal (an opencode TUI plugin plus a Claude hook) under ~/.local/state/bercail/desk-sessions/.
  • On boot, restores only desks whose session was written in the 10 minutes before shutdown, whose pane is a bare shell, and whose session isn't already open elsewhere. It resumes with opencode --session and doesn't resend the prompt.
  • Runs once per boot (with a marker in $XDG_RUNTIME_DIR) from Omarchy's post-boot hook, or from a systemd user unit, and sends a notification with the count.
  • Adds bercail desk restore [--dry-run] and a desk-restore fallback skill for panes that have no record.
  • bercail install/update set it up, and uninstall removes it. CI installs Node for the plugin tests.

Proof: all 31 tests/*.sh and ShellCheck pass. A real stop and start of a desk resumed it on the same opencode session without resending the prompt, and a second boot pass did nothing. No physical reboot was done yet.

Record each desk's agent session per Herdr terminal (opencode plugin, Claude hook) under ~/.local/state/bercail/desk-sessions/. On boot, restore only desks whose session was written in the 10 minutes before shutdown, whose pane is a bare shell, and whose session isn't already open, resuming with opencode --session and no prompt. Runs once per boot from Omarchy's post-boot hook or a systemd user unit, plus bercail desk restore [--dry-run] and a desk-restore fallback skill. Based on https://jankeesvw.com/blog/2026/getting-my-agents-back-after-a-reboot/.
@simoncrypta
simoncrypta added this pull request to stack #36 November 6, 2026 23:26
@simoncrypta
simoncrypta merged commit 6d64e71 into master Nov 6, 2026
2 checks passed
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