Skip to content

docs(design): agent status honesty — brief for fleet design review - #891

Merged
lilyshen0722 merged 3 commits into
mainfrom
design/agent-status-honesty
Aug 12, 2026
Merged

lilyshen0722 merged 3 commits into
mainfrom
design/agent-status-honesty

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

Sam's call after the smoke test found ngoc-tran hitting silent mentions a day
after the fix merged: the #888 label was a patch — the real design is agent
health as a first-class surface
, and it goes through the fleet for design
review before implementation.

Five honestly-derivable states (all from signals that exist today), four named
casualties grounding it, and one hard open problem: Degraded — the
hq-support state where an agent acks events but cannot act — has no clean
kernel signal, and both candidate fixes have costs.

The priority surface is deliberately not a dashboard. It is the moment a
human @mentions an agent that cannot answer
— an inline explanation at send
time, in the room, which is the intervention that would have saved every user
named in the brief.

Review assignments: UX Lead (interaction, alarm/calm balance), Pod Architect
(state derivations, the Degraded signal), Sprint Review (adversary on
ownership-keyed alarming). Runs in the Sharpen pod under the 0.2.0 tone
contract — which makes it the first real test of that contract too.

Merging this PR = the brief is the agreed starting point; the reviewed spec
comes back to Sam for ratification before code.

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 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8
…2986-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 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8
@lilyshen0722

Copy link
Copy Markdown
Contributor Author

Review round complete — the fleet reviewed in Sharpen (msgs 52986–52991) and d9cdbc4a folds every accepted finding back into the brief. Headline changes: the key splits (alarm=ownership, explanation=dependency), the signal table goes per-runtime-class (AgentRun for native, route diversity for outbound-authenticating, lastUsedAt only for CLI wrappers), a sixth state Unreachable (declared trigger with no producer), and the Degraded problem is resolved without new telemetry. Five explicit decisions are queued under "Decisions for ratification."

The review also surfaced a live defect chain, already handled separately: #895 (native heartbeat opt-in projection — the 8-day first-party outage), #896 (boot-backlog ack-without-spawn), #897 (kernel cascade gap), #898 (pod.join producer / Unreachable implementation).

🤖 Generated with Claude Code

https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8

lilyshen0722 added a commit that referenced this pull request Aug 12, 2026
…into the install config (#895)

#833 made heartbeat dispatch require config.heartbeat.enabled === true and
read every unset flag as "nobody chose this." For the native first-party
apps that reading was wrong: pod-summarizer's manifest declares
triggers: ['heartbeat'] — the author chose it — but the seeder never
projected that choice into the flag the scheduler gates on. Result: zero
runs for any first-party app since the 2026-08-04 deploy, an outage the
#891 reviews surfaced from AgentRun history (failure rate had already
climbed 45%→100% Apr→Aug on the LiteLLM wall before the pulse stopped
entirely).

The seeder now projects a declared heartbeat trigger into
{ heartbeat: { enabled: true, everyMinutes } } — everyMinutes on the key
the scheduler actually reads. The old top-level heartbeatIntervalMinutes
copy was read by nothing (pod-summarizer declared 360 and ran hourly on
the default for four months); it is gone rather than left to drift.
Deploy is the repair: the seeder $sets config on every boot.

task-clerk and pod-welcomer stay heartbeat-free by design — they never
declared one. pod-welcomer's declared pod.join trigger having NO producer
is a separate bug, filed separately.


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

Co-authored-by: Claude Fable 5 <[email protected]>
…d 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 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8
@lilyshen0722
lilyshen0722 merged commit f51b93a into main Aug 12, 2026
10 checks passed
@lilyshen0722
lilyshen0722 deleted the design/agent-status-honesty branch August 12, 2026 23:38
lilyshen0722 added a commit that referenced this pull request Aug 13, 2026
* feat(shell): mention-time honesty — #891 surface 1

The highest-coverage net for the first-mention dead-end: the moment a human
composes a mention of an agent that cannot hear it, the shell says so.

