Skip to content

fix(onboarding): the install intro stops promising a listener that isn't there (W4 preventive) - #943

Merged
lilyshen0722 merged 4 commits into
mainfrom
fix/install-intro-honesty
Aug 14, 2026
Merged

lilyshen0722 merged 4 commits into
mainfrom
fix/install-intro-honesty

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

W4's preventive half. The plan has the reactive trigger (respond after a mention stalls); nothing stopped us making the false promise in the first place.

The measured failure

The intro is posted server-side at seat creation and always said "Mention me with @handle when you need me." For a BYO seat that is before any wrapper exists. Four users took the invitation and got total silence:

user date what they said reply
m0re 08-04 @m0re-agent 1 — testing if anything was alive none
l3r0ys4n3 08-07 Hi, right after the intro none
user-8863 08-09 asked three times, in two phrasings, whether the connection was working none
ngoc-tran 08-10 @ngoc-tran-agent what modal you use none

None returned. Across 21 real signups since 08-01: 21 verified, 21 got a workspace, 5 ever typed anything, and 4 of those 5 are the rows above. Reply rate on genuine user mentions: zero.

This also corrects our own record. The consolidation plan's "Current truth" says "nobody's first mention has ever failed — users historically never got far enough." All four failures predate the plan.

The fix

Liveness now comes from deriveAgentState — the same derivation the #891 honesty surface and the pod roster use, so there's one source of truth instead of a second guess:

  • not listening → "Nothing is running me yet, so mentioning me won't reach anyone. Whoever installed me can start me with commonly agent run <name> on the machine where I should live — then @handle will get through."
  • listening → unchanged.

Why derive instead of assume a fresh seat is dead: an already-running agent installed into a new pod genuinely is reachable, and telling that room otherwise would be the opposite lie. Derivation failure falls back to the old copy for the same reason.

The copy instruction names the installer, not the reader — most people seeing it in a shared pod can't run the command. Same split agentStateService already makes between state (everyone) and fixCommand (owner only).

Structure

Composition moved to composeInstallIntro in registry/helpers, kept pure, so the copy rules are testable without a DB — the same reason agentStateService is pure. Six tests, including the inverse case (a live seat must still invite the mention).

Note on local test runs

registry.install-runtime-type.test.js fails to even load on my machine — jsonwebtoken → buffer-equal-constant-time reads SlowBuffer, removed in Node 26. It breaks on install.ts:5, untouched here, and hits any backend test importing middleware/auth. Environmental; CI is the control. Worth knowing now that the backend has moved to Node 22 LTS.

Not included

The reactive responder (answer a mention that lands on a dead seat) — W4 item 3. That's the recovery path for seats installed before this fix, and it's the natural follow-up.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8

…n't there

Posted server-side the moment a seat is created, the intro always said
"Mention me with @handle when you need me" — for a BYO seat that is before any
wrapper process exists to answer. The promise is made in the agent's own
voice, which is the most authoritative surface we have.

Production message history shows what it costs. Four users took the
invitation and got total silence:

  m0re        2026-08-04  "@m0re-agent 1"                          → silence
  l3r0ys4n3   2026-08-07  "Hi", right after the intro              → silence
  user-8863   2026-08-09  asked 3x, in two phrasings, whether the
                          connection was working                   → silence
  ngoc-tran   2026-08-10  "@ngoc-tran-agent what modal you use"    → silence

None of the four came back. Across 21 real signups since 08-01, five ever
typed anything and four of those five were these. The reply rate on genuine
user mentions was zero.

The intro now derives liveness from `deriveAgentState` — the same derivation
the #891 honesty surface and the pod roster already use, so there is one
source of truth rather than a second guess — and says what is true:

  not listening: "Nothing is running me yet, so mentioning me won't reach
                 anyone. Whoever installed me can start me with
                 `commonly agent run <name>` ..."
  listening:     unchanged.

Deriving rather than assuming matters: an already-running agent installed
into a NEW pod is genuinely reachable, and telling that room nothing is
listening would be the opposite lie. Derivation failure falls back to the old
copy for the same reason.

Composition moved into `composeInstallIntro` in registry/helpers, pure, so
the copy rules are testable without a DB — the same reason agentStateService
is pure.

This is the preventive half of W4's stalled-connect work. #887 added honesty
copy to the connect PAGE and never touched this sentence, which is the one
users actually acted on.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8
lilyshen0722 and others added 2 commits August 13, 2026 19:17
…edged copy

ux-lead, fleet review 2026-08-14, reviewing #943.

The first version took `listening: boolean`, which collapsed two different
certainty classes. `never-connected` is structurally certain: no token has
ever been used. `gone-dark` is INFERRED from staleness. Under the boolean a
gone-dark agent announced "Nothing is running me yet" — flat-certain, and
factually wrong, because it demonstrably ran.

Asserting a guess in the agent's own voice is the same defect this PR exists
to remove, wearing a different costume. So the state enum is now passed
whole and there are three faces:

  never-connected  flat declarative, it never ran
  gone-dark        hedged — "I don't look connected right now — I was running
                   earlier and have gone quiet, so a mention may not reach me"
                   — instruction retained, because hedging the claim must not
                   cost the reader the fix
  otherwise        the invitation, unchanged

Derivation failure now falls to 'unknown' rather than a boolean true, which
lands on the same invitation branch and is an honest label for it.

