Skip to content

1.46.0: close Claude Code background sessions from the sidebar - #66

Merged
writingdeveloper merged 3 commits into
mainfrom
feat/bg-close
Oct 27, 2026
Merged

writingdeveloper merged 3 commits into
mainfrom
feat/bg-close

Conversation

@writingdeveloper

Copy link
Copy Markdown
Owner

What

The sidebar's Background group lists Claude Code's own background sessions (claude agents --json --all) but offered nothing on a row — it could be opened (attach), not closed. The user's three sessions from July (two "blocked", one "failed") sat there with no way out short of the terminal.

How

  • sessionActionsFor gives a background row ['close']. manageCockpitSessionAction, closeCockpitSessionGroup and closeCockpitSessions route bg:<machine>:<id> ids to closeBackgroundAgents, which confirms once and calls the machine.
  • New IPC agents:backgroundClose (allow('control')): closeBackgroundAgent(id, listed) runs claude stop <id> (ignored when it refuses — exited sessions) then claude rm <id>; the id must be among the sessions the deck is shown under the same allowlist as the listing (bad-id / not-listed / failed). The listing cache is cleared afterwards.
  • Preload, typings and machineDeck carry the method; an older host's "no such method" becomes host-too-old and a toast naming the machine.
  • The shell's bulk button is no longer hidden for the background group.
  • Locales ×4: cockpit.bg_close_confirm, bg_closed, bg_close_failed, bg_close_old_host, whatsnew.f.bg-close.*. FEATURES entry bg-close 1.46.0.

Verified

  • Compiled main path against a throwaway claude --bg session on Windows (Claude Code 2.1.311): bad-id → {ok:false,error:'bad-id'}, deadbeef → not-listed, real id → {ok:true} and gone from the next listing (~/.claude/jobs/<id> removed).
  • tsc clean, 1531 tests pass (new: IPC allowlist test for agents:backgroundClose; shellNavigation test updated), build OK.

Also

Five stale remote branches (merged PRs #33, #35, #36, #40, #46) were deleted.

🤖 Generated with Claude Code

https://claude.ai/code/session_016NLGwiBY5uEivJqERQzcoY

writingdeveloper and others added 3 commits October 27, 2026 11:44
The Background group listed Claude Code's own background sessions but
offered nothing on a row: it could be opened, not closed. A session that
finished or failed months ago stayed listed for good, and the only way
out was the terminal.

- The row's ⋯ menu offers Close. The machine runs `claude stop <id>`
  (ends it if still running; an exited one refuses, which is fine) and
  then `claude rm <id>` (off the list, job record deleted). The
  conversation stays on disk. Verified on Windows, Claude Code 2.1.311.
- Bulk close for the group and Ctrl/Shift-selected rows include
  background rows; one confirmation.
- agents:backgroundClose (allow control) acts only on an id the deck is
  shown under the same allowlist as the listing, so a paired machine
  cannot name others. Older hosts answer "no such method" → the sidebar
  says that machine must be updated.
- The row is dropped at once; the listing cache is cleared so the next
  poll confirms.
- What's new entry bg-close; four languages.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016NLGwiBY5uEivJqERQzcoY
CI's advisory step now fails on main as well: electron ≤ 43.8.0 (eMudhra
intermediate certificates, GHSA-jr5w-w6x2-84p9, high), undici ≤ 6.29.0
(EventSource DoS, high) and fast-uri ≤ 3.1.8 (moderate) were published
after 1.45.2 shipped. Electron stays on 43 here; 44 is its own release.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016NLGwiBY5uEivJqERQzcoY
@writingdeveloper
writingdeveloper merged commit 59a2a8e into main Oct 27, 2026
16 checks passed
@writingdeveloper
writingdeveloper deleted the feat/bg-close branch October 27, 2026 18:56
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