- GET /api/pods/:podId/agent-states — canViewPod-gated; derivation lives in
  agentStateService, pure and unit-tested. States are per runtime class,
  because the #891 review measured lastUsedAt lying for every class except
  the polling one: BYO installs derive listening/gone-dark/never-connected
  from the union of BOTH token stores (finding D); native and push-webhooks
  are reachable by construction; gateway/cloud classes are 'unknown' rather
  than guessed from a shared boot timestamp (finding A). fixCommand attaches
  only for the owner (decision 1's split key — an instruction addressed to
  someone who cannot perform it is the P1/P2 contradiction).
- V2PodChat: the @-typeahead carries the state ("not connected, can't
  answer" / "hasn't checked in lately") so a dead mention is never offered
  silently, and a draft mentioning an unreachable agent gets a composer
  warning — certainty-matched copy (never-connected flat, gone-dark hedged,
  principle 6), owner gets the wake command, everyone else the explanation.
  Best-effort: a failed state read renders nothing rather than something
  wrong. en + zh-CN.

Implemented interpretation of "send-time inline line": the warning renders
at COMPOSE time, which covers typing, paste, and mobile before the silence
happens; a persisted in-room system line post-send is the named follow-up.

9 unit tests on the derivation (run locally); 5 RTL tests on the composer
(CI-verified — frontend jest cannot run in this environment, pre-existing).

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

* fix(shell): CI round — type the token scan, rate-limit the states route

- tokens from draft.match typed explicitly: the bare [] fallback inferred
  never[] under the CI tsc config (local `tsc -p .` missed it — the CI
  command is `npm run typecheck`; use that locally from now on).
- agent-states gets the same 60/min limiter shape as the file's other
  reads (CodeQL js/missing-rate-limiting, same class as the tasks claim
  route). Composer polls at 60s per open pod — the ceiling is for runaway
  tabs, not the design load.

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

* test(shell): match useV2Api's two-argument get in the state-poll assertions

The hook passes auth headers as a second argument; toHaveBeenCalledWith
requires the full argument list, so all five waitFor gates failed in CI
before any behavioral assertion ran.

Co-Authored-By: Claude Fable 5 <[email protected]>
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 13, 2026
…un 401'd before its model (#912)

The Guide's first live smoke run failed with "Incorrect API key provided:
placeholder" from platform.openai.com — not the model (deepseek-v4-flash
authenticates fine, probed) but the openai-moderation-enforce guardrail,
whose OPENAI_API_KEY is the literal placeholder. Every guarded native run
dies on the guardrail before reaching any model, which is also the probable
cause of the native fleet's 98% July failure rate (predating the August
LiteLLM outage the #891 review surfaced).

NATIVE_RUNTIME_GUARDRAILS becomes helm-tracked (a kubectl-set env is drift
the next upgrade reverts — the #900 lesson) and dev pins it to
injection-guard only: LiteLLM-native, keyless, and the guardrail that
actually matters for untrusted input. Restore the moderation layer when a
real OpenAI key lands in the api-keys secret.


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 13, 2026
…obbered — every pod page crashed (#936)

P0, caught live in post-deploy browser verification. #935's activity
derivation was written as a NEW file at backend/services/agentStateService.ts
— a path where the #891 mention-honesty service already lived. Its
same-named test sat at the same test path, so the clobber also buried the
suite that would have caught it, and CI stayed green. Live effect: the
/:podId/agent-states route called MY deriveAgentState(lastActiveAt,
runtimeType) with (installation, tokens, callerId), returned bare 'stale'
strings, and the typeahead useMemo crashed the ENTIRE pod page on
s.agentName.toLowerCase().

- restore agentStateService.ts + its test verbatim from #910
- re-add the activity pieces in the SAME file under non-colliding names:
  collectPodAgentActivity + deriveActivityBucket (tool + roster call sites
  updated); activity tests live in agentStateService.activity.test.js
- V2PodChat: the honesty surface promises 'silence over a wrong dot' —
  that now includes malformed payloads; shape-guard the map so a bad
  backend degrades to no-dots, never an error boundary


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 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 added a commit that referenced this pull request Aug 14, 2026
…n't there (W4 preventive) (#943)

* fix(onboarding): the install intro stops promising a listener that isn'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

* fix(onboarding): don't assert an inference — gone-dark gets its own hedged 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

* fix(onboarding): read liveness from the BOT's token store, not the installer'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

---------

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