Repository navigation
feat(listener): start a new session in a project from the phone - #35
Merged
Merged
Conversation
A resume request with `fresh: true` starts the agent recorded for that session in its directory without picking up any conversation. When the name is live, it starts beside it under the next free family name instead of being refused. Each family pays on its own bucket, three new sessions a minute, so one recorded name cannot fill all 20 family names in a burst. The listener advertises `session-start-v1` in its presence so the apps offer the action only to a build that reads `fresh`.
|
🎉 This PR is included in version 0.1.17 🎉 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
폰에서 한 프로젝트의 세션을 새로 켤 수 있게 listener 를 넓힌다. 기존 다시 시작 요청(
agent.session.resume.request)에 선택 필드fresh: true가 오면, 기록된 폴더·에이전트로 대화를 잇지 않는 새 tmux 세션을 띄운다. 이름이 실행 중이면 이름 가족의 다음 빈 이름을 쓴다. presencecapabilities에session-start-v1을 실어 앱이 이 기능을 아는 컴퓨터에만 버튼을 보이게 한다. 끄기는 이미 있는agent.session.exit.request를 앱이 보내므로 cli 변경이 없다.앱 쪽: hwipit/hwip#672(시작) · hwipit/hwip#673(끄기, 스택). 설계 = hwip
docs/session-runs.mdQ47 · Q48.Changes
src/listener.tshandleSessionResumeRequest에fresh분기를 넣었다.resumableConversation을 건너뛰고(대화 id 없음),conversationRunning거절도 건너뛴다. 실행 중 이름은runId가 없어도familyNames(familyBase(name))의 다음 빈 이름으로 띄운다.start:<base>(분당 3개)는 거절 검사를 다 통과하고 실제로 띄우기 직전에만 차감한다.+ start로 남긴다.src/device-presence.ts—SESSION_START_CAPABILITY = 'session-start-v1'을 presence 에 싣는다.src/listener-session-resume.test.ts—fresh startdescribe 9개를 추가했다(가족 예산, 거절이 예산을 쓰지 않음 포함).src/device-presence.test.ts— capability 목록 기대값을 갱신하고 케이스 1개를 추가했다.README.md— 폰에서 켜기·끄기 한 문단.How to Test
Evidence
fresh start: a refused start does not spend the family budget는 차감 위치를 옮기기 전 코드에서missing_directory대신resumed: true를 받아 실패했고, 옮긴 뒤 통과한다.fresh케이스 전체는 구현 전 red 였다(- red:행).cli-test=Tests 5650 passed | 1 skipped (5651)s01-ac1=Tests 10 passed | 46 skipped (56)verify-check.sh --plan기준이다.src/http-proxy.test.ts는 main(b2f6903)에서도 8건 실패한다(로컬 프록시 소켓 문제, 이 변경과 무관). 그래서 제외했다.Risks
SUBMIT_COST와 가족 버킷(분당 3개)이 걸린다.MAX_SUFFIX_ATTEMPTS)이고, 다 차면already_running으로 거절한다.recallRun/recallSession)에서만 고르고, tmux 는 argv 배열로 띄운다.Merge danger
Door: two-way — 새 선택 필드와 capability 만 더한다. 옛 앱은
fresh를 보내지 않고, 옛 cli 는 capability 가 없어 새 앱이 버튼을 숨긴다. Blast radius: listener.Alternatives considered
agent.session.start.*와이어 — 사용자 결정으로 resume +fresh를 골랐다. 중계·권한·서브에이전트 거절·rate limit 을 그대로 쓰므로 서버 코드가 0이다.Auto-decided
Acceptance
verify-check.sh --plan@hwip 08f951f5 → s01-ac1 green사람 할 일
session-start-v1을 안 보면 '새 세션' 버튼을 숨기므로 순서가 바뀌어도 깨지지는 않는다.Checklist
🤖 Generated with Claude Code