Skip to content

fix(app): the harness control's instance ask carries the placement directory (#1799) - #1801

Merged
aarontrowbridge merged 1 commit into
live-test/stack-e2efrom
opencode/issue-1799-harness-control
Oct 15, 2026
Merged

aarontrowbridge merged 1 commit into
live-test/stack-e2efrom
opencode/issue-1799-harness-control

Conversation

@aarontrowbridge

Copy link
Copy Markdown
Member

Closes #1799.

The picker bug, root-caused live (and the issue's suspicion FALSIFIED): it was not the server.current guard — that fires fine in the hub-client posture. The control's mount-path fetch was the app's ONLY instance-scoped ask carrying NO ?directory= placement key; the hub frontdoor cannot place a directory-less instance ask, so it landed on the default backend and was answered 200 text/html (the SPA index) — amicodeGet's res.json() threw, the catch adopted undefined, the render gate never opened. In the local posture the extension service's #1549 exception forwards the bare ask, which is why local worked and hub didn't. Second defect in the same chain: two concurrent mount effects, last-writer-wins on a module singleton — the control rendered racily during member switches.

Fix (posture-correct, guard preserved): harnessRoute(directory) builds the placement-correct ask (bare ask preserved for empty directory = local posture); refreshHarnessState extracted and sequenced so only the latest ask adopts; the directory threaded through both mount effects and the switch POST from the per-directory SDK context (the same source every other instance-scoped composer fetch rides).

12 new tests drive both postures' mount-path seam (hub registry mocked with the frontdoor's live-observed placement semantics: directory'd → JSON, bare → SPA index); RED shown two ways (mechanical + behavioral: reverting to the bare ask fails 10/12); local posture, no-connection degradation, stale-answer sequencing, and wiring all pinned.

Director gates: scoped 19/0; full app suite 1613/25 with the failure set diff-empty vs base (+12 passing); drift PASS. Post-deploy confirmation (pickers.mjs shows /amicode/harness?directory= firing + the control rendered) is the director's probe, after the deploy decision (HITL).

…rectory (#1799)

The composer's harness control never rendered in the hub-client posture:
its GET/POST /amicode/harness were the app's only instance-scoped amicode
asks with no ?directory= placement key. In the local posture the panel
origin's extension proxy forwards the bare ask to the bound engine, so it
worked; at the hub origin the frontdoor cannot place a directory-less
instance ask and answers 200 text/html with the SPA index, so the parse
collapses and the control's <Show when={liveHarnessState()}> gate stays
never-true (live-verified: bare /amicode/harness -> text/html,
?directory=… -> application/json registry).

- harness.ts: harnessRoute(directory) builds the placement-correct ask;
  refreshHarnessState (extracted from the component, the mount effects'
  body) is sequenced so only the latest ask adopts — the two mount
  effects can race and a stale SPA-index answer clobbered a fresh
  registry during hub member switches (observed live).
- harness-control.tsx: the mount effects keep the server.current and
  stream-connected guards and thread the per-directory SDK context's
  directory; the switch POST carries the same route.
- new harness-control.test.tsx drives the mount-path seam under both
  postures' server contexts (hub frontdoor placement semantics mocked as
  observed live) + pins the wiring; suite delta: zero new failures
  (byte-identical failure set vs base), +12 passing.
@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@aarontrowbridge
aarontrowbridge merged commit b49dde7 into live-test/stack-e2e Oct 15, 2026
10 of 12 checks passed
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