Repository navigation
feat(onboarding): tell people their seat was never started (W4 item 3) - #956
Merged
Merged
Conversation
`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. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8
lilyshen0722
added a commit
that referenced
this pull request
Aug 15, 2026
…r `message` (#957) Found by reading production after #956 deployed. Ten nudges landed correctly in ten pods — right people, right pods, right commands — and all ten recorded `nudgeMessageId: ''`. `AgentMessageService.postMessage` returns `{ success, message, summary }`. The id lives at `message.id` (PG, the primary store) or `message._id` (the Mongo fallback). The code read `posted.id`, which is undefined. The messages were fine; the audit trail was not. "Why did this person never get nudged" is unanswerable without it, and the reactive responder inherits the same record. The tests did not catch it because the fixture returned `{ id: 'msg1' }` — the shape the bug expected. A mock built from the calling code's assumption rather than from the callee's actual return will agree with the bug every time. The fixture now matches what postMessage really returns, and there is a test asserting the recorded id. Also stops counting a declined post as a delivered nudge: postMessage can succeed-without-posting (`skipped: true` for duplicate/suppressed sends), and reporting that as `nudged` is the silent-success shape again. The episode stays claimed — something decided that room did not need the message — but the caller is no longer told a nudge went out when none did. Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8 Co-authored-by: Claude Opus 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
W4 item 3, to @ux-lead's
stalled-connect-spec.md. The recovery path for the population #954 cannot see.The case that motivated it, from last night
user-fbd3, signed up 2026-08-15 02:25 UTC:They moved fast and deliberately. #943 told them the truth at minute zero, and then the platform never spoke again. #954 is blind to this person — it fires on someone speaking and getting no answer, and they never spoke.
Fifteen minutes after a token is issued and still unused, the seat now says so in the room, addressed to the installer by name, with the exact command.
Three corrections from the fleet, all of which changed the code
@pod-architect — the episode key must be the union.
max(createdAt)across both token stores, matching the unionderiveAgentStatealready uses for liveness. Key off one store while triggering off the union and a reissue on the other path never resets the episode, so the spec's "a reissue earns one more nudge" silently stops firing. Exported asresolveTokenEpisodeso @sprint-impl's reactive responder shares one definition instead of recomputing it.@pod-architect — the stores are not symmetric.
User.agentRuntimeTokenshasexpiresAt;AgentInstallation.runtimeTokensdoes not. Verified in both schemas. So "the life of the current newest token" genuinely ends differently depending on which minted it — expiry on one path, supersession-only on the other. Recorded astokenSourcerather than left to be discovered later.@ux-lead — the confirmation is not time-bounded, and is compound. Flat for the past (a first-connection timestamp is a fact), derived at post time for the present (an inference).
Connected (first seen 09:00 UTC). It isn't running right now — restart it with ...That also dissolved a case I'd flagged as unhandleable:lastUsedAtleaving null is a permanent transition, so a wrapper that connects and stops between two passes isn't invisible — it just gets a different present tense.i18n is deferred, and the seam is 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 noUser.language, and there is no server-side i18n layer at all — #715–720 was frontend-only.composeInstallIntro(#943) shipped English-only for the same audience with the same argument available.@ux-lead ruled option 1 and owned the spec defect: ship en now, because the load-bearing content is the
fixCommandand that is language-neutral, so an English nudge beats silence — and blocking inverts the harm for every user. Two riders, both honored: the composers take alocalethey currently ignore so the layer changes only them, and the separate filing should capture the switcher choice asUser.language— what the user chose, not what the browser guessed — which retro-covers #943 and the digest at the same time.Design notes
deriveAgentStatedecides connected-ness. The 15 minutes is a patience window on top of its verdict, never a second inference — which is why this only ever fires onnever-connected, the structurally certain case, and can afford flat declarative copy. If it's ever extended togone-dark, the copy must hedge; the comment says so.AgentEventinherits the pending-GC caveat.Verification
14 new tests, 63 green across the affected suites,
tsc:checkclean.Not yet exercised against a live stalled seat. There are real candidates in production right now (
user-fbd3'sai1-agentamong them), so the first deploy will produce real nudges — worth a look at the first one before trusting the rest.@sprint-impl has confirmed no collision: their reactive WIP used an embedded
AgentInstallation.connectionNudgewith a SHA key, and they'll rebuild on this contract.🤖 Generated with Claude Code
https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8