Repository navigation
fix(members): land on Mate once, then the ordinary landing, even after a failed welcome - #18904
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that a reload while the welcome is still being sent (marker claimed, no row yet) skipping Mate is acceptable under rfc-mate-landing-once. [DESIGN-REVIEWED] 429ade8 Description read[DESCRIPTION-READ] 718b523dcbfe3ef07deab7636d36d3464eb7ed349abfc3d0829d49441d5964ac That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Both new row fields feed only the one conjunction in What this change shipsInventory (5 items) — 5 justifiedIntent: a user whose Mate welcome failed or was never owed should get the ordinary Crewmates landing instead of being pinned on an empty Mate. FIX.
[FIRST-PRINCIPLES-REVIEWED] 429ade8 Description read[DESCRIPTION-READ] b41f0f4bc2405ea4148ff5ff0a699d9b04d0ed5267c8061fd2b1999708bdffab That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Review detailsFindings (advisory only, nothing blocks the merge). FINDING — docs/system-specs/modules/crew-mode.md:1160 — the spec still says the page "opens Mate while no message has been exchanged with it ( [OPUS-REVIEWED] 429ade8 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS A human should open bare [UX-REVIEWED] 429ade8 Description read[DESCRIPTION-READ] a129908d60f1e074daa00e9b20d45540739363de6b049881a037b465ea102014 That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
5ed7d6c to
38f015b
Compare
38f015b to
fe713e7
Compare
fe713e7 to
81a4032
Compare
…r a failed welcome Mate's landing (#18406) answered Mate while its thread was empty. The once-only welcome marker is claimed before the welcome is dispatched, so a failed welcome left the thread empty for good and every bare visit landed on Mate. The roster row now reports whether Mate's marker is claimed (welcome_claimed), and resolveMateLanding yields once the marker is claimed or the thread has a row; an unknown state uses the ordinary landing (rfc-mate-landing-once, #18903).
81a4032 to
429ade8
Compare
buluoray
left a comment
There was a problem hiding this comment.
Approving at 429ade8.
Checked against the accepted rule: Mate is the landing target only until its welcome has been sent or attempted, then the ordinary landing applies, and ?member= keeps priority.
resolveMateLanding(MembersPage.tsx:331-334) lands on Mate only when its thread is empty,welcome_owed === trueandwelcome_claimed === false. Anything else, including a row that omits the fields, uses the ordinary landing. The rule is evaluated only when no?member=is present (MembersPage.tsx:3412).- Failed welcome:
maybe_start_first_greetingclaims the O_EXCL marker before dispatching (mate_welcome.py:200-213) and never removes it. A turn that fails leaves the marker claimed and the thread empty, which now reads as seen and lands on the last-chatted crewmate. This is the case that previously pinned users on Mate. _stamp_welcome_claimed(handlers/members.py:952-975) adds the fields only to the built-in Mate row and uses the samemembers.welcome_owedpredicate the greeter checks before claiming, so the landing and the greeter agree on whether a welcome is owed. An unreadable marker leaveswelcome_claimedoff, and the client treats that as seen, so nobody gets pinned.- Existing users who already chatted with Mate:
pendingMateis undefined once the thread has history (assistantMember.ts:22-27), so their landing is identical to main.
Each guard is pinned by the suite. Removing welcome_claimed === false, removing welcome_owed === true, removing the server stamp, or reporting an unreadable marker as false each turns a specific named vitest or pytest case red. Locally, the MembersPage and src/lib vitest suites (626 tests) and the four related pytest modules (50 tests) pass at this head. CI is green.
Non-blocking: with a claimed-but-empty Mate, the page now dispatches the Meet CrewMates entry event on that visit, while useMeetCrewmatesGate still reads pendingMate. Worth confirming that this order is what you want for a user whose welcome failed.
bolichen97
left a comment
There was a problem hiding this comment.
Approved at head 429ade8: PR Readiness is green, no open change requests, and the review lanes passed. (AI-assisted review at bolichen97's request.)
Problem / Motivation
Goal: Mate gets one landing on the Crewmates page, for fresh and existing users alike; once its welcome is sent or attempted, a bare visit opens the crewmate the user last chatted with.
Goal revised 2026-10-11 on the decision owner's ruling (buluoray, review of #18903, recorded in
rfc-mate-landing-once.md). The first version yielded whenever another crewmate had been chatted with; the owner rejected that, since existing users would never be introduced to Mate.A user was moved onto Mate (the first crewmate from #18406) on every bare
/membersvisit, never reaching the conversation they came back for. When Mate's welcome lands this already ends. It never ends when the welcome fails or is never owed: the once-only marker is claimed before the welcome is dispatched, a failed turn leaves the thread empty for good, a Mate with no owed record is refused before the claim, andpendingMateanswers Mate on every visit.Why it matters
A user whose Mate welcome failed (signed-out CLI, no backend) or was never owed is pinned on an empty Mate for good, so the "reopen the last-interacted crewmate" landing (#17808, #17953, backed by
crew_recency) never runs for them.Not a goal
rename_self, the once-per-visit rule below md, or the Meet CrewMates hold.crew_recencyor the server'slast_chat_ts.What changed (motivation → approach → change)
Symptom: a user lands on an empty Mate on every visit → cause:
resolveMateLandingwaspendingMate(thread empty), and an empty thread does not mean a welcome is coming → change: Mate is landed on only while its welcome is still coming, per rfc-mate-landing-once.md (accepted by buluoray on #18903; status flip and owed condition in #19064).src/kiro_crew/dashboard/handlers/members.py_stamp_welcome_claimed: on the roster read, Mate's row (and only Mate's) carrieswelcome_owed(members.welcome_owed) andwelcome_claimed(thewelcome_claimed.jsonmarker exists). A marker that cannot be checked leaveswelcome_claimedoff; an unreadable owed record reads as not owed.website/src/pages/members/MembersPage.tsxresolveMateLanding: Mate only whenpendingMate(no row) ANDwelcome_owed === trueANDwelcome_claimed === false. Anything else, or a row that does not say, uses the ordinary landing (last-chatted, then remembered).website/src/api/client/agents.ts: the two optional row fields.?member=wins,defaultdoes not count, Mate stays on the roster,pendingMateand the Meet CrewMates hold.Backwards compatibility
Compatible: two optional fields on Mate's roster row only; nothing main accepts is rejected.
Reader: website/src/pages/members/MembersPage.tsx:resolveMateLanding -- crew page -- a Mate whose welcome is owed and unclaimed still lands for fresh and existing users (
an existing user who chatted with a crewmate lands on an unseen Mate once,a default + Assistant roster opens the Assistant…,a never-chatted Mate opens below md too…)Reader: website/src/hooks/useMeetCrewmatesGate.ts:useMeetCrewmatesGate -- crew page -- unchanged; still reads
pendingMate(useMeetCrewmatesGate.test.tsx)Tests
website/src/pages/members/MembersPage.test.tsx(theassistantRowfixture reports an owed, unclaimed welcome):an existing user who chatted with a crewmate lands on an unseen Mate onceafter Mate's welcome row exists, the next bare visit lands on the last-chatted crewmatea claimed welcome marker on an empty Mate thread (a failed welcome) lands on the last-chatted crewmate(also: Mate still opens from the roster)an empty Mate with no owed welcome and no marker lands on the ordinary landinga roster that cannot say whether Mate was seen uses the ordinary landingresolveMateLandingunit cases: claimed, unknown claim, not owed, unknown owed.test/test_members_welcome_claimed.py: Mate's row reportswelcome_owedfalse then true aftermark_welcome_owed,welcome_claimedfalse then true afterclaim_greeting_marker(thread still empty), no fields on other rows; an unreadable marker leaveswelcome_claimedoff.Red-before: on
origin/maincode with these test files, 4 vitest cases fail (unit, failed welcome, not owed, unknown state) and the backend before/after test fails (KeyError: 'welcome_owed'). On this branch:src/pages/members/,useMeetCrewmatesGate,assistantMember,MeetCrewmatesFlowpass (30 files, 755 tests,--maxWorkers=1); pytesttest_members_welcome_claimed,test_crew_starred,test_mate_welcome,test_members_roster_recency,test_welcome_owedpass (75).tsc,eslint --max-warnings 0on touched files,i18n:checkpass.Manual verification
A built SPA over a stubbed API (
scripts/lib/stub-dashboard-api.mjs), Crewmates preview on, bare/members, built fromorigin/main(before) and this branch (after):oncallchatted 1 h ago)?member=mate?member=oncall?member=mate?member=mateScreenshots / video
Failed welcome (marker claimed, Mate's thread empty):
Before:
After:
Dark theme, and a welcome still coming (unchanged: lands on Mate)
Related Issues
Follows #18406. Decision: #18903 (merged), #19064 (accepted status and owed condition).
Pattern harvest
Not generalizable: one landing rule read an empty thread as "a welcome is coming"; the fix reads the welcome's own server state.
Checklist
Contribution License Agreement
Contributed under the project's Apache-2.0 license.