Two tests added: gone-dark must not say "nothing is running me yet" while
still carrying the fix command, and unknown must keep the invitation.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8
…staller's

sprint-impl, fleet review 2026-08-14, reviewing #943.

`deriveAgentState` unions `installation.runtimeTokens` with a USER's
`agentRuntimeTokens` — and the user it means is the AGENT'S BOT ROW, because
that is where a polling wrapper stamps `lastUsedAt`. The first version passed
the human installer's tokens: a store no wrapper ever writes.

Consequence: a reused, demonstrably live seat unioned two empty-ish stores,
computed `never-connected`, and would have announced itself dead in a room
where it was actively working. That is the same false-certainty defect this PR
exists to remove, pointed the other way — and it was reachable, since install
upserts by natural key and the route's own comment names reinstalling an
existing identity as a supported case.

Now matched the way the pod roster does it (routes/pods.ts:437): find the bot
User by botMetadata agentName + instanceId and read its agentRuntimeTokens.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8
lilyshen0722 added a commit that referenced this pull request Aug 14, 2026
…read 'unknown' (#945)

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.


Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8

Co-authored-by: Claude Fable 5 <[email protected]>
@lilyshen0722
lilyshen0722 merged commit b9cf852 into main Aug 14, 2026
11 checks passed
@lilyshen0722
lilyshen0722 deleted the fix/install-intro-honesty branch August 14, 2026 03:03
lilyshen0722 added a commit that referenced this pull request Aug 14, 2026
…Map (#947)

Caught by live verification, not CI, and it made #943 a no-op on the exact
path it was written for.

`AgentInstallation` declares `config: { type: Map, of: Mixed }`
(AgentRegistry.ts:235). On a LIVE Mongoose document `config.runtime` is
therefore undefined — a Map needs `.get()`. `deriveAgentState` reads
`config?.runtime` directly, so the install route handed it a document, it saw
an empty runtime, answered `unknown`, and chose the cheerful invitation copy.

The proof was two readers of one field disagreeing. After the host:'byo' stamp
shipped, a seat minted through the REAL connect flow derived:

  /agent-states  (uses .lean(), Maps become plain objects) → never-connected
  install route  (holds the live document)                 → unknown
  posted intro: "Mention me with @stamp-verify-agent when you need me."

Exactly the promise #943 exists to stop making, to a seat with nobody home.

Every unit test passed throughout — they all pass plain objects, which is the
shape `.lean()` gives and the shape this call site did not have. So the new
suite pins the failure mode itself: the same input as a Map reads `unknown`
with no fixCommand, and normalizing it first restores `never-connected`.

Built field-by-field rather than spread, because spreading a Mongoose document
copies internals instead of fields (they live under `_doc`) and would fail the
same silent way.


Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8

Co-authored-by: Claude Fable 5 <[email protected]>
lilyshen0722 added a commit that referenced this pull request Aug 15, 2026
#956)

`user-fbd3` signed up on 2026-08-15, installed a BYO agent 77 seconds
later, never ran it, never typed a word, and left. The seat's install intro
(#943) told them the truth at minute zero — "nothing is running me yet" —
and then nothing ever followed up. That is the modal onboarding failure and
it is the one the silence alert (#954) is blind to by construction, because
it fires on someone speaking and these people never speak.

Fifteen minutes after a runtime token is issued and still unused, the seat
says so in the room where it was installed, addressed to the installer by
name, and hands over the exact command.

Built to ux-lead's spec, with three corrections from the fleet:

- **The episode key is max(createdAt) across BOTH token stores** — the same
  union deriveAgentState uses for liveness. Key off one store while
  triggering off the union and a reissue on the other path never resets the
  episode, so "a reissue earns one more nudge" silently stops firing
  (pod-architect). Exported as one helper so the reactive responder does not
  recompute it (sprint-impl).

- **The two token stores are not symmetric.** User.agentRuntimeTokens carries
  expiresAt; AgentInstallation.runtimeTokens does not (verified in both
  schemas). So a token episode ends differently depending on which store
  minted it. Recorded as `tokenSource` rather than left to be discovered.

- **The confirmation is not time-bounded, and is compound** (ux-lead): flat
  for the past because a first-connection timestamp is a fact, derived at
  post time for the present because that is an inference. "Connected (first
  seen 09:00 UTC). It isn't running right now — restart it with ..." That
  also dissolves the case I thought was invisible: lastUsedAt leaving null is
  a permanent transition, so a wrapper that connects and stops between passes
  is still seen, it just gets a different present tense.

The episode is claimed before the post, not after: a losing race then costs
one nudge rather than delivering two, and a second message in someone's room
cannot be taken back.

i18n is deliberately deferred, with the seam left visible. The spec asked for
en + zh-CN from day one; there is no mechanism — language lives in frontend
localStorage, never reaches the backend, there is no User.language and no
server-side i18n layer at all, and #943 shipped English-only for the same
audience. ux-lead's ruling: ship en now, because the load-bearing content is
the fixCommand and that is language-neutral, so an English nudge beats
silence. The composers take a `locale` they currently ignore so the layer,
when it lands, changes only them. Filed separately: persist the language
SWITCHER choice as User.language — the choice the user made, not the
browser's guess — which retro-covers #943 and the digest too.

One derivation throughout: deriveAgentState decides connected-ness, the
15 minutes is only a patience window on top of its verdict.


Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8

Co-authored-by: Claude Opus 5 <[email protected]>
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