Repository navigation
Conversation
Opening a Crew Member's DM (POST /api/members/{slug}/thread) resolves the
member's memory binding, and that resolver fails closed while the gateway
is still restoring and indexing memory after a start. The route did not
wait on the shared preparation task the way a chat turn does, so the
Members page's first open after every restart met a hard 503
(store_unavailable: "Memory is being restored and prepared during gateway
startup") on a fence that cleared seconds later, and the page raised its
error notice with no retry.
The open now waits on the same task with the same bounded grace a turn
gets at its admission seam. A grace that still expires answers 503 with a
distinct code, memory_preparing, plus a Retry-After header: unlike
store_unavailable, which covers refusals only the owner can clear (a
failed restore, a broken binding), this one is cleared by preparation
finishing, so a client may re-ask on its own. The Members page does so on
a bounded timer while keeping the column in its "Opening the
conversation..." state, and reports a failed open only past the cap.
Tests pin the hold-then-bind path, the retryable refusal past the grace
(shared task untouched, retry succeeds once preparation lands), the
fail-closed code for a structural failure, and the page's retry loop and
cap. The memory spec documents the route's place in the preparation
barrier.
UX Review (Fable 5) — ✅ PASSUX-level review of UX-Verdict: PASS Verify the multi-minute silent "Opening the conversation…" wait after a restart is acceptable without naming its cause. Suggestions
[UX-REVIEWED] c2c8b3d |
Design Review (Fable 5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS One page-wide retry timer over per-member retry state lets a stale member's retry silently kill the visible member's chain, re-sticking the exact startup window this fixes. Watch
Suggestions
[DESIGN-REVIEWED] c2c8b3d |
GPT 5.6 Review — 🔴 changes requested (blocking)GPT 5.6 found at least one blocking issue that must be resolved before merging This comment is updated in place on each push. BLOCKING -- src/kiro_crew/dashboard/handlers/members.py:369 -- preparation wait resumes with a stale registry snapshot FINDING -- website/src/pages/members/MembersPage.tsx:730 -- [GPT-REVIEWED] c2c8b3d Adjudication (Opus 4.8) — is blocking on each finding proportionate?The adjudicable block is empty (0 findings). One fenced finding, F1. F1 — members.py:369 — Harm rung: data-corruption class (fence-classified unbounded). Conditions confirmed this run: stale False positive or not applicable? A repository writer can comment: |
First Principles Review (Fable 5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The 3s/10× re-POST loop re-implements react-query's Not justified as shipped
What this change shipsInventory (7 items) — 5 justifiedIntent: FIX — opening a Crew Member's DM right after a gateway restart should succeed once memory preparation finishes instead of failing immediately with a 503 notice.
[FIRST-PRINCIPLES-REVIEWED] c2c8b3d |
Opus 4.8 Review — ✅ no blocking findingsReviewed Review detailsNo blocking issues — one advisory finding on the retry-counter reset. FINDING — website/src/pages/members/MembersPage.tsx:730 — the failed branch runs Candidate 2 dropped: only one member is active/displayed at a time, and [OPUS-REVIEWED] c2c8b3d Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
|
🤖 Kiro Crew [operator: chenmingwei23]: This PR has been inactive for 7+ days with failing CI. I've assessed the blockers and they appear resolvable — I'll push fixes directly to this branch as a co-author. Assessment: GPT flags a real reachable defect in members.py: after the newly added preparation wait, the handler resumes with a stale cfg/binding and can create a live slot + durable DM binding for a member deleted during the wait. Fix: reload config and binding after the wait, revalidate the slug owner before creating anything; also retain the capped retry count for terminal memory_preparing responses (MembersPage.tsx). Branch conflicts with main — rebase too. If you'd prefer I don't touch this PR, add the |
|
Closing as superseded: origin/main no longer fences the member-DM open on memory preparation This PR works around the 503 Where main has it:
Rebasing this PR (as the 2026-09-21 autofix note proposed) would make main worse. On main, What is left: main has no test that checks "a member-DM open while preparation is pending returns 200 without waiting". That would be a small test PR on its own and is no reason to keep this one open. Nothing else is worth keeping. If the open still hits the fence on main in some case I missed, please reopen with a repro. From a full open-PR audit against origin/main c66f95b (2026-09-25); findings were checked by independent reviewers reading the code. Reply here if this is wrong. |
Summary
Opening a Crew Member's DM (
POST /api/members/{slug}/thread) resolves the member's memory binding throughrequire_member_memory_store, and that resolver fails closed while the gateway is still restoring and indexing memory after a start. The route did not wait on the shared preparation task the way a chat turn does at its admission seam, so the Members page's first open after every restart met a hard 503:The fence clears seconds later, but the page raised its error notice with no retry.
Change
dashboard/handlers/members.py): the open awaitswait_for_memory_preparation(state.memory_startup_task)before resolving the binding, the same bounded grace a turn gets. A grace that still expires answers 503 with a distinct code,memory_preparing, plusRetry-After.store_unavailablekeeps covering refusals only the owner can clear (a failed restore, a broken binding), so a client never sits retrying those.memory_startup.memory_preparation_pending()is the one-line predicate that tells the two apart.MembersPage.tsx): amemory_preparingrefusal re-POSTs on a bounded timer (3s gap, 10 re-asks; each POST already holds server-side) while the column keeps its existing "Opening the conversation…" state. Past the cap the failure is reported the way any other open failure is. No new user-facing strings.Tests
test/test_members_dm_thread.py::TestMemoryPreparationGrace: hold-then-bind within the grace (no slot born while held); retryablememory_preparingpast the grace with the shared task untouched and the retry succeeding once preparation lands; structural failure keepsstore_unavailableand noRetry-After. Mutation check: the first two fail onorigin/main's handler.MembersPage.test.tsx: retry loop until the thread binds (no notice, timer stops on success); cap reached reports the failure with its report and stops re-asking. Both fail with the page change reverted.test_memory_startup.py,test_members_dm_thread.py,test_member_memory_runtime.py(240 passed);src/pages/members/vitest (155 passed); tsc, eslint, black/isort/flake8/mypy, comment-history gate, i18n check, jscpd, docs lint, error-code contract.