Skip to content

fix(byo): the connect flow promised an agent that answers; MCP alone does not - #888

Merged
lilyshen0722 merged 1 commit into
mainfrom
fix/byo-connect-honest
Aug 10, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
fix/byo-connect-honest

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

Fixes the user-facing half of #887.

What users experienced

4 of 6 human @mentions in ten days got no reply. They did nothing wrong —
user-8863 connected an opencode agent and asked it twice whether the Commonly
connection was working. It couldn't answer, which was its own answer.

Why

The web BYO flow wires MCP. That makes an agent able to call Commonly
from the user's editor. Nothing in that path listens for mentions.
commonly agent run — the wrapper that actually polls CAP — was a footnote
on the page: "Prefer the CLI?"

So the primary connect flow produces an agent you can talk from, not one you
can talk to. Two minutes later it shows up in Your Team, the user mentions
it, and nothing happens, because nobody is listening.

Everything else in the product assumes the second kind: Your Team lists it,
@mention targets it, and the first-run guide's step 3 is literally "say
hello"
.

Changes

1 — the listening step, at the point of the promise. The BYO result page now
carries it inline: what MCP does and doesn't do, the commonly agent run command
with the real token, and the consequence named with the agent's own name —
"Without it, <name> appears in your team but stays silent when mentioned."

2 — Your Team stops calling unreachable agents quiet. lastHeartbeatAt comes
from heartbeat events, so a wrapper that was never started has none. That
rendered as "No recent activity" — indistinguishable from an idle agent, which
is how 13 unreachable installs sat beside working ones looking healthy. Now
it reads "Never connected".

What I deliberately did not do

Rename runtimeType: 'webhook' to something honest. Eight-plus call sites across
both provisioners pair webhook || claude-code as the skip-provisioning case, so
the rename is real blast radius in exchange for a naming aesthetic — while change
2 delivers the actual outcome (unreachable state stops looking healthy) via
observable data. Reasoning recorded on #887 rather than silently dropped.

The zero-events question from #887 is also still open and still parked: enqueue
creates events for every runtime except native, so a mention to these should
leave a pending event even with nobody listening. It didn't. Worth chasing, but
moot for the user either way.

Verification

Nine tests across both locales, including that "never connected" and "no recent
activity" can never collapse to the same string. 29 suites / 153 tests pass,
typecheck clean. zh-CN throughout — both users who hit this wrote Chinese.

…does not

Measured 2026-08-09: 4 of 6 human @mentions in ten days got no reply. Not user
error — the users did exactly the right thing. user-8863 connected an opencode
agent and asked it twice whether the Commonly connection was working, and it
could not answer, which was its own answer.

Cause: the web BYO flow wires MCP. That lets an agent CALL Commonly from the
user's editor. Nothing in that path listens for mentions — `commonly agent run`,
the wrapper that polls CAP, was a footnote on the page ("Prefer the CLI?").
So the primary connect flow produces an agent you can talk FROM, not one you can
talk TO. Two minutes later it appears in Your Team, gets mentioned, and is
silent, because nobody is listening.

Two changes, both at the point where the promise is made:

1. The BYO result page now carries the listening step inline — the reason, the
   `commonly agent run` command with the real token, and the consequence named
   with the agent's own name: "Without it, <name> appears in your team but stays
   silent when mentioned."

2. Your Team distinguishes "never connected" from "no recent activity".
   `lastHeartbeatAt` is derived from heartbeat events, so a wrapper that was
   never started has none at all — and rendering that as merely quiet is how 13
   unreachable installs sat beside working agents looking healthy.

Deliberately NOT renaming runtimeType 'webhook' to something honest. Eight-plus
call sites in both provisioners pair `webhook || claude-code` as the
skip-provisioning case; the rename is blast radius for a naming aesthetic, while
the observable-state fix above delivers the actual outcome. Recorded on #887.

zh-CN throughout — both users who hit this were writing Chinese.

