Skip to content

fix(onboarding): stamp host='byo' on self-serve seats — the 202 installs that read 'unknown' - #945

Merged
lilyshen0722 merged 1 commit into
mainfrom
feat/byo-host-stamp
Aug 14, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
feat/byo-host-stamp

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

W4 item 1 — and it is the prerequisite for everything else in W4, not a parallel item.

Every self-serve BYO seat is born mislabelled

One mismatch causes it. The connect page posts runtimeType: 'webhook' (V2AgentBYO.tsx:151) because ADR-006's self-serve branch requires that value to synthesize a manifest — while the user never runs a webhook. They run commonly agent run, which polls. No host is written, so deriveAgentState asks its three questions — push-webhook? native? byo? — gets no to all three, and answers unknown.

What that costs, measured

pod-architect, against production:

Keyed on never-connected the trigger covers 12 of 314 active installs — and all 12 are our own seats. 202 derive unknown, and every real BYO user seat is in that 202, including all four named casualties.

user date what they sent reply
m0re 08-04 @m0re-agent 1 none
l3r0ys4n3 08-07 Hi none
user-8863 08-09 asked 3× whether the connection worked none
ngoc-tran 08-10 @ngoc-tran-agent what modal you use none

The #891 honesty surface, the install intro (#943) and W4's stalled-connect trigger all read this derivation. So all three are decoration until this lands — #943 would have merged, deployed, and changed nothing for the exact people it was written for.

The fix

Stamp host: 'byo' when a seat is webhook-typed with no webhookUrl.

That discriminator is sound because a genuine push webhook must supply a URL, and no registry route ever writes webhookUrl — it only arrives in caller config. An explicit host is never overwritten; the CLI attach path already sets it correctly.

Why there is a backfill, and why read-side can't replace it

scripts/backfill-byo-host-stamp.ts (dry-run by default) handles the existing 202.

I went looking for a read-side fix first, because it would rescue history for free. It cannot work — I checked the casualty rows directly, and normalizeRuntimeIdentity only rescues the legacy local-cli + wrappedCli shape, which these carry neither of. There is no information in the row to infer byo from; it has to be put back.

The script assigns the whole config object and calls markModified — Mixed paths do not reliably mark themselves dirty on nested mutation, which is the classic way a migration reports success and writes nothing.

Tests

Seven. They pin the predicate (including the push-webhook case that must not be restamped, and the explicit-host case that must not be overwritten) and, more importantly, the consequence:

  • without the stamp, a never-run seat reads unknown with no fixCommand
  • with the stamp, the same seat reads never-connected and offers commonly agent run <name>
  • a stamped seat polled recently reads listening — the stamp makes the answer knowable in both directions, it does not just make everything look broken

Follow-up this does not do

pod-architect's warning stands and should shape the acceptance test for W4 item 3: a synthetic install created with host:'byo' passes every case while the real population stays uncovered. That assertion has to run against a seat minted by the actual self-serve connect flow.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8

…read 'unknown'

Every self-serve BYO seat has been born mislabelled, and it is one mismatch.
The connect page posts `runtimeType: 'webhook'` (V2AgentBYO.tsx:151) because
ADR-006's self-serve branch requires that value to synthesize a manifest —
while the user never runs a webhook. They run `commonly agent run`, which
POLLS. No `host` was ever written, so `deriveAgentState` asks its three
questions (push-webhook? native? byo?), gets no to all three, and answers
`unknown`.

Measured on production (pod-architect, fleet review 2026-08-14): **202 of 314
active installs derive `unknown`**, and every real BYO user seat is in that
202 — including all four users who mentioned a seat with nobody home and got
total silence (m0re 08-04, l3r0ys4n3 08-07, user-8863 08-09, ngoc-tran 08-10).

That one missing field is why the whole honesty layer is decoration: the #891
surface, the install intro (#943) and W4's stalled-connect trigger all read
this derivation, so all three are inert for exactly the population they exist
to protect. #943 would have merged, deployed, and changed nothing for the
people it was written for.

Discriminator: a PUSH webhook must supply `webhookUrl`, and no registry route
writes that field — it only ever arrives in caller config. So webhook-typed
WITHOUT a URL is a polling seat. An explicit host is never overwritten; the
CLI attach path already sets it correctly.

Includes the historical half as `scripts/backfill-byo-host-stamp.ts` (dry-run
by default). Read-side normalization CANNOT substitute for it: I checked the
casualty rows directly, and `normalizeRuntimeIdentity` only rescues the legacy
`local-cli` + `wrappedCli` shape, which these carry neither of. There is
nothing in them to infer from.

Tests pin the predicate AND the consequence — the same seat reads `unknown`
with no fixCommand before the stamp, and `never-connected` with
`commonly agent run <name>` after.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8
@lilyshen0722
lilyshen0722 merged commit f8d24e3 into main Aug 14, 2026
11 checks passed
@lilyshen0722
lilyshen0722 deleted the feat/byo-host-stamp branch August 14, 2026 02:54
lilyshen0722 added a commit that referenced this pull request Aug 21, 2026
…o BYO

Sam, 2026-08-21: the config and install UI were built for the old moltbot
system, and we support local + cloud now (pi next per ADR-021/023). Three
cuts:

1. The gateway-mode and per-agent LLM-key dialog sections are deleted —
   moltbot-era fields rendered for every plain catalog install because the
   branch that skipped them keyed on the REMOVED presets flow.
2. claude-code Install navigates to the BYO connect flow instead of the
   dialog — a local wrapper is connected, not installed; the BYO page
   carries the token handoff and the connect honesty (#943/#945/#947).
3. Webhook's URL fields key on the agent, not presetContext — they had
   silently stopped rendering when the Presets tab retired.

Also unwires the New Agent template creator (its rows no longer render, so
a creator with invisible output is a trap). Native installs keep the plain
name+pod dialog, which is the path that works.
lilyshen0722 added a commit that referenced this pull request Aug 21, 2026
…o BYO (#1075)

Sam, 2026-08-21: the config and install UI were built for the old moltbot
system, and we support local + cloud now (pi next per ADR-021/023). Three
cuts:

1. The gateway-mode and per-agent LLM-key dialog sections are deleted —
   moltbot-era fields rendered for every plain catalog install because the
   branch that skipped them keyed on the REMOVED presets flow.
2. claude-code Install navigates to the BYO connect flow instead of the
   dialog — a local wrapper is connected, not installed; the BYO page
   carries the token handoff and the connect honesty (#943/#945/#947).
3. Webhook's URL fields key on the agent, not presetContext — they had
   silently stopped rendering when the Presets tab retired.

Also unwires the New Agent template creator (its rows no longer render, so
a creator with invisible output is a trap). Native installs keep the plain
name+pod dialog, which is the path that works.
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