Skip to content

fix: keep an agent opened beside its caller out of a parent's care, and let a child write to its parent - #2402

Merged
yansfil merged 3 commits into
mainfrom
fix/beside-not-parent
Nov 10, 2026
Merged

yansfil merged 3 commits into
mainfrom
fix/beside-not-parent

Conversation

@yansfil

@yansfil yansfil commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

An agent opened beside its caller (hide agent spawn --beside) could also be made that caller's child with --parent here, and the session-start text told agents to do exactly that.
The operator reads a pane beside theirs as "just opened there", not as a supervised child, so the screen and the lineage disagreed.
The same child then could not report: it is never told its parent's id, guessed request send parent, and got target_unavailable.

Now --beside with --parent is refused beside_with_parent before anything is created, so an agent beside its caller is always the operator's root and a supervised child always opens in its own tab.
hide request send parent ... reaches the sender's own parent, and a sender with none is refused no_parent.

No screenshot: no screen changes; the change is in spawn admission, letter addressing and agent-facing text.

$ hide agent spawn --parent here --beside --name w ...
beside_with_parent: An agent opened with --beside is the operator's to watch and has no parent; leave out --parent ...
$ hide request send parent --intent done --kind report --body "..."   # from a delegated child
-> delivered to the registration that answers for it

Review

  • Decide: the operator chose this over keeping --parent here --beside: placement now decides responsibility.
  • Decide: parent as a letter target wins over an agent that registered under the name parent.
  • Risky files: hide-core/src/runtime/delivery.rs - prepare_delivery runs under the runtime mutex; the new step reads the in-memory ledger only, no I/O.
  • Risky files: hide-core/src/coordination/executor.rs - the refusal sits with the other argument checks, before the ledger is read or anything reserved.
  • Cost: one string compare per letter; one ledger scan (coordination::here) only for letters addressed to parent.

Agents already running beside a parent keep that parent: existing spawn records are untouched, and the beside relocation exemption still holds them in place across restarts.

Tests

  • Layer: core integration (runtime::tests::beside_spawn over the fake device engine; runtime::delivery::tests over the real delivery worker and ledger file).
  • Catches: a spawn that accepts --beside with a parent (a_beside_spawn_with_a_parent_creates_nothing), and a parent target that is not resolved or resolves to the wrong agent, plus the retry of the same letter (a_letter_to_parent_reaches_the_senders_own_parent). Planted defects (refusal disabled, keyword not matched) failed both.
  • Layer (e2e fixture): the family fixture (web/e2e/engine-fixture.ts, 16 specs) spawned its child with --parent here --beside, now refused; its child opens in a tab of its own and is found by the pane its spawn answers, and fixture.tab is the parent's. spawnChild drops its unused beside option.
  • Layer (mission fixture): mission_worker_item's reviewer stays beside its Conductor so the fake engine makes no tab, now without a parent, which those tests do not read.
  • Repeat: the 10 tests in beside_spawn and the new letter test, 20 runs locally, all green.
  • Waits: none.

