Repository navigation
feat: add Desk, a room whose chosen agent starts and follows sessions through hide - #1913
Merged
Merged
Conversation
hide-desk is the ACP client Desk drives the operator's chosen agent with: the tied host process, the ndjson connection, the session in each adapter's ask mode, the pinned npm install, and the permission rule that lets only Desk's own hide commands and file reads run without a card.
…l cards The core's Desk worker starts the chosen agent's ACP adapter tied to hided, holds it in its ask mode, answers each permission request by the Desk rule and waits on an approval card for the rest. hided binds a capability to that process so its hide commands act as hide:desk in delivery only. The conversation, choices and settings are kept in state/desk/desk.json and sent as the desk and desk_live sections.
…d agent archive Desk's spawns past its places wait in a persisted queue and start as hide:desk when one frees; each job is a card derived from the ledger and the row the sidebar draws (queued, starting, working, asking, done, failed, cancelled, closed, moved out, archived). A new session's tab goes into its checkout's Desk group once, the operator's close, move out and typing are remembered, and a watch follows it. Hand-offs and started jobs leave a line in the conversation. The work placement setting reaches the agent with its first message. hide agent archive does what the screen's session archive does.
A job card carries its row's status mark and read ask, the sleeping state, what an asking job waits on, the code a failed start ended with, and every View its session opened with whether it was seen; reading a card reads the row as the sidebar does. Desk's own replies fold their turn into thinking time and step counts, the live section says when the turn started, and a letter line carries its kind, first line and whether it was taken in. The Pi ask-mode marker check moves into the Desk crate, beside the process it proves.
…grouped tab as moved out
…status its screen draws
… only the hide commands the core takes from Desk
…tch's answer, and send Desk's cards once a publish in their own section
…aude as unable to ask
…when a card changes
# Conflicts: # contracts/hide-cli.json # contracts/snapshot-wire-enums.json # herdr-core/src/delivery/worker.rs # herdr-core/src/model.rs # herdr-core/src/runtime/delivery.rs # hided/src/cli_contract.rs # hided/src/workspace_cli.rs # web/src/components/desk/desk-composer.tsx
# Conflicts: # contracts/hide-cli.json # docs/delivery.md # hided/src/agent_cli.rs
yansfil
added a commit
that referenced
this pull request
Oct 31, 2026
…he lane from its column head (#1915) Related: #1913 (merged; this PR builds on it, base `main`) ## Summary Desk's right side now works: the rail's ☰ opens the Threads list and one thread in the tool column, and ▣ opens the outputs a thread made in the 보기 column as preview tabs. Cards, `답하기` and a session chip open their thread there instead of jumping to the Agent tab. A mission chip opens its map beside the Conductor's thread, and a node switches to that worker's thread. ⌘J goes between a thread and its Agent tab, and back. The lane's 📌 moves from the rail's bottom to the head of the column at the lane's edge, before ✕, in Desk and in the project lane alike. Desk is now off until it is turned on in Settings › Desk (`Use Desk`), since it is still in development. Off, the sidebar has no `◆ Desk` row, a thread's Agent tab has no `Desk로`, ⌘J is not Hide's and Desk's agent does not run. Turning it on shows Desk at once, with no restart; turning it off ends Desk's agent and keeps the sessions it started as ordinary sessions, and if the Desk room was in front, the tab used before it comes back. | Settings › Desk, off (the default) | On | | --- | --- | |  |  |  With Desk off the sidebar starts at Overview: no `◆ Desk` row.  Look at the column head: 📌 sits before ✕, and the rail keeps only ☰ (with the asking count) and ▣. Five screen defects the verify run found in the candidate app are fixed here; each pair is the same scene in an isolated candidate, before (dead645) and after (98ef95a1): the pinned lane keeps its width instead of growing to 692 and squeezing the chat to 360; a lane over the chat moves the chat's words clear instead of cutting them; the 보기 tabs share their width by the View tab strip's rule instead of overlapping; a planning mission's chip is grey in Desk as in the sidebar; a thread row keeps `main · Done` whole. | | Before | After | | --- | --- | --- | | Pinned Threads |  |  | | Over, both columns |  |  | ## Review - **판단해 주세요**: a page output is drawn as its still and address with `그 자리에서 열기`, not as a live browser (D-40 asked for a live one). The live page belongs to the checkout that opened it; a second live copy in Desk is a follow-up. - **판단해 주세요**: a mission chip's colour now comes from the web's one rule (`missionToneOf`), so the core no longer sends `tone`; Desk's `deciding` is now "a decision waits while the mission is open", as the sidebar reads it. - **판단해 주세요**: the project lane's pin is now only drawn while the lane is up (a closed lane has no column head to hold it). - **판단해 주세요**: ⌘J moves to ⌥⇧J (Alt+Shift+J on Windows and Linux) in a browser tab, marked moved for Chrome, since Chrome keeps Ctrl+Shift+J for DevTools; the desktop app keeps ⌘J and Ctrl+Shift+J (its DevTools key is Ctrl+Shift+I). - **판단해 주세요**: Desk's switch is kept in the core's Desk store with its other settings, so every window follows it; a store written before this PR reads as off, so someone already using Desk turns it on once. - **판단해 주세요**: off, the rest of Settings › Desk is dimmed and out of reach with its values kept, as Hide AI's are; Settings › Shortcuts still lists ⌘J for rebinding, while the shortcut sheet drops it. - **판단해 주세요**: the PRD's "사이드바 ◆ Desk 그룹" is read as the sidebar's `◆ Desk` row; a checkout's `◆ Desk` tab group Desk made earlier stays as the operator's tab group. | 정한 것 | 이유 | | --- | --- | | Desk off keeps the spawns waiting in its queue, starts none and removes none; turned on again, they start in order | Off erases nothing Desk made (D-76), and nothing should start while Desk is off (Conductor's decision) | | The desktop app's View menu has no `Desk thread ⇄ terminal` while Desk is off; the page tells the host the switch (`hide:desk`) as it tells it the bindings and the language | The menu's accelerator answers ⌘J before the page does, so hiding the row in the page alone left the chord working | | `openDesk` and `deskTerminal` refuse while Desk is off, whichever menu, host chord or button asks | One guard where every path ends | | The shortcut sheet drops Desk's row while off; Settings › Shortcuts keeps it, binding and all | Off hides Desk, and a stored binding is the operator's to keep | - **조심해서 볼 파일**: `herdr-core/src/runtime/desk.rs` - Desk off refuses every `desk_*` event but `desk_settings_set` (`desk_off`) and checks no agent; turning it off ends the process as `다시 시작` does. Also new `desk_lane` and `desk_output_seen` events; pin and kept tabs live in Desk's store, 16 kept tabs at most, a 17th refused as `desk_tabs_full`. - **조심해서 볼 파일**: `herdr-core/src/runtime/desk/jobs.rs` - outputs now only `is_output` Views (B30) with their device, checkout and path; new `workers` cards for a mission's workers (64 at most), built from the same card index as the job cards in one publish. - **조심해서 볼 파일**: `herdr-core/src/runtime/unseen_views.rs` - `mark_view_seen` split out of `settle_seen_views`, so looking at an output in Desk reads it as looking at it in its checkout. - **조심해서 볼 파일**: snapshot wire - `desk.lane`, `desk_jobs.workers` and four new fields on an output. This overlaps #1913's wire; it merges after it. - **비용 검토**: no new resident work. `workers` shares the job cards' index (one build a publish) from data already under the lock; an output seen saves no Desk store; an output's bytes are read through the existing `file_bytes` path only while its tab shows. - **원칙**: state the core owns (pin, kept tabs) is in the core with a cap and a reported refusal (engineering 4, 15); the window's columns stay in `ui.ts` (web/CLAUDE.md). Both lanes draw one pin part, `LanePinButton` (design 5). The lane shows a state only where the operator acts on it: the ☰ count and the ▣ dot (design 13). ## Evidence - **확인한 것**: `web/e2e/desk-lane.spec.ts` 3 passed on a real Herdr and hided: ☰ list, thread, ‹ back, ☰ closes, ▣ empty; 📌 docks, Escape leaves a pinned lane, the pin survives a reload, unpinned Escape closes and focuses the composer; ⌘J and `터미널로` go to the Agent tab and ⌘J/`Desk로` come back with the thread open. - **확인한 것**: the 11 e2e files that use the project lane's pin ran: 49 passed, 2 failed on the moved pin (button counts, unpin before the lane was up); both fixed and passed. - **확인한 것**: core `cargo nextest` desk, lane and unseen_views filters, 81 passed, incl. the pin and kept tabs coming back after a restart, the cap refusal, workers found by their panes, and an output seen in Desk leaving Needs You. - **확인한 것**: `bash scripts/verify-web.sh` exit 0 on e5e4c5f (web 2383, desktop 302), `cargo` lint clean, `check-design-contract.mjs` passes. - **확인한 것**: verify's isolated candidate (Electron over CDP, private Herdr and HOME) at 98ef95a1: pinned Threads lane 400 wide with the chat 1052 → 652 (before 692 and 360); both columns over the chat 692 wide with the chat's words left of it; tabs 132 px each with titles ending in an ellipsis; planning chip grey in sidebar, card and Threads row; job-c reads `main · Done`. - **확인한 것** (switch, ac33053): `desk-lane.spec.ts` 4 passed, the new one on a real Herdr and hided: no `◆ Desk` row and no `Desk로` on a new install, both appear when Settings › Desk turns on without a restart, and turning it off in the room brings back the focused pane before it with Desk's session still open and no `Desk로`; the other three turn Desk on first. The shortcut sheet e2e lists 60 rows with no Desk row by default. - **확인한 것** (switch): core tests `desk_is_off_by_default_and_only_its_switch_reaches_it_while_off` (no order reaches the worker while off, on sends a check) and `switching_desk_off_ends_its_process_and_keeps_its_conversation` (cancel and end sent, the waiting card closed, the conversation kept, `hide:desk` commands refused); `DeskScreen.test` covers the sidebar entry and leaving the room. - **확인한 것** (review fixes, 9beed04): desktop e2e `desk-switch.spec.ts` on the real Electron build: no `desk_terminal` menu item while Desk is off, `Command+J` once Settings turns it on, gone again when off; `menu.test` checks the same for macOS and Windows/Linux (`Control+Shift+J`); an `actions.test` case sends the host's `desk_terminal` with a Desk thread in front and `openDesk` while off and sees no move (it fails without the guard), and checks the host is told on and off; core test `a_queued_spawn_waits_while_desk_is_off_and_starts_when_it_is_on_again` keeps a queued spawn waiting with a place free while off and starts it when on (it fails without the queue's check). - **확인하지 못한 것**: the switch was not run in the packaged app; Windows and Linux run the same web and core code and are left to CI's e2e lanes. - **확인하지 못한 것**: the mission chip and a node click (B34) are covered by unit tests of the lane state, not by an e2e; the stack runs no Conductor. - **확인하지 못한 것**: an output's diff lines were not captured; the image, document and page stills were drawn in the gallery only. - **확인하지 못한 것**: the PR mark in a Desk card chip has no hint, so the carryover note about its pointer events needed no change. <details><summary>추가 증거</summary> Verify defects, the rest of the pairs (before dead645, after 98ef95a1, same scene numbers as the verify run): | | Before | After | | --- | --- | --- | | 11 tabs |  |  | | 25 three tabs, mission |  |  | | 26 mission chip tone |  |  | | 05 `main · Done` |  |  |  ▣ with no tab open lists every thread's outputs; the pin is in the 보기 head when the 보기 column is the edge.  A pinned thread: the chat narrows; ⌘J shows beside `터미널로`.  The Agent tab of a Desk thread carries `Desk로` with ⌘J.  Project lane: the pin left the rail's bottom for the Explorer head.  Project lane with the documents alone: the pin sits before the View area's ✕. </details> <details><summary>Verification record</summary> - base `main` 09a5eaf, head 9beed04; CI on e7c7947 (the switch before the review fixes) passed, run 41154765303 - review fixes: `verify-web.sh` exit 0 (web 2391, desktop 303); `verify-cargo.sh lint` exit 0; `nextest -E 'test(/desk|remote_spawn/)'` 64 passed; desktop e2e `desk-switch.spec.ts` 1 passed; design contract ok - the switch: head ac33053 - switch: `bash scripts/verify-web.sh` exit 0 on ac33053 (web 2390, desktop 302); `verify-cargo.sh lint` exit 0; `nextest -E 'test(/desk/)'` 38 passed; `desk-lane.spec.ts` 4 passed, s2 shortcut sheet 1 passed; design contract ok - `bash scripts/verify-web.sh` exit 0 on e5e4c5f (pnpm 10.14.0) - `bash scripts/verify-cargo.sh lint` exit 0; `nextest -p herdr-core -E 'test(/desk|unseen_views|lane/)'` 81 passed - e2e: `desk-lane.spec.ts` 3 passed; 11 pin-using specs 49 passed + 2 fixed and rerun passed </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.
Related: #1907 (Desk 화면 부품, 머지됨). 이 PR이 그 부품을 앱에 연결한다.
Summary
Desk 방이다(PRD Desk 1차 B1-B24, B36-B40).
사이드바 맨 위
◆ Desk줄을 누르면 가운데에 Desk 채팅이 열린다.운영자가 고른 에이전트(Claude 또는 Pi)와 ACP로 대화한다.
그 에이전트는 hide 명령으로 세션을 띄우고 따라가며, 승인 카드는 hided가 결정한다.
Desk가 띄운 세션은 운영자 소유 탭으로 체크아웃의
◆ Desk그룹에 들어간다.상한 8과 대기열, 일 카드 상태,
hide agent archive, Settings › Desk가 함께 들어 있다.Codex는 운영자 설정이 섞이고 샌드박스가 hide를 막아서 아직 고를 수 없게 두었다(공백, 아래 Review).
lane(Threads, 결과물, ⌘J)은 lane 노드가 붙인다.
Review
다시 시도는 운영자의 마지막 말을 그대로 다시 보낸다. 코어에 재시도 이벤트가 없어서다.desk_jobs는 최신 64장만 보내기 때문이다.desk_send가 첨부를 받지 않아서 보이지 않게 했다.묻기 모드 없음으로 표시했다. hided를 다시 켤 때까지 Claude를 고를 수 없게 된다.deny: ["EnterPlanMode"]를 넣었다. 다시 확인하니 도구 목록에서 빠졌고 세션은 ask 모드에 남았다(7381e90).reserved_name으로 거절되고 있었다. Desk의 이름hide:desk가 Factory 이름 막기에 걸렸기 때문이다. Hide가 만든 신원은 제 이름을 쓸 수 있게 했다(a503ded).prepare_delivery를 Desk 호출자로 지나는 테스트가 있다.desk를 다시 보내고 있었다. 이제desk_jobs만 간다(a503ded).@메뉴의 프로젝트가 등록 id로 가고 있었다. Desk의 에이전트는@project(<경로> <이름>)를--repo로 넘기고, 화면은 그 경로로 체크아웃을 찾는다. 그래서 프로젝트를 고른 말은 엉뚱한--repo가 되고 프로젝트 칩은 눌러도 열리지 않았다. 이제 기본 체크아웃의 경로를 보낸다(기본 체크아웃이 없는 폴더 프로젝트는 그 폴더의 경로, 2333ae0).parent_unavailable로 거절되었다. 부모 없는 spawn은 부르는 쪽의 기록을 origin으로 쓰는데, 실제 경로에서는 아무도hide:desk의 기록을 만들지 않았다. Desk 테스트들은 그 기록을 손으로 만들고 시작했고, 화면 확인은 없는 기기로 보내 실패 카드만 봤기 때문에 둘 다 놓쳤다.hide:<role>)이 부모 없이 처음 spawn할 때 executor가 그 기록을 등록하고 origin으로 쓴다. Hide AI가 spawn마다 손으로 부르던 등록은 지웠다(e21bf35).DESK_CALLER,prepare_delivery, 전달 worker) 가짜 기기 Herdr에 spawn한다. 일이 시작되고, 카드가 Working이고, 상한 1에서 다음 spawn이 대기 1번이 된다. 고침을 빼면 이 테스트는 실패한다.세션 n개 시작으로 셌다(verify). 이제 시작은 spawn이 성공으로 답한 것만 센다(bded951).queued로 답했지만 카드 구획은 다음 갱신 때 만들어졌고, 그 변화를 화면에 알리는 일도 없었다. 이제 대기열에 넣는 그 자리에서 카드를 만들고, 잠금을 놓은 뒤 화면에 알린다(5a9bad1).완료로 보이지 않게 했다. brief를 받지 못했으니 일을 하지 않은 것이고,다시 시도가 같은 pane에 brief를 넘긴다.not_offered).~/.codex/AGENTS.md, 스킬, MCP를 읽었고 read-only 샌드박스가 루프백을 막아hide가 실패했다.CODEX_HOME과 Desk 전용codex login이 필요하다. 로그인이 하나 더 생기는 일이라 운영자 결정을 기다린다(with-hide/hide-private#388).◆ Desk그룹 밖, 그 기기가 만든 자리에 둔다(받아들인 공백,docs/UI_BEHAVIOR.mdDesk's jobs).hide agent spawn ... -- <인자>는 카드로 묻고,--parent를 단 spawn은invalid_request로 거절한다.기타카드가 떴다(제목과 입력 전문). 거절하니 실행되지 않았다.which -a hide를 돌리니 Desk가 준 hide가 첫째,~/.local/bin/hide가 둘째였다. rc가 PATH를 다시 만들어도 Desk의 hide가 앞선다.desk_jobs는 4.4 KB였다. 고친 뒤 카드 하나를 다시 시도하면 그 구획만 간다(4.6 KB 프레임). 대화 구획은 가지 않는다.@project경로), d968b35(DeskScreen 컴포넌트 테스트: 보낸 말 보관, 다시 시도, 예시 줄, 프로젝트 칩).hide-cli.json은 다시 만들었고(main의--plan-node위에hide agent archive),docs/delivery.md와agent_cli.rs사용법 줄은 둘을 합쳤다. 0045aff1a는 main이Command::Spawn에 더한plan,plan_node를 Desk 테스트 fixture에 넣었다. 프로토콜, 스냅샷, 스킬 번호는 이 브랜치가 바꾸지 않았다.DeskComposer안으로 옮겼다. Desk는held로 보낼 수 없음을 넘기고@메뉴 키만 처리한다. 메뉴가 막은 키는 보내지 않는다.--force경로(forced_through)와 Desk의then,answered를 한Prepared에 함께 두었다.herdr-core/src/runtime/delivery.rs: 이름 막기의 예외. Hide가 만든 신원(code_owned)만 예외이고, pane은 그런 신원을 주장할 수 없다.herdr-core/src/runtime/desk/worker.rs: runtime mutex 밖의 단일 소유 스레드다. 보고는 짧은 잠금 아래에서 적용된다.hide-desk/src/permission.rs: failure path. 읽지 못한 요청은 실행되지 않고, allow_always는 고르지 않는다.herdr-core/src/runtime/desk/jobs.rs: high-frequency path.refresh_desk_jobs가 rest가 바뀐 publish마다 돈다.web/src/MarkdownText.tsx: 답 속 세션 칩을 CodeMirror 위젯으로 그린다. 칩마다 React 루트가 하나이고, 편집기가 놓은 뒤에 내린다.web/src/DeskScreen.tsx: 화면이 가진 것은 쓰는 중인 말과@메뉴 위치뿐이다. 나머지는 모두 코어의 구획이다.@메뉴, 답 스트림은 각자 제 구획으로 간다. 대화(desk, 최대 2 MiB)는 대화나 방이 바뀔 때만 간다.Evidence
◆ Desk줄로 방이 열렸고, 에이전트 메뉴에서 Codex는아직 고를 수 없음으로 흐렸다.touch note.txt승인 카드가 명령, 이유, 두 답과 함께 떴다(위 첫 스크린샷). 거절하니 한 줄로 접혔고note.txt는 생기지 않았다.다시 시도로 떴다(위 둘째 스크린샷). 고치기 전에는 8번 모두reserved_name으로 막혀 카드가 없었다. 이 확인은 성공하는 spawn을 보지 않았고, 그 빈틈을 verify가 찾았다(위 결함 넷째).which -a hide. 끝난 뒤 남은 프로세스가 없었고 전역 설정 파일 해시가 그대로였다.a_spawn_desk_asks_for_starts_with_no_record_made_beforehand_and_takes_its_place(고침을 빼면 실패함을 확인),a_turn_tells_the_sessions_it_started_and_not_a_start_that_was_refused,a_project_in_the_at_menu_is_named_by_its_primary_checkout_s_path,a_queued_spawn_s_card_is_drawn_with_its_answer_and_the_screen_is_told,a_start_that_failed_after_its_tab_opened_joins_the_group_and_its_card_follows_the_pane,DeskScreen.test.tsx4개.Verification record