Repository navigation
feat(agent): send to and list sessions by the agent's own session name - #29
Merged
Merged
Conversation
Claude Code names every session, from the cwd (ko-qmd-70) or by /rename. The listener withholds a cwd-derived name from display, so another agent told to send to that name got UNKNOWN_TARGET. Each session row now carries providerSessionHandle, the record name whoever chose it, and the change fingerprint includes it so a rename is reported at once. Display naming is unchanged.
hwip agent send and hwip agent read now match a session by providerSessionHandle, the name Claude Code shows for it (ko-qmd-70), as well as by tmux name, alias, label and shown name. One match is still required. AMBIGUOUS_TARGET and UNKNOWN_TARGET list each candidate with its handle and state so same-named sessions can be told apart.
hwip agent list --all [--json] lists the sessions agent send can reach on every machine of the account, read from the server's device list: key, host, online, agent, state, alias, shown name and handle. Every table cell is stripped of control characters. Local agent list rows gain handle too. agent read and agent send refuse --all instead of ignoring it, since the agent flag table is shared.
The send branch already refused --turns; a test now pins it. The handle is shown by agent list, so its comments say it is kept out of the app rather than never shown.
The --all table prints names other machines report. Strip the same characters the server's oneLine does, so a key cannot read as another.
This was referenced Oct 31, 2026
Merged
Member
Author
/review — #29 @7a01332Verdict: Approve (Critical 0, Important 0, Nice-to-have 1) Scope Check: CLEAN Findings
확인한 것 (finding 아님)
pre-existing: reviewer fork (opus) · 단일 리뷰어 — 교차 모델 파인더는 |
|
🎉 This PR is included in version 0.1.14 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Summary
다른 세션의 에이전트가 사용자가 부르는 Claude Code 세션 이름(
ko-qmd-70같은 cwd 기반 derived 이름,/rename이름)으로 다른 머신의 세션에hwip_agent_send할 수 있게 한다. 지금은 리스너가 derived 이름을 서버에 올리지 않아UNKNOWN_TARGET이 난다. 보내기 전에 전 머신 세션을 조회하는hwip_agent_list {all:true}·hwip agent list --all도 더한다.이 변경은 레포 4개에 걸친다 — 배포 순서 server → cli → mcp-server(plugin 은 문서). 새 필드는 양쪽 다 optional 이라 어느 순서로 가도 깨지지 않지만, server 가 먼저여야 handle 이 저장된다.
관련 PR (배포 순서): 1. hwipit/hwip#662 (server) → 2. #29 → 3. hwipit/mcp-server#7 · 문서 hwipit/plugin#5
Changes
src/remote-agents.ts—detectClaudeSessionHandle: Claude 세션 레코드의 이름(derived 포함)을 그대로 handle 로. claude 행에resolveSessionHandlesrc/listener.ts— 세션 행에providerSessionHandle,sessionsFingerprint에 포함(handle 만 바뀌어도 바로 리포트)src/agent-target.ts— handle 매칭, AMBIGUOUS 후보에 handle·state, 공용listAgentTargetssrc/agent-list.ts·src/cli.ts·src/args.ts—hwip agent list --all [--json](API 키 필요, 실패 시LIST_FAILEDexit 1). 표의 모든 칸에서 제어문자·bidi·zero-width 문자를 지움src/agent-read.ts— 후보에 handle·state,--all거부src/usage.ts·README.md— 사용법How to Test
Evidence
agent-target.test.ts의 handle 매칭 테스트: 구현 전UNKNOWN_TARGET으로 red → green.--turns거부·bidi 제거 테스트는 조건을 빼는 mutation 으로 red 확인.Risks
src/http-proxy.test.ts8건은 main 에서도 로컬 프록시 환경 때문에 실패 — 이 PR 과 무관해 verify 에서 제외했다.describeCandidate에러 문구의 원격 label·alias escape(기존 경로, 이번에 더한 handle·state 는 서버가 정규화).Merge danger
Door: two-way · Blast radius: cli agent commands
agent listJSON 행에handle필드 추가,agent read·agent send가--all(send 는--turns도) 를 exit 2 로 거부 — 전에는 조용히 무시했다.Alternatives considered
providerSessionName에 derived 이름도 싣기 — 앱 표시 정책(auto-name 숨김)을 깨서 버림. 매칭 전용 필드를 따로 둔다(D1, 사용자 결정).hwip sessions명령·새 MCP 툴 — 기존agent list에all옵션 하나로 충분(D3, 사용자 결정).Auto-decided
providerSessionName으로 매칭됨--allJSON 모양:{v:1, all:true, sessions}— 로컬 행의 상위 집합(host·online·handle·alias 추가)all경로: MCP 클라이언트가GET /devices직접 + 공용listAgentTargets— send 와 같은 기기 목록·키, 구버전 CLI 에--all이 없을 때의 실패 경로가 사라짐KNOWN_RUN_TITLE_MAX관례)Acceptance
providerSessionHandle에 싣고providerSessionName은 지금처럼 비움(앱 표시 불변)resolveAgentTarget(cli·mcp 두 사본)이 handle 로 풀고, 여럿이면 AMBIGUOUS_TARGET 후보에 handle·host·statehwip agent list --all --json·hwip_agent_list {all:true}가 전 머신 세션을 반환verify-check: 8/8 green·audit: ok (5 checked rows at 7a01332)Checklist
/review --full(opus fork + sonnet 교차, 형제 레포 별도) — Critical·Important 0/security-scan(변경분) — SECURE, Low 2(기존 경로) 중 1건 수정🤖 Generated with Claude Code