Nine tests pin it in both locales, including that never-connected and no-recent
can never collapse to the same string.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8
@lilyshen0722
lilyshen0722 merged commit 6005024 into main Aug 10, 2026
11 checks passed
@lilyshen0722
lilyshen0722 deleted the fix/byo-connect-honest branch August 10, 2026 02:10
lilyshen0722 added a commit that referenced this pull request Aug 12, 2026
…ragraph (#909)

New users connect through the web flow, mention their agent, and get
silence — because nothing on their machine is listening, and nothing on the
page could tell them. #888 made the listening step legible; this makes it
CHECKABLE: after issuing the token the page polls
/api/users/me/agent-connection (4s, inside the 60/min budget) until THIS
agent's runtime token authenticates after issuance, then flips the step to
"✓ listening — mentions will wake it". Name-match + issuedAt time-fence
mean a pre-existing connected agent can never flip the checkmark for the
one just issued.

Also: the CLI-install line now rides inside the listen snippet (it lived in
a footnote on the PREVIOUS screen, so first-time users hit "command not
found" one step after we stopped watching), and the "Go to pod" departure
gets honest copy while unverified — never blocked (MCP-only setups are
legitimate), but nobody leaves believing mentions will be answered when
they will not. en + zh-CN from day one.

Not verified locally: frontend jest exits 194 with zero output in this
environment (pre-existing sibling suite fails identically before any test
runs) — CI's Test & Coverage is the verification tier; treat a red there
as real.


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

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
lilyshen0722 added a commit that referenced this pull request Aug 12, 2026
)

* docs(design): agent status honesty — brief for fleet design review

The "Never connected" label in #888 was a patch. This is the brief for the
real thing: agent health as a first-class designed surface, because Your Team
was built to display a roster and the job turned out to be displaying a
fleet, where alive-vs-dead is the whole point.

Grounded in named casualties (spiderpc, user-8863, ngoc-tran, user-575a) and
in the five states the kernel can honestly derive today from signals that
already exist — Listening, Gone dark, Never connected, Misconfigured, and
Degraded (the hq-support acks-but-cannot-act state, which has no clean kernel
signal yet and is the hardest open problem in the brief).

The priority surface is not a dashboard: it is the moment a human @mentions
an agent that cannot answer. An inline explanation at send time converts the
#887 silence into an answer in the room at that second — the intervention
that would have saved every named user.

Principles to argue with in review: alarm where the user owns the fix; every
bad state names its fix; cobalt stays out of it (small semantic token set,
tokens.css and v2.css moving together); "gone dark" is normal for laptops
overnight and must not read as an outage; zh-CN from day one.

Review runs in the Sharpen pod under the new tone contract, with reviewers
assigned per their edge: UX Lead interaction, Pod Architect state
derivations, Sprint Review as adversary on the ownership-keyed alarm rule.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8

* docs(design): agent status honesty — fold the fleet review in (msgs 52986-52991)

The brief went to the Sharpen fleet as planned; this folds the review back
into the document so Sam ratifies one artifact:

- Split the key (52987's amendment): alarm is ownership-keyed, explanation
  is dependency-keyed — resolves the P1/P2 contradiction, and gives fan-out
  installs and agent-dm rooms (no owner member) a surface.
- Per-runtime-class signal table (52988/52991): lastUsedAt is only honest
  for CLI wrappers; moltbots share the gateway boot timestamp; native reads
  AgentRun (which recorded a four-month first-party degradation no surface
  showed — #895); webhook never authenticates inbound.
- Sixth state: Unreachable (52990) — declared trigger with no producer,
  static at install time; pod-welcomer's 0-of-1727 pod.join firings (#898).
- Degraded resolved without new telemetry: route capture on the existing
  agentRuntimeAuth write + AgentRun.toolCalls for native + the
  ack-without-ledger-write driver signature (#896).
- Copy contract: certainty matches signal certainty; the drafted "can't see
  this yet" over-promised against the ~30-min mention GC — park-and-redeliver
  vs honest copy is now an explicit ratification decision.
- Derivation caveats measured in review: union both token arrays, normalize
  runtimeType (88% unset), precedence between structural and inferred states,
  test-debris exclusion, evidence-retention windows (the cleanup cron
  false-positived all three native apps on GC'd AgentEvents).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8

* docs(design): second fleet pass — orthogonal axes replace the inverted precedence rule

The fleet verified the fold against their own findings through the shipped
claim/wake machinery (msgs 53002-53011) and caught two defects in the first
revision:

- "Structural states outrank inferred ones" inverted the finding it cited
  (53004): it renders the fleet's two freshest agents Misconfigured, in the
  most-confident copy register — the exact false positive 52988's finding B
  raised. Replaced with 53006's resolution: liveness and config are
  orthogonal render axes (working + config-attention chip, never broken),
  live evidence outranking static config where a single verdict is forced.
  Now ratification decision 6.
- ":115 reaches a third of the fleet" overgeneralized a 3-app measurement
  fleet-wide (53008) — scoped honestly; fleet trigger distribution is
  unmeasured.

Sprint Review's pre-registered falsifier fired against its own earlier
claim and confirmed the fold's version (53009) — recorded in Process.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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