Evidence

  • Verified: hide-core beside/parent/delivery filter 136/136; hided agent_cli/cli_contract/refusal/guide filter 52/52; hide-agent-hooks runtime/workspace_context 20/20; cargo fmt --check; clippy -D warnings on hide-core, hided and hide-agent-hooks.
  • Verified: contracts/hide-cli.json regenerated from this build (adds beside_with_parent and no_parent).
  • Not verified: the family e2e specs were not run locally, only in CI; the restart specs (timed out ... waiting for the restarted core's engine and saved Workspace) fail on main's push run too and are not from this change.
  • Not verified: a live spawn and letter in a running Hide; the full verify-cargo.sh test lane is left to CI; Windows and Linux lanes are left to CI (no platform code changed).

…nd let a child write to its parent

A spawn with --beside and --parent is refused beside_with_parent before anything is created: an agent beside its caller is the operator's root, and a supervised child opens in a tab of its own. hide request send parent reaches the sender's own parent, refused no_parent when none answers for it, because a child is never told its parent's id. The session-start table and spawn help no longer suggest --parent here beside.
… beside_with_parent allows

The family e2e fixture spawned its child with --parent here --beside, now refused; the child opens in a tab of its own and the fixture finds it by the pane its spawn answers. spawnChild loses its beside option, which no spec passed. The mission worker item fixture's reviewer stays beside its caller, so the fake engine makes no tab, without a parent, which those tests do not read.
…-status specs

The family fixture's child now opens in a tab of its own. ask-human focuses that tab to read the child's pane head, and sidebar-status starts the child working before the parent's unseen turn, since typing the child's screen shows its tab and reads the parent's turn.
@yansfil
yansfil added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit 5cf8b61 Nov 10, 2026
52 checks passed
@yansfil
yansfil deleted the fix/beside-not-parent branch November 10, 2026 17:54
HyunjunJeon pushed a commit to HyunjunJeon/hide that referenced this pull request Nov 12, 2026
… open (with-hide#2473)

Related: follows with-hide#2470 and with-hide#2469 (both merged). Paired private docs:
with-hide/hide-private#879.

## Summary

Some questions in `나를 기다리는 것` were settled without anyone answering them
in the session. Another agent relayed the operator's decision, or the
agent did the thing itself. They stayed open anyway and kept the task in
Needs You.
Hide AI may now fold such a question, never delete it. It moves under
`정리됨 N` below the list, with a one-line reason, and one press of `다시 열기`
brings it back for good.
A step only the operator can take (sign-in, approval, permission, typed
information) is marked when the question is listed. Hide AI never folds
it, and a parent's letter no longer closes it; only the operator's own
answer does.
Questions recorded before this change carry no mark and are never
folded.

![정리됨 opened (dark): each folded question with Hide AI's reason and 다시
열기](https://github.com/yansfil/pr-assets/blob/main/hide/feat-fold-open-asks/771e64d/folded-open-dark.png?raw=true)
Look at the lines under `정리됨 2`: the question in the subtle colour, the
reason under it, `다시 열기` at the right.

## Review

- **Decide**: an approval the agent reserves for the operator ("only
your OK is left") counts as the operator's own step, so it never folds.
On the sample this keeps one settled merge question (fc86b2) in Needs
You.
- **Decide**: the fold is shown closed as `정리됨 N` under `나를 기다리는 것`,
only in the session record; rows and the pane head ignore folded lines.
- **Risky files**: `hide-core/src/links/ledger_store.rs` - the close and
fold updates in one turn-end transaction; schema 16 adds two nullable
columns to `ledger_missed`.
- **Risky files**: `hide-core/src/labels/context_label.rs` - END prompt
v27 adds `operator_only` on each missed item and `reason` on each
resolved id.
- **Cost**: no new model call. The existing END call returns two more
fields, and the turn-end write runs one more UPDATE.

## Tests

- **Layer**: unit, against the real ledger store
(`links/ledger_store_tests.rs`), plus a vitest render of the session
record.
- **Fixture**: the e2e stand-in provider now answers every missed line
with `operator_only: false` and every resolution with `reason: ""`
(`web/e2e/pane-fixture.ts`); without them the v27 schema refused its
answers and the session-record e2e tests saw no questions.
- **Catches**: a parent's letter closing the operator's own step; a fold
of an unmarked or operator-only line; a reopened line folding again.
Dropping the `operator_only` guard from the parent-answer close (closing
every line) fails both new ledger tests.
- **Repeat**: the two new ledger tests and with-hide#2470's bell test 5 times
locally, all green.
- **Waits**: none.

## Evidence

- **Verified**: `verify` green on 1ff2732 (all lanes, web e2e Linux
6/6 and Windows, desktop e2e Windows). The first run's e2e reds were the
stand-in answers the v27 schema refused, fixed in the fixture.
- **Verified**: after merging main (with-hide#2469 included): `hide-core`
filtered nextest 350/350; web typecheck, lint, and vitest for
SessionRecord, agentRow, PaneHeaderBand and i18n (159/159); design
contract.
- **Verified**: the v27 prompt on haiku, with production flags, over the
hand-labelled sample. The person-step mark caught 3 of 3 operator steps
and wrongly marked 2 of 12 other questions. That error leaves a question
held, never closed.
- **Not verified**: no run on an installed build. The measurement
rebuilds each turn from the session file (last 3,500 characters, at most
5 later turns), and 9 questions were not listed again in that context.
- **Not verified**: the full Rust suite and the other lanes run in CI
only. `verify-web.sh`'s install step is refused locally by pnpm 12
(ignored build scripts), so its steps were run one by one.

<details><summary>Measured on the labelled sample (open questions of
11-11/12 with later turns: 20 stale, 3 live, labelled by hand)</summary>

| | stale cleared | live lost |
| --- | --- | --- |
| before (with-hide#2470 not merged) | 0/20 | 0/3 |
| with-hide#2470's rule alone, no relisting | 15/20 | 2/3 (both operator steps) |
| with-hide#2470 + this, v27 judgment (one run) | 8/20 (7 closed, 1 folded) | 0/3
|

Needs You over the 16 root sessions holding questions of 11-11/12, at
the copy's last turn:

| | Needs You | false | live lost |
| --- | --- | --- | --- |
| before | 16 | 2 (fc86b2, dfc3c6), f89171 unclear | 0 |
| after | 16 | 2 (fc86b2, dfc3c6), f89171 unclear | 0 |

- fc86b2: the judgment read it as settled with a reason on 3 turns
("with-hide#2402 already merged"), but the agent had reserved the merge OK for
the operator, so the mark keeps it.
- dfc3c6: the judgment lists it again as still waiting on all 5 later
turns; nothing in the session settles it.
- A narrower mark (excluding merge decisions) was tried. It still marked
fc86b2 and missed the 9 GB delete permission, so it was not kept.

</details>

<details><summary>More evidence</summary>

![정리됨 closed at first (light), below 나를 기다리는
것](https://github.com/yansfil/pr-assets/blob/main/hide/feat-fold-open-asks/771e64d/folded-closed-light.png?raw=true)
Closed at first, light theme.

</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant