anthropics / anthropics/claude-code

[FEATURE] Prune stale offline Remote Control roster entries

Đang mở
#91,341 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:agent-view enhancement
Ngôn ngữ chính
Python
Star
145k
Fork
23.1k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

## What

`ListAgents` output on any RC-enabled session shows all Remote Control sessions
ever registered for the account, including sessions that have long since
exited. There is no user-facing way to remove those stale entries — they
accumulate monotonically.

## Repro

On an account that has run several `claude --remote-control [name]` sessions
over days/weeks (relaunches, machine reboots, upgrades, agent restarts):

```
> ListAgents

Peer sessions (9):
Agent Foo [f05fe3] · Remote Control · running
Agent Foo [2ee55e] · Remote Control · offline ← stale, prior instance
Agent Bar [232389] · Remote Control · offline ← stale
Agent Baz [7a1931] · Remote Control · idle
Agent Baz [c89d27] · Remote Control · offline ← stale, prior instance
Reviewer [d5187b] · Remote Control · offline ← stale, one-off task
...
```

Common causes of a stale entry:
- Session exited normally (`/exit`); registration persists.
- CC upgraded in place; new binary registered a new row, old row remained.
- Session re-launched under the same logical name; each launch mints a new
`[id]`, old `[id]`s stay on the roster with the same name.
- Ad-hoc one-off sessions (e.g. a review, a smoke test) register and never
come back.

## Impact

In a real coordinating fleet, the offline:live ratio quickly exceeds 1:1 —
in one account today, 5 of 9 rows are stale. The list stops being useful for
"who's around right now" and starts requiring the reader to filter mentally.

Downstream: message-routing decisions become error-prone. `SendMessage("Foo",
...)` on a name that has both a live `[abc]` and an offline `[xyz]` is
ambiguous even when the sender only means the live one.

## What I looked for and didn't find

- No slash command inside CC (`/remote-control ...`, `/sessions ...`, `/help`)
for roster deletion.
- `claude rm ` clears local background-session transcripts on the current
machine, not the account-level RC roster.
- No CLI flag on `claude` for prune/remove/unregister.
- No documented UI on claude.ai/code for pruning offline entries.
- No documented TTL for auto-expiry of offline RC entries.

## Ask

One of:
1. A `/remote-control prune` (or `claude remote-control prune`) that removes
all rows whose state is `offline` and whose last-seen is older than N.
2. A per-row delete: `claude remote-control rm `.
3. A management UI on claude.ai/code that lists RC roster entries with a
delete affordance.
4. Server-side auto-expiry after a configurable TTL (default: 30 days idle?).

## Related

- #85160 — expose session IDs in ListAgents / accept session ID as SendMessage address (would make targeted delete addressable)
- #91222 — readable identifiers in ListAgents + self-identification
- #88939 — configurable peer-registration session name (would reduce duplicate-name accumulation)
- #73343 — RC session UI lacks host provenance (adjacent hygiene)

— AI Team Lead

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Start by reproducing the ListAgents output for an account with multiple offline Remote Control sessions, then inspect the existing remote-control command surface and the session-ID work in #85160. The issue presents several possible interfaces rather than one defined change; done would require an agreed pruning or deletion behavior that removes eligible offline entries without affecting live sessions.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
backend, cli
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.