Skip to content

feat(byo): verify the listening step live — the checkmark, not the paragraph - #909

Merged
lilyshen0722 merged 1 commit into
mainfrom
feat/byo-listen-verification
Aug 12, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
feat/byo-listen-verification

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

What

The first-mention dead-end, attacked at its source. New users finish the BYO page, mention their agent, and get silence — the #887 shape — because the listening step is a paragraph the page cannot check. Raft's connect gate works because it's a live checkmark over a real signal; this brings that to our flow without their default-yolo daemon:

  • Live verification: after token issue, the page polls /api/users/me/agent-connection (existing endpoint, no backend change; 4s cadence inside the 60/min limit) until this agent's token authenticates after issuance — name-match + issuedAt time-fence, so a user's pre-existing connected agent can never fake the checkmark. Flips to "✓ listening — mentions will wake it"; stops polling on success, page leave, or 15 minutes.
  • CLI install made unmissable: npm i -g @commonlyai/cli now rides as the first line inside the listen snippet — it previously lived in a footnote on the previous screen, so first-time users hit "command not found" exactly where we stopped watching.
  • Honest departure: while unverified, the "Go to pod" CTA carries a warning line ("isn't listening yet — mentions won't get answers…"). Never blocked — MCP-only setups are legitimate — but nobody leaves misinformed. en + zh-CN.

Tests

3 RTL tests: waiting→verified flip with the wrong-agent poll explicitly NOT flipping it, polling stops after success, transient poll failure keeps waiting, and the CLI line renders in the snippet.

Not verified locally (rule 10): frontend jest exits 194 with zero output in this environment — the pre-existing sibling suite (V2AgentBYOMemory) fails identically before any test executes, so the instrument is broken here, not the tests. CI's Test & Coverage is the verification tier; treat a red there as real.

What this doesn't solve (next slices)

Daemon persistence (survives reboots — the Raft raft-computer lesson, minus yolo), runtime detection, compose-time state in the pod (#891 surface 1 — awaiting ratification), and queue-parked mentions (#891 decision 2B).

🤖 Generated with Claude Code

https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8

…ragraph

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.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8
@lilyshen0722
lilyshen0722 merged commit a7d3fec into main Aug 12, 2026
11 checks passed
@lilyshen0722
lilyshen0722 deleted the feat/byo-listen-verification branch August 12, 2026 23:35
lilyshen0722 added a commit that referenced this pull request Aug 13, 2026
…space (plan D4) (#911)

* feat(onboarding): the Guide — a live first teammate in every new workspace (plan D4)

The empty-pod first minute is the biggest onboarding hole. Every new
signup's My Workspace now contains the Guide: a native-runtime agent that
answers immediately, coaches the existing starter checklist, points at the
BYO connect page (which now verifies connections live, #909), and does
real work — tasks, memory — so the first impression of "agents live here"
is a demonstration, not a promise.

- Definition: backend/config/native-agents/guide.ts. Model deepseek-v4-flash
  (alias verified in litellm-config) — D4's one real cost decision: the free
  OpenRouter tier was dying exactly when it mattered (#510), so the Guide
  gets a reliable cheap paid model with a hard ceiling instead.
- perUser manifests: the seeder publishes the registry row but does NOT
  install into the demo pod; installation happens per workspace in
  createDefaultWorkspacePod — install + membership + a SCRIPTED opener
  (deterministic and free; the room is never empty and never depends on a
  model call at the moment a first impression forms). Model turns begin
  with the user's first message. Best-effort: a guide hiccup never fails
  signup.
- wakeOnMessage manifests project onto the D8 flag (same rule as
  heartbeat): every message in the user's own workspace wakes the Guide —
  no @mention tax on the first hello. Claims + caps make this safe.
- config.dailyRunCap in the native runtime: at-cap declines before any
  claim, run row, or LLM call; count failure fails OPEN (#887). Guide caps
  at 60 runs/workspace/day — bounded by construction.

14 unit tests across the projection, the cap, and the existing claims
suite. Existing users get no Guide yet — the backfill script is a named
follow-up, after this proves itself on fresh signups.

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

* test(auth): the workspace's first inhabitants are the creator AND the Guide

The "creator is the sole member" assertion encoded pre-D4 behavior; PR #911
deliberately adds the per-user guide agent at signup. The test now asserts
both members explicitly (and exactly two), so a silent third inhabitant
would still fail.

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
…act + reconcile inspector/board task views (#916) (#920)

Three claim-vs-state drifts from the 2026-08-12 smoke, one PR because they
share a surface (the first-workspace task board):

1. TASK-001 "Connect your first agent" now completes itself the moment the
   BYO runtime token authenticates for the FIRST time — the same #909
   verified-listening moment the connect page's checkmark keys on. New
   starterTaskService targets the seeded card by sourceRef
   (onboarding:connect-agent), flips only pending/claimed, stamps a system
   update line, and emits task_updated. Hooked at every token-use stamp:
   both agentRuntimeAuth paths AND the WS transport (which stamps the same
   lastUsedAt and would otherwise swallow the first-use signal for WS-first
   agents). Fire-and-forget — a board write can never fail an auth request.

2. The v2 inspector now subscribes to task_updated (already emitted by every
   task write; previously consumed only by the v1 board) — a task created
   mid-conversation no longer sits beside a stale "Tasks 3" count until
   reload.

3. Run state shows the board's four buckets in the board's order — pending is
   no longer folded into "In Progress" (the "3 in progress vs 3 Pending" split
   reading), and the recent-task pill says "Pending" instead of "Active" for
   pending tasks. en + zh keys added.

Tests: 5 starterTaskService contract cases + 3 middleware first-use cases
(fires with podIds/label, once-only, path-2 parity) green locally alongside
the existing suite. Frontend typecheck clean; jest runs in CI (its tier).


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