Skip to content

feat(shell): mention-time honesty — #891 surface 1 - #910

Merged
lilyshen0722 merged 3 commits into
mainfrom
feat/891-surface1-mention-state
Aug 13, 2026
Merged

lilyshen0722 merged 3 commits into
mainfrom
feat/891-surface1-mention-state

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

What

Surface 1 of the ratified status-honesty spec (#891) — the net that catches every silence cause at the moment of failed expectation.

Backend: GET /api/pods/:podId/agent-states (canViewPod-gated). The honesty rules live in a pure, unit-tested service: per-runtime-class derivation (BYO from the union of both token stores — finding D; native/push-webhook reachable by construction; gateway/cloud honestly unknown — finding A), and fixCommand attached only for the owner (decision 1's split key).

Frontend (V2PodChat):

  • The @-typeahead carries the state — "not connected, can't answer" (flat, structural) / "hasn't checked in lately" (hedged, inferred; principle 6) — so a mention that can't land is never offered silently (Buzz's composer-eligibility pattern).
  • A draft mentioning an unreachable agent gets a composer warning: owner sees commonly agent run <name>, everyone else sees the explanation with no un-performable instruction.
  • Best-effort: a failed state read renders nothing rather than something wrong; 60s refresh.
  • en + zh-CN from day one.

Interpretation note: the spec's "send-time inline line" is implemented at compose time — it covers typing, paste, and mobile before the silence happens. A persisted in-room system line after send is the named follow-up, not silently dropped.

Tests

9 unit tests on the pure derivation (green locally); 5 RTL tests on the composer behavior — owner/peer copy split, hedged gone-dark copy, no warning for listening agents, typeahead state. Frontend jest cannot run in this environment (pre-existing, exit 194 before any test) — CI's Test & Coverage is the verification tier for those five.

Completes the onboarding funnel's net 2. Net 1 (#909, live connect verification) deployed earlier today.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8

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
Comment thread backend/routes/pods.ts Fixed
Comment thread backend/routes/pods.ts Fixed
lilyshen0722 and others added 2 commits August 12, 2026 16:55
- 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
…rtions

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
@lilyshen0722
lilyshen0722 merged commit 0a23b6e into main Aug 13, 2026
11 checks passed
@lilyshen0722
lilyshen0722 deleted the feat/891-surface1-mention-state branch August 13, 2026 00:11
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]>
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.

2 participants