Repository navigation
Conversation
A start whose integration reports its session as it loads (Claude Code's SessionStart, a woken OpenCode's plugin) takes input on that report, with the 3 s settle kept only as a lower bound. A woken OpenCode on a Windows runner rested its screen past the settle before it read keys and lost the resume prompt typed then.
A delivery into a starting or woken agent is now confirmed by the holder: after typing it waits, woken by the PTY, for the text's own end or the agent's paste chip (declared in the agent definition's [input] table) to show where it did not before, types it again up to three times, and refuses with input_not_shown and no Enter when it never shows. A redraw such as a spinner is no confirmation. The fork's rest check and its /fork text are now one step in the holder: a submission guarded at rest is refused with input_not_at_rest when the screen reads the program working or asking, before anything is typed. Old holders and helpers keep the unguarded submit.
Narrow the branch to the hook-report gate. The typed-text confirmation in the holder, its protocol guard, the agents' paste chips and the fork's at-rest check are taken out here and kept on fix/input-on-signal-guard for a follow-up. A start that waits for its integration's session report and reaches its 120 s deadline without one no longer ends as a settled start: its agent takes no input, so a delivery waits or is refused as agent_not_ready, the read at the deadline logs agent.start_report_missed once, and a late report makes it take input.
The engine names each start that waits for its session report a run, typed before the agent's program as HIDE_AGENT_RUN in shells that read it (sh, bash, zsh, dash, ksh, fish, PowerShell); the hook echoes it in its status report, and only a report of that run settles the start. Stale and runless reports still record their session. A start into any other shell names no run and keeps the settle. Link protocol 77 makes a device kit that names no run upgrade.
The start that waits for its session report is now only a woken OpenCode, and only when the pane's machine's kit has its Hide integration installed and on (AgentLaunch::integration_on, read where the core builds the wake). Claude Code and every other start keep the settle, as do a reboot's resumes, which the engine makes before the core read the kit. Docs: the start paragraph, the delivery standard, the status model's Starting line with the deadline failure and its late-report recovery, and the hook report's run.
A wake into a new session (Start new session, or a sleep with no session to resume) starts a fresh OpenCode, which reports no session before its first prompt, so only a start whose arguments carry the definition's resume waits for the report. PowerShell keeps $env: for the session, so the run is set around the start line and the previous value, or its absence, is put back however the line ends; the Windows check runs the line in Windows PowerShell.
yansfil
marked this pull request as draft
November 5, 2026 06:43
Contributor
Author
|
#2114가 대체합니다: 깨운 OpenCode 하나가 아니라 모든 에이전트의 시작과 깨우기가 신호(Windows 콘솔 입력 모드, OpenCode 모델 줄)로 입력을 받습니다. 브랜치는 남겨 둡니다. |
HyunjunJeon
pushed a commit
to HyunjunJeon/hide
that referenced
this pull request
Nov 9, 2026
…2114) Closes with-hide/hide-private#545 Related: with-hide#2087 (이 PR이 대체합니다), 후속 with-hide/hide-private#579 (fork의 쉬는지 확인과 `/fork` 사이 틈), with-hide/hide-private#587 (닿지 않은 입력 다시 보내기와 실패 보고) ## Summary 막 시작했거나 깨운 에이전트에 브리프나 재개 프롬프트를 치는 시점이 "시작하고 3초 뒤"에 기대고 있어서, Windows에서 글자가 사라지곤 했습니다. 이제 프로그램이 키를 읽기 시작했다는 신호를 받고서야 칩니다. - Windows: 홀더가 pane의 콘솔 입력 모드(`ENABLE_LINE_INPUT`)를 읽습니다. 콘솔에는 홀더 자신이 아니라, 시작을 기다리는 동안만 사는 helper 프로세스가 붙습니다. - OpenCode: 키는 읽는데 모델이 뜨기 전에는 Enter를 거절합니다. 그래서 입력창 아래 모델 줄이 보일 때까지 기다립니다(정의 파일의 `[start] ready`). - 신호를 못 주는 옛 홀더나 노드에서는 예전처럼 3초로 정하고, 그 사실을 `agent.start_settled_unread`로 한 번 남깁니다. - 프로그램이 처음 보인 순간에는 그 프로그램의 첫 facts로 판단합니다. 전에는 그 직전 facts로 판단해서, 화면 규칙이 없는 에이전트(omp)가 3초 넘게 걸려 뜨면 아직 줄 편집 중인데도 바로 시작이 끝났습니다(fake journey macOS 로그에서 발견). - Windows에서 아직 콘솔에 묻지 않은 프로그램은 "줄 편집 중"으로 읽습니다. 콘솔은 모든 프로그램을 줄 입력 모드로 시작하기 때문입니다. 전에는 첫 물음(100 ms)까지 "모름"이어서, 3초 넘게 걸려 뜬 에이전트에는 그 사이 입력이 줄에 들어갈 수 있었습니다.   ## Review - **판단해 주세요**: Conductor가 제시한 두 안 중 (a)를 골랐습니다. 콘솔에 붙는 일은 홀더가 다시 띄운 짧게 사는 helper(`hide-holder --console-input <shell pid>`)가 합니다. - 이유: 콘솔에 붙은 프로세스는 콘솔이 닫힐 때(`CTRL_CLOSE_EVENT`) 핸들러가 뭐라 답하든 끝납니다. 홀더가 붙지 않으면 이 일은 구조상 홀더에 일어날 수 없습니다. - (b) "수천 번 겹쳐 돌려도 안 죽는다"는 증명은 없다는 것을 보일 뿐, 막지는 못합니다. - 비용: helper는 pane마다 하나입니다. 프로그램이 전경을 잡고 100 ms가 지난 뒤 처음 읽을 때(재확인, 또는 계속 출력해서 재확인이 오지 않는 프로그램이면 facts)에야 띄우므로 짧은 명령은 띄우지 않습니다. 키를 읽기 전까지만, 최대 120초 삽니다. 프로그램 하나에 두 번까지만 띄웁니다. - **판단해 주세요**: 기기 pane도 같은 신호를 씁니다. 기기의 노드가 자기 홀더에서 같은 `line_editing`을 읽어 보냅니다. - Mac mini에서 Claude Code 6 KB 브리프가 빈 입력창에 들어간 일(spawn-26194)은 그 기기의 노드가 이 빌드로 올라가면 덮입니다. - 옛 노드는 3초로 정하고 `agent.start_settled_unread`를 남깁니다. - **범위(Conductor 결정)**: #545의 완료 조건 중 둘은 이렇게 정리했습니다. - "훅 보고로 Starting을 벗어남"은 진단에서 승인한 신호 방식(콘솔 모드와 화면 준비 표시)이 대신합니다. - "닿지 않은 입력을 다시 보내고, 끝내 안 닿으면 보고된 실패로 끝냄"은 with-hide/hide-private#587 로 옮겼습니다. - **판단해 주세요**: OpenCode가 뒷날 모델 줄 모양(`┃ Build · <model>`)을 바꾸면 매 시작이 120초 마감까지 기다립니다. 입력은 잃지 않습니다. journey와 canary의 OpenCode 칸이 이것을 잡습니다. - **판단해 주세요**: 운영자 사본 정의(`based_on`)에서 `args` 없는 `[start]`는 이제 원본의 args를 물려받습니다. 전에는 빈 목록이었습니다. `ready`만 쓴 `[start]`가 원본의 args를 지우지 않게 하려는 변경입니다. - **조심해서 볼 파일**: - `hide-holder/src/console_input.rs`: helper 수명, 상한, 실패 경로. 아직 묻지 않은 프로그램은 "줄 편집 중"이고, helper를 못 얻었거나 120초를 넘겼을 때만 "모름"이 되어 3초 규칙으로 돌아갑니다. - `hide-platform/src/process/console_input.rs`: Win32 `AttachConsole`, `CONIN$`, `unsafe` 블록. - `herdr-core/src/engine/own/agents.rs`: 시작 규칙 `settled()`, `Live::ready`. 프로그램이 다른 화면을 그리기 전에 보인 준비 화면(깨운 pane에 남은 지난 화면일 수 있음)은 그 화면이 이어지는 동안만 준비로 봅니다. - `hide-agent-adapter/agents/opencode.toml`: 새 `model_line_idle` 규칙. 화면 규칙 버전도 올렸습니다. - **비용 검토**: Unix는 그대로입니다. 재확인은 전처럼 "줄 편집 중"인 동안만 합니다. - Windows는 그 첫 물음 뒤로는 재확인 때만 묻습니다: 키를 읽기 전인 프로그램이 있을 때 100 ms마다 1바이트를 묻고 1바이트를 받습니다. 그 사이의 facts는 마지막 답을 씁니다. - helper를 띄우는 첫 재확인은 붙었다는 답을 최대 2초, 각 물음은 답을 최대 500 ms 기다립니다. 그동안 그 pane의 facts 쓰기도 기다립니다. - 키를 읽으면 helper를 끝내고 더 묻지 않습니다. 120초 안에 키를 읽지 않으면, facts든 재확인이든 그 뒤 첫 읽기에서 "모름"으로 두고 helper를 끝냅니다. 긴 명령(빌드)은 모두 그렇게 끝나므로 로그 줄은 남기지 않고, helper를 못 띄우거나 답이 없을 때만 `holder.console_input_unread`를 남깁니다. ## Evidence - **확인한 것**: - `hide-holder` macOS 126/126. 새 테스트: 계속 출력하다 입력 줄에서 멈추는 프로그램이 출력하는 동안 이미 "줄 편집 중"으로 읽힘(세 시스템), "앞의 프로그램이 줄 편집을 끄면 watch가 알린다"는 테스트가 세 시스템에서 돌고 이제 프로그램을 처음 말하는 facts가 "줄 편집 중"인지도 봅니다. Windows에서는 helper가 콘솔에 붙고 홀더는 붙지 않는 것도 확인합니다. - Windows 단위 테스트(Windows 11 노트북, 진단용): 새로 시작한 프로그램을 처음 말하는 facts가 "모름"이 아니라 "줄 편집 중"임. 시작값을 예전처럼 "모름"으로 돌리면 두 테스트가 `left: Unknown, right: Edits`로 실패하고, 이 수정으로 44/44 통과합니다. 머지 판정은 이 head의 Windows CI입니다. - `hide-agent-adapter` 47/47. OpenCode 2.0.29 실제 화면 캡처 4장으로 모델 줄 규칙을 확인했습니다. 모델 로드 전 화면은 맞지 않고, 로드 뒤 화면 3장은 맞습니다. - `herdr-core` 엔진과 시작 관련 469/469. 첫 facts 판단을 빼면 새 omp 테스트가 실패합니다. 준비 대기를 빼면 새 테스트가 실패하는 것도 확인했습니다. - 격리 후보 앱(이 worktree의 빌드, 개인 HOME과 상태 폴더, 운영자 `HIDE_*` 없음, 가짜 모델): Claude Code 2.1.318을 pane 메뉴로 재우고 Wake agent로 깨우자 3.2초 뒤 준비로 표시됐고, 그때 친 재개 프롬프트가 온전히 들어가 같은 대화에서 답했습니다. OpenCode 2.0.29는 재우면 pane이 닫히고 잠든 세션 행이 남는데, 그 행에서 깨우자 8.5초 뒤(모델 줄을 기다림) 준비로 표시됐고 재개 프롬프트가 온전히 들어가 답했습니다. 위 캡처 둘. 후보 프로세스는 모두 pid로 끝냈습니다. - Windows 레인(`vt (windows)`, head `b93ca71f9`): Windows watch 테스트 셋(helper가 붙고 홀더는 붙지 않음, 콘솔을 읽는 동안 끝나는 프로그램 5번, 출력하다 멈추는 프로그램)과 120초 경계 단위 테스트가 통과했습니다. - fake journey 3회(head `b93ca71f9`, 세 시스템): 시작·brief·신뢰 안 된 시작·재우고 깨우기·재개 칸이 Linux 99/99, macOS 99/99, Windows 96 통과·2 측정 안 함·1 실패였습니다. 실패 1개는 agy 시작으로, Windows에서 agy가 색 답을 키로 읽어 프롬프트 편집기를 여는 기존 문제(with-hide/hide-private#405)입니다. - 같은 3회의 다른 실패: macOS Codex `letter_menu` 2회(입력창 확인이 Hide가 방금 친 편지를 읽어 60초 대기, with-hide/hide-private#600), Windows Codex `guidance_memory` 1회(프롬프트는 다 들어갔고 가짜 모델이 메모 카드 없이 "OK"로 답함). - **확인하지 못한 것**: - 이 head의 Windows CI(새 단위 테스트와 강화한 watch 테스트)는 push 뒤 결과를 기다립니다. - 격리 후보는 상태 폴더를 `agents/runs` 아래가 아니라 `/tmp`의 짧은 폴더에 두었습니다. worktree 경로가 길어 pane 소켓 경로가 macOS 한도(104바이트)를 넘기 때문입니다. 로그는 실행 폴더로 옮긴 뒤 지웠습니다. - 격리 후보에서 준비 전에 친 키(운영자가 일찍 친 키)는 붙잡아 두지 않아 사라집니다. 이 PR이 다루는 것은 Hide가 치는 입력이고, 운영자 키는 예전과 같습니다. <details><summary>Verification record</summary> </details>
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.
Part of with-hide/hide-private#545
Summary
Windows에서 깨운(재개한) OpenCode는 키를 읽기 전에 화면이 3초 넘게 조용해서, 그때 친 재개 프롬프트를 통째로 잃었습니다.
이제 깨운 OpenCode는 시간이 아니라 "이번 실행의 세션 보고"를 받고서야 입력을 받습니다.
HIDE_AGENT_RUN=<토큰>으로 치고, 훅이 보고에 그 토큰을 실어 보냅니다. 토큰이 맞는 보고만 입력을 엽니다. 이전 실행이 늦게 보낸 보고나 토큰 없는 보고는 세션 정보만 갱신합니다.agent.start_report_unawaited로그를 남깁니다.NotReady) 편지는 기다리거나agent_not_ready로 거절되며,agent.start_report_missed를 한 번 남깁니다. 늦게라도 이번 실행의 보고가 오면 그때부터 받습니다.fix/input-on-signal-guard에 남겼고, 모든 훅 에이전트에 보고 게이트를 넓히는 일(테스트 대역이 토큰으로 보고하게 하는 것 포함)과 함께 #545의 후속으로 갑니다.Review
VAR=값 명령형식을 읽지 못하는데, 셸 이름으로는 버전을 모릅니다. 3.1은 2020년 버전이라 받아들였습니다.herdr-core/src/runtime/kit.rsintegration_on_for_pane+runtime/agent_sleep.rs- 연동 확인을 위한 코어에서 엔진으로의 최소 연결입니다. 깨우기 요청을 만드는 자리에서 그 기기 키트를 읽어AgentLaunch::integration_on으로 넘깁니다(Codex 데몬 판단과 같은 방식).hide-agent-hooks/src/report.rsHookStatusReport::run+hide-node-link/src/protocol.rs77 - 훅 보고 wire에 선택 필드 하나를 더했습니다. 기기 경로도 같은HookRequest로 그대로 옮기며, 토큰을 안 싣는 76 기기 키트는 업그레이드시킵니다.herdr-core/src/engine/own/shell_line.rsin_run/takes_run- 운영자 화면의 시작 줄에 토큰이 보입니다(24자 hex, 비밀 아님). PowerShell은$env:가 세션에 남으므로 시작 줄을 try/finally로 감싸 끝나면(정상이든 실패든) 이전 값 또는 없음으로 되돌립니다. Windows check가 Windows PowerShell에서 실제로 돌려 확인합니다.runtime/agent_sleep.rs→agent_sleep_herdr::start_agent): 게이트함. OpenCode, 키트상 연동 켜짐, 토큰을 치는 셸일 때만.HookRequest로 링크를 지나옵니다(프로토콜 77).engine/own/restore.rs): 게이트 안 함. 코어가 키트를 읽기 전입니다.agent_sleep_herdr/dormant.rs): 게이트 안 함(integration_on: false).pane_reopen.rs): 게이트 안 함(integration_on: false).worktree_control.rslaunch_agent,live.rsstart_agent_checked): 게이트 안 함. 깨우기가 아닙니다.ready_after+ 조용한 화면이고, Codex만 입력창 문자열을 따로 봅니다. 세션 보고를 기다리는 단계와 실행 토큰은 Herdr에 없고 Hide가 더한 것입니다.Evidence
[Pasted ~18 lines]) Enter만 먹히지 않았습니다. Enter가 제출됐는지 보는 확인이 필요하고 후속 몫입니다.prompt_agent가agent_not_ready로 거절하고 아무것도 치지 않음, 늦은 이번 실행 보고로 회복. 토큰을 못 치는 셸(nushell), 연동이 꺼진 기기, 새 세션으로 깨운 OpenCode는 보고를 기다리지 않고 정착 뒤 첫 입력을 받음. 셸별 토큰 형식, 링크 왕복에서 토큰 유지.-D warnings통과.remote_delivery는 로컬에서 못 돌렸습니다. 기기 쪽 절반이 macOS에서 소켓 경로 길이 제한으로 돌지 않고, 디스크 여유가 6 GB뿐입니다. 이전 실패는 Claude 대역이 보고를 안 보내서였고, Claude는 이제 정착 규칙이라 원인이 없어졌습니다. CI가 증명합니다.Verification record