Repository navigation
Add isolated bell safety and mail delivery checks - #816
Merged
Merged
Conversation
yansfil
added a commit
that referenced
this pull request
Oct 8, 2026
Related: #769 (adapter declarations this builds on), #810 (no agent row draws an in-process subagent count yet) ## Summary OpenCode has no command hook, so inside Hide it got none of Hide's collaboration: no letters on its prompt, no spawn guard, no Memory, no subagent count. This adds a Hide-owned OpenCode plugin, `~/.config/opencode/plugins/hide.js` beside Herdr's, written and removed only by `hide-agent-hooks` and installed as OpenCode's hook piece in the kit. Inside a Hide-managed Herdr pane it adds guidance, Project Memory and waiting letters to a root session's prompt as one synthetic part, and confirms the letters only after OpenCode reports that part stored. It also refuses `herdr agent start` with the spawn guard's reason, refuses `question` in a Factory worker pane, and reports subagent counts from child-session events. OpenCode stays unbelled, since its resume picker reads `done`. Outside a managed pane the plugin registers nothing. Settings now name OpenCode's piece `Plugin`, drop its `Basic` chip, and say on any agent's row why its hook could not be put in (for example, the agent's config folder does not exist yet). ## Review - **판단해 주세요**: the agent row now shows one quiet line when a hook is Absent with a reason, for every agent (B14). On Windows, Cursor's row says its hook is not written there. - **판단해 주세요**: the subagent count reaches Herdr's pane tokens and the snapshot (`children.subagents`), as Claude Code's does. No row draws it yet for any agent: #810. - **조심해서 볼 파일**: `hide-agent-hooks/src/opencode/plugin.js` - runs inside the operator's OpenCode. Every hook has a budget and fails open except the refusal. - **조심해서 볼 파일**: `herdr-core/src/delivery/mailbox.rs` - an unbelled kind with a prompt hook now takes letter bodies on any prompt. The plugin confirms later. - **조심해서 볼 파일**: `herdr-core/src/runtime/memory.rs` - receipts from OpenCode's label read are recorded on one owned thread off the lock, with queues capped at 64 and 256. - **조심해서 볼 파일**: `.github/workflows/pr.yml`, `herdr-update.yml` - the rust lane installs Node 22, because `hide-agent-hooks` runs the plugin under Node in its tests. - **비용 검토**: - Per OpenCode prompt: one helper process, plus one count report after it. - Per child status change: at most one running report, with only the newest waiting. - Session bookkeeping is capped at 512, evicting finished children first. - Nothing is added on hided's high-frequency paths. The lineage pass reads one kit status instead of cloning the kit. ## Evidence - **확인한 것**: sealed suite `verify-cargo.sh test` and `lint` PASS on the final head, merged with main at #821. - **확인한 것**: Node plugin test, run with OpenCode 1.18.30's hook and event shapes: - root and child prompts; - deferred confirm and an unstored prompt; - budgets, plus slow, failing and garbled helpers; - spawn and question refusal, including a subagent's question; - background child counts; - more than 512 sessions. - **확인한 것**: `web/e2e/opencode-plugin.spec.ts` on a private pinned Herdr 0.9.3, where the kit writes the plugin and a stand-in OpenCode in two panes loads it: - a letter rides the next prompt and is confirmed only once stored; - `herdr agent start` is refused; - Herdr's tokens and the snapshot's `children.subagents.working` go 1 then 0. - 9/9 over 3 repeats, 6/6 over 2 repeats after the last fix; with `agent-adapter-layer.spec.ts` (OpenCode no longer Basic) 4/4 on the merged head. - **확인한 것**: unit tests for every file state (current, stale, edited, foreign, config folder absent, Windows); kit apply, Reinstall and switch-off; Memory receipts from synthetic parts; mailbox next-prompt pull. - **확인하지 못한 것**: the live check with a real OpenCode (PRD D-13) ran but measured nothing (exit 3, every cell UNKNOWN): - run: `scripts/agent-live-check.py --agents opencode`, OpenCode 1.18.30, `opencode-go/deepseek-v4.1-flash`, private pinned Herdr 0.9.3, this branch's hided; - Herdr saw OpenCode idle and ready in every scene, but every screen read came back empty, so all ten scenes timed out at arrival; OpenCode draws a full-screen interface the tool's read does not return; - the tool loads Herdr's integration, not Hide's plugin, so the letter cell is UNKNOWN as well; - nothing unsafe was seen, cleanup was confirmed, and no login or operator setting was changed; - still unproven live: a letter and a refusal reaching the model, B8 after repeated refusals, coexistence with Herdr's plugin, Bun. - The event samples in `tests/fixtures/opencode/events-1.18.30.json` are built from OpenCode's source, not captured. - **확인하지 못한 것**: a machine whose OpenCode reads `$XDG_CONFIG_HOME` loads neither Hide's nor Herdr's plugin from `~/.config/opencode` (a limitation shared with Herdr). <details><summary>Follow-up improvements (not needed for this contract)</summary> - Claude Code's hook is silenced inside OpenCode even where Hide's plugin is not working (Windows, a foreign `hide.js`). - `hide inbox` offers no `ack_command` to OpenCode; letters are confirmed by the plugin only. - Guidance is read once when OpenCode loads the plugin. - A failed confirm can deliver a letter again (at least once); SIGKILL of a helper can orphan its grandchildren; no symlink tests for `hide.js`. - `done` stops growing once finished children are evicted at 512. - No e2e for the question guard (B19) or for an idle pane receiving no input (B5); both are covered below e2e. - A bash command over the helper's 256 KiB input, or a call past the 8 running helpers, passes the spawn guard unchecked (it guards accidents, not a sandbox). - A subagent's `question` from a session the plugin never saw created asks about the subagent's own id, which the Factory guard does not know. - On a timeout the helper is killed but the `hide` call it started ends at its own deadline. - Letter ids are not checked for a leading `-` on pull or confirm; they come from Hide's own ledger. - `herdr-update.yml` takes `actions/setup-node@v4` by tag, as the rest of the repository does. </details> <details><summary>Verification record</summary> - PRD: `agents/prd/opencode-plugin/prd.md` (sha256 91a061f42e55e18f8f0834a17d9b98c8623e8e8cdf3e8d579208af0e8b9d9448) - Base b33fb57 → head bb7bf9d, verified 2026-10-08T20:08:54.127Z: PASS - Verification report: `agents/runs/opencode-plugin/verification-report.json` and `agents/runs/opencode-plugin/verification-report.md`; source fingerprint 01745cef3e161c615ddbf9ebbd8a6d16fb839f090be81b6040ff408874b81036 - Suites: - S1: GREEN `bash scripts/verify-cargo.sh test` (exit 0) - S2: GREEN `bash scripts/verify-cargo.sh lint` (exit 0) - Reviews: - Fidelity (full contract, earlier head): Fix now items fixed before the follow-up rounds; closure confirmed, nothing blocking. - Code (full contract, then follow-ups through the merge with main): Fix now items fixed (plugin eviction, report coalescing, root lookup for question, receipts off the lock); nothing blocking on the merged head. - Security (on the merged head): Fix now 1, a letter or Memory line could close the plugin's own reminder tags; fixed with a test that fails without the fix. Six hardening follow-ups listed above. - Code follow-up (after merging #815/#816/#817): Fix now 1, the OpenCode tests copied or wrote the programs they start, against TESTING.md rule 8; converted to the build's stand-ins. Merge resolutions confirmed. - Evidence: none registered separately. - Changed paths: 63 (see Files changed) - Delivery: mode pr, branch `feat/opencode-plugin`, base `main` </details>
yansfil
added a commit
that referenced
this pull request
Nov 14, 2026
Two waits failed on Windows without saying what the other side held. `startFlow` waited for the beta project row to be drawn (#816), and `setAgentState` waited for a pane to read the state the fixture typed into it (#822); a run that gave up left only the timeout. Both now record what they asked for and what the core or the page held when the wait ended, and rethrow the wait's own error unchanged. Neither wait, retry nor expectation changed, and neither has been reproduced since.
yansfil
added a commit
that referenced
this pull request
Nov 15, 2026
A failure dump's read returns one object of page and daemon reads, and a
read left unawaited inside it serialized as {}: the pane-connection and
s2 dumps for #859 and #816, and the s3 log dump's screen, recorded
nothing. dumpOnFailure now settles every promise in the answer before it
serializes, keeping a rejected read as its reason, and the two dumps
await their reads.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
yansfil
added a commit
that referenced
this pull request
Nov 15, 2026
A failure dump's read returns one object of page and daemon reads, and a
read left unawaited inside it serialized as {}: the pane-connection and
s2 dumps for #859 and #816, and the s3 log dump's screen, recorded
nothing. dumpOnFailure now settles every promise in the answer before it
serializes, keeping a rejected read as its reason, and the two dumps
await their reads.
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
Review
sandbox.py,protection.py,processes.py의 운영자 경로 보호·소유권·실패 정리를 봐 주세요.scenes.py,delivery.py, recipes의 양성 도달 증거와 정확한 assistant 턴 판정을 봐 주세요.integration_pane을 참조하는 실패 경로.Evidence
Codex CLI는 열 장면 모두 시작 거절, Pi·omp는 인증 미충족을 기록했습니다. 로그인은 시도하지 않았습니다.Verification record
agents/prd/agent-live-check/prd.md(sha256 2908f4a4d6a2a43f9da330aecca6075c6f6cbb0b9f5a7bb00b2548fd55c7fa70)agents/runs/agent-live-check/verification-report.jsonandagents/runs/agent-live-check/verification-report.md; source fingerprint 00f036105538f1d42d3a2505615b142806fcf0b4b867ff95992a2f8c955fde12bash scripts/verify-cargo.sh test(exit 0)bash scripts/verify-cargo.sh lint(exit 0)886dc3cc0fa08567fe500d23a438167a29ad6bc7; Fix now 0 P0/P1 under frozen protection scope; two P2 deferred.886dc3cc0fa08567fe500d23a438167a29ad6bc7; Fix now 0 P0/P1; two P2 deferred.886dc3cc0fa08567fe500d23a438167a29ad6bc7; Fix now 0 P0/P1; three P2 and two P3 deferred.8f193e3ba4a2fc895a7048ce2637076be346fdf1, thend4f063d508fae9a11069eb1aa41f5f3177ca8612; 0 new P0/P1, 0 new compatibility findings, five retained follow-ups; all 43 feature blobs unchanged in the second merge.8012b476e8a53d7dfad2161e5ba0a73f0d0bfa70; 0 new P0/P1 or compatibility findings, five retained follow-ups; report SHA25681d9291679bae1be6640bd471092861f2357681fd3cdf549f6904c6cfe725897.9480ce43-dc38-4d97-a6b4-480a2bde808f: S1 325.040 s, S2 4.896 s; sourceChangedAfterVerification=false, inputsChangedAfterVerification=false; input fingerprint6f06e572fd48f5614f1b47201e6a6a41a4ba9131397dbb57b099c1d9369b2220.404a09c835da9f88f6434e54ae72a8cf22138a7e, making delivery STALE through baseTip identity movement; recorded Root3081 ref-only repeat.codex app-serverno_server expected Unsupported, got initialize TimedOut at its unchanged 5 s request bound; crate 62 passed / 1 failed, partial workspace 1,981 passed / 1 failed / 5 ignored; S2 passed.37826053187retained: Linux policy failed this unreadable-orphan fixture, Linux web lanes reached the same failure; Windows fetch timeout was reported separately as network preparation failure.8012b476e8a53d7dfad2161e5ba0a73f0d0bfa70; 17 verify jobs succeeded and two plan-selected jobs skipped; the separate design contract also passed.4f1645c83c0c7f42ab6abad8b17da07b759ed281, all 13 checks passed; owned temporary worktree removed, before/after worktree inventory identical. Fresh admission load 5.29346, free 14,341,345,280 bytes.404a09c835da9f88f6434e54ae72a8cf22138a7e; Root3127 and CONTRIBUTING permit current-head CI plus premerge against later main without requiring branch ancestry or relabelling native evidence.886dc3cc0fa08567fe500d23a438167a29ad6bc7; no new native/provider execution on either merged head.c062e7eba130752041bb76626aaa5a954757287cdd3e15ba0edbf371974b21d9: 1,171 files / 1,139 confirmed receipts.d1f361b839d8bc06bd7b5c388af491612620c675b2fa26b5448908f546c8cb50: 4,011 files / 3,925 confirmed receipts.claude-code 2.1.294, haiku: 3/7/0, UNKNOWN, loaded_version_observed.codex 0.161.0, gpt-6-luna: 0/10/0, UNKNOWN, integrity_unproven.cursor 2026.10.01-e373342, gpt-6-luna: 4/6/0, UNKNOWN, not_observed.grok 1.0.46, grok-4.5: 3/7/0, UNSAFE, loaded_version_observed.omp 18.7.0, gpt-6-luna: 0/0/10, skipped, loaded_version_observed.opencode 1.18.30, openai/gpt-6-luna: 0/10/0, UNKNOWN, not_observed.pi 1.0.4, openai-codex/gpt-6-luna: 1/1/8, UNSAFE, loaded_version_observed.64ca97d9d4895d07b55c981ff0aa634df87b86cbwith parents4f1645c83c0c7f42ab6abad8b17da07b759ed281and verified feature head8012b476e8a53d7dfad2161e5ba0a73f0d0bfa70.b33fb578a8b55ec6cbca350ba3370d43f671d41c; 17 jobs succeeded, two plan-selected jobs skipped, all 12 test-lane reports say no flaky test. Earlier pending run37834599380was cancelled before any job; it is not counted as a pass.a81adb3e976de4195bcf614a9131e784027c3b6ebbd67913d33690132c648cc8.feat/agent-live-check, basemain