Skip to content

fix(session): refuse stale sessions at claim time and surface refused clears - #7161

Closed
rnoack1 wants to merge 1 commit into
kirodotdev:mainfrom
rnoack1:fix/reset-skip-if-busy
Closed

rnoack1 wants to merge 1 commit into
kirodotdev:mainfrom
rnoack1:fix/reset-skip-if-busy

Conversation

@rnoack1

@rnoack1 rnoack1 commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

This description previously claimed the change adds an atomic skip_if_busy guard to the queued project-change reset. That claim was false against this base and has been rewritten. Verified at merge base 9f3c07dc78b7: chat_runner.py:3879 already reads reset_ok = await state.sessions.reset(pending_key, skip_if_busy=True), and effective_session_key(slot) is already resolved at the switch handlers (7 sites in chat_handlers.py). This diff adds neither — 0 added lines matching either. The one-line guard the old title named has landed upstream independently, so the red-then-green verification the old text described could not occur against this base.

What remains is larger than that headline and is stated below on its own terms.

A slot's project can change while a session bound to the OLD directory is still reachable. Three windows stay open once the queued reset is allowed to decline:

  • A claim arriving with no stated cwd was reused on directory match alone, so a channel turn (which states no cwd) could be served a session bound to the pre-change project.
  • An agent switch that keeps slot.project is invisible to a directory test, so the switched-away agent could serve the next turn.
  • A cold start already in flight holds no registry entry, so neither reset nor has_session can see it, and a probe-then-act sequence cannot protect against it.

Separately, api_channel_clear_context was destructive on a busy member, and the earlier wording here got that backwards. It claimed the endpoint "reported success for a clear it did not perform"; verified at the merge base, the handler called state.sessions.reset(agent.session_key) with the manager default skip_if_busy=False, so the clear was performed — it tore down a session whose reply was still streaming. The reported-success half was real but narrower: a member holding a key with no live session counted as cleared. Both are fixed here; the defect to audit is the destructive one.

Why it matters

A turn served by a session bound to the wrong directory writes its relative paths into the wrong project — silent, and not visible in the transcript. The clear-context case is worse than silent: the endpoint answered ok while the agent kept its full history.

Wire-contract changes a caller must know about

Called out explicitly because these are observable at the boundary rather than internal:

Change Wire shape What a caller must do
Clear-context skips busy members 409 {"error", "code": "turn_in_flight", "busy": [...]} when nothing cleared Treat 409 as retryable once the named roles finish; it is not a failure to clear
A partial clear is now marked 200 {"ok": false, "cleared": [...], "busy": [...]} Read ok, not the status: 200 with ok: false means some roles were kept
Agent and project switches can report an unavailable workspace 503 {"error", "code": "workspace_unavailable"} Retry; the request changed nothing, and the slot is left exactly as it was found
A project set during a slot rebind now succeeds 200 where api_chat_slot_project previously answered 409 Stop treating that 409 as "retry the set": the retry was always going to succeed, so the difference is one fewer round trip, not a different final state. An UNAUTHORIZED rebind still refuses.
A slot whose project was explicitly CLEARED no longer keeps its persisted resume SID No response change; the next turn cold-starts instead of resuming Nothing, unless a caller relied on a project-less slot resuming its old conversation. Scope note: the guard is slot.claim_cwd, which states nothing for a project that was never set, so this covers ONLY a project that was explicitly cleared
A slot whose project was explicitly CLEARED bypasses the warm pool No response change; the claim cold-starts through the factory instead of taking a warm child Nothing. Stated because the latency is intended, and it is paid only by a slot whose project was explicitly cleared: the per-session default is a directory no pooled child is in, so a warm hit would serve the stale binding this change refuses. The bypass is recorded as bypass_cwd in the claim's pool decision.
The queue hold now covers a deferred reset No response change; a queued prompt stays queued rather than draining behind the turn that deferred Nothing; the prompt remains visible and individually cancellable

What changed

Four distinct pieces. They are listed separately because they are separable, and the third and fourth are contract changes rather than internal fixes.

1. Claim-time cwd validation (session_allocation.py, _reacquire_and_validate) — the reuse decision now validates the bound directory at the moment of the claim rather than trusting the caller to state one.

2. A retirement-arm subsystem (new: mark_retire_on_next_claim, note_project_change, RetireArm.agent, spend_retire_arm, discard_all_retire_arms, CWD_CLEARED, plus a per-key generation counter — all 0 occurrences at base). This replaces the base's documented leave-armed-and-retry policy at the consume site, where the base comment argues the opposite ("leaving it armed is always safe"). Two producers exist and are not interchangeable; the distinction is enforced by source-text census tests.

3. A _queue_held drain-gate unification (state.py, chat_runner.py) — one predicate replaces per-cause booleans across four drain gates. Renames _last_turn_auth_required.

4. A channel API contract change — api_channel_clear_context moves from unconditional clear to skip-busy, adding a 409 turn_in_flight, and the total-refusal case returns before the shared message buffers are wiped or saved. The refusal surfaces as an in-page ErrorNotice above the composer; it carries no askAgent hand-off, deliberately, because navigating away would destroy an unsent draft in the composer directly beneath it.

The unconditional clear was also the only in-band recovery for a wedged member turn, so what bounds such a turn matters. It is bounded, and not by this diff: every ACP prompt resolves its wait from agent.chat_turn_timeout_secs — default 14400s (4h), clamped to 300s..86400s — applied in acp/session_handle.py via _effective_prompt_timeout_async and enforced by the transport wait on _turn_done. Channel members are dispatched by handlers_channel.py's _spawn_agent_task, a bare create_task that adds no ceiling of its own, so that prompt timeout is the whole bound. retry when idle therefore names an event that arrives. No force parameter is added: it could only make the refusal disappear by discarding the state of a turn that is still running.

  • Switching channels now also clears the page-level error notice, not just a stale clear-context refusal: a failure raised against channel A named channel A's roles and would otherwise read as live for whichever channel the composer now sends to.

Also in this commit, declared

Three changes ride along that the four pieces above do not imply. They are named here so a
reviewer does not meet them as unexplained scope.

  • A channel log lock (channel.py) — post and api_channel_clear_context now share one
    _log_lock, and the thread-parent resolution happens under it rather than before it. Derived
    from piece 4: making the clear skip busy members is what put awaits between the decision to
    wipe and the wipe. Without the lock a concurrent post is acknowledged and then wiped away by
    _save(), and a threaded reply can name a parent the wipe already removed.
  • An ErrorNotice warn severity axis — one consumer, ChannelPage. A withheld clear is
    not a failure, so it needed chrome that is not the danger variant.
  • Two capture scenes — website/capture/clear-context-busy-refusal.{html,tsx},
    website/scripts/capture-clear-context-busy-refusal.mjs, and the agent-switch pair
    website/capture/agent-switch-notice.{html,tsx} with
    website/scripts/capture-agent-switch-notice.mjs. Evidence harnesses, not shipped surface:
    nothing in the app imports them, and each frame is written only if its own assertions hold.
    The frames are NOT committed at this head, and the earlier claim that they were is withdrawn: git diff --diff-filter=A against the base returns ZERO image files. They were force-added past .gitignore:100-106, which states that PR review evidence "is uploaded as a GitHub attachment ... never committed", and they were removed for that reason. The embeds above therefore pin fork commit 4eed28cec1, which still resolves because that commit persists in the fork, NOT this head -- so they are viewable but are not tree evidence. Every frame regenerates on demand from the committed harnesses (website/scripts/capture-clear-context-busy-refusal.mjs, which carries the rowmarks and confirms scenes, and website/scripts/capture-agent-switch-notice.mjs). Re-attaching them as GitHub user-attachment assets needs the web uploader: this gh (2.96.0) has no --attach on pr create or pr edit and /pulls/7161/attachments 404s, so it is owed to a maintainer rather than automatable here.
    (extracted from App.tsx so the real toast is capturable) and
    website/src/utils/agentSwitchFeedback.ts, the chokepoint that maps turn_in_flight and
    workspace_unavailable to the copy that toast shows. Listed because the 503 wire row alone
    implies a status code, not a rendered surface.

Out of scope, stated explicitly

The arm settle is probe-then-act over a linked_session_key written outside slot._lock, so
a rebind landing after the last pass would leave the arm on the abandoned key. That is closed
at cause here rather than left as a residual. dashboard/chat_utils.py adds a synchronous
non-blocking guard: settling_key excludes the settle-and-arm region, bind_linked_session_key
is the single writer and PARKS a rebind arriving inside it, and key_rebind_deferred reports
one so the settle publishes nothing and retracts its source arm. Deliberately not slot._lock:
it is not reentrant and one transfer already runs inside it, and seven of the eight writers are
synchronous functions that cannot acquire an asyncio lock at all.

All eight assignment sites across five modules route through that single writer --
dashboard/handlers/cron.py:1602, dashboard/chat_persistence.py:1105/:1639/:1647,
dashboard/state.py:6609/:6631, dashboard/workflow_inject.py:158,
dashboard/cron_inject.py:398. A NINTH surface sets the key without ever naming the attribute:
get_or_create_slot(linked_session_key=...), which every channel and cron surfacing passes. It
needs no guard, because the factory returns an existing slot BEFORE reaching the bind, so it can
only bind a slot it just minted -- where no arm can yet be settling. That is worth stating
rather than assuming: the completeness census covering the other eight matches dotted
assignments and is structurally blind to a keyword, so
test_the_slot_factory_binds_its_keyword_only_when_it_mints_the_slot pins it at runtime and
fails if that bind is ever moved above the early return.

Tests

Each new assertion was mutation-verified: the unmutated test passes first, then the guard is removed and the test is confirmed to fail on its own assertion rather than on an error.

  • Total refusal must not destroy the shared channel log — reverting the 409 to run after the buffer wipe fails on "the shared message log must SURVIVE a total refusal ... got 0".

  • The refusal carries a machine-readable code, satisfying the repo's error-code contract ratchet.

  • clearContextBusyMessage (4 cases): names every refusing role, empty when nothing refused or the field is absent, and ignores a non-array value rather than rendering [object Object].
    Two pre-existing drain leaks, repaired deliberately. Unifying the four drain gates on _queue_held also closes two leaks that predate this change: the synthesis dispatch and the stage handoff never consulted the old _last_turn_auth_required flag, so both could drain a queue a gate had withheld. They are named here rather than left implicit because the unification is required by the core fix and reverting only these two sites would leave the new gate deliberately inconsistent across the four.

  • Arm/generation behaviour, the producer census, and the consume-site census. Every session-ending teardown is also enumerated from the module and must declare itself spend-side or keep-side, so a new teardown that classifies itself nowhere fails the guard rather than passing unnoticed.

Reachability of the remaining CI failures, classified rather than dismissed — none is called flaky:

  • Backend Lint & Type Check (3.12) read cancelled, not failed: the job hit its 15-minute cap while Check formatting (black, baselined) was still running, and that step passed. flake8 then ran 87s and emitted nothing, and mypy was skipped. The gate's workload is a fixed ("src", "test") scan of 3,394 files, independent of this diff — measured cold-cache locally at 30s at this head versus 29s at the previous one — and the job has been at 13m50s / 14m24s / 15m17s across three consecutive shas. Named for a maintainer rather than worked around, since the cap lives in .github/ which a fork PR may not touch.
  • src/test/AppSdkSharedModulesCov80.test.ts (2) and src/test/ContextBreakdownPanel.test.tsx (2) fail on an unmodified upstream/main checkout on this host — npx vitest run src/test/AppSdkSharedModulesCov80.test.ts src/test/ContextBreakdownPanel.test.tsx → Tests 4 failed | 16 passed with none of this diff present. They also passed in CI's shards 1 and 3 at this PR's own head, so the difference is host-side and upstream of this change.
  • test_dashboard_state_ws.py::TestSlotsBroadcastCarriesFolders and test_remote_crew_execution.py::...interrupted_row are now ATTRIBUTED rather than left open, and neither is failing. Both suites were run at the merge base 28dcab655dfaa50fa3167158097a5ce39ea29c8e on an unmodified detached checkout (verified unmodified: zero occurrences of this branch's markers) and again at head, with the SAME harness and a positive control per suite — an assertion armed inside the exact class or function named, which reported 1 failed each time, so a green run could have failed for the intended reason. Base: 89 and 191 passed. Head: 89 and 191 passed. Trees clean after disarming. Mechanism, not just pass/fail: both suites do reach dashboard/state.py, which this branch modifies, so they are not structurally isolated — but they exercise the slot's FOLDER projection (44 and 3 references to folders) and carry ZERO references to the three surfaces this branch changes in that class (claim_cwd, project_cleared, linked_session_key). At head all 12 backend check-runs pass except Backend Tests (Windows) (4), whose sole failure is an xdist wall-clock bound and whose log names neither test; and neither test appears on a FAILED line across the 14 most recent shas of this branch, under a search positive-controlled against two known failures it does find.

Pattern harvest

Rule candidate: a probe followed by a separate act cannot protect a resource whose state can change between the two — so the guard must be the decision itself, taken atomically with the mutation, or a flag the claimant must satisfy. The in-flight cold start is what proves it here: it holds no registry entry, so both probes read it as absent and no amount of probing closes the window.

Rule candidate: an endpoint that reports on work it also performs must answer a refusal BEFORE it mutates shared state. Ordered the other way, the report contradicts the effect — and when the mutation is persisted, the contradiction is irreversible.

Screenshots

Two error states appear below, and they lead differently on purpose: a partial clear leads Context partially cleared, a total refusal leads Not cleared in warn chrome, because a withheld clear is not a failure. Failed to clear context is reserved for a genuine error such as a 500. Leading a partial with the failure title contradicted its own body, which ends by naming what was cleared.

The clear-context controls surface a refusal that was previously swallowed, and no longer destroy a streaming reply to do it. A partial refusal answers 200 with the refusing roles in busy — a field no caller read, so a "cleared" click silently cleared nothing for those roles. A total refusal answers 409 turn_in_flight before any shared state is touched.

The banner states what was kept and what was cleared, in the page's own vocabulary. Naming only the kept roles let a partial refusal read as a total one, sending the user back through the confirm dialog to re-clear what had already cleared. It also renders in its OWN notice, without the agent hand-off: a clear-context refusal can sit above an unsent composer draft, and the hand-off unmounts the page and destroys it -- the same reason the composer's own failure notice omits it. The channel page's busy badge already says working, so the copy says "still working" rather than introducing "a turn is in flight" for the same state, and {{roles}} is never the subject of a verb — a comma-joined list of two roles has to read as well as one, which a singular verb cannot do in the translated catalogs. Both the 200 and the 409 render the same catalog string: the 409 is recognised by its code, not its prose, so the backend's English never lands in a localized page. The surface is an ErrorNotice, not a native dialog, and because the per-agent button lives in the agents side panel while the banner sits above the composer, the notice is scrolled into view when it appears.

Partial clear-all, two of three roles mid-turn:

Clear-all partial refusal, light
Clear-all partial refusal, dark

The per-agent control, its addressed role refusing:

Per-agent refusal, light
Per-agent refusal, dark

The 409 total refusal — same localized string, none of the backend's English:

Total 409 refusal, light
Total 409 refusal, dark

The generic failure path, which already rendered inline before this change and now carries no agent hand-off:

Generic failure inline, light
Generic failure inline, dark

Contrast — nothing refused, so the clear is acknowledged rather than silent:

Clean clear acknowledged, light
Clean clear acknowledged, dark

The agent-switch 503 workspace_unavailable notice, the other new surface:

Agent-switch workspace unavailable, light
Agent-switch workspace unavailable, dark
Agent-switch turn in flight, light

Each scene captures a light and a dark frame. Each frame is written only if its own assertions hold: the banner carries every refusing role, the kept claim, the cause and the retry; the 409 frame additionally asserts the backend's prose did not leak; and every scene asserts zero dialogs.

Reproduce:

npx vite --host 127.0.0.1 --port 6841 --strictPort
node scripts/capture-clear-context-busy-refusal.mjs http://127.0.0.1:6841 ../temp-screenshots/clear-context-busy-refusal

@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention labels Aug 31, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review.

When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically.

@rnoack1
rnoack1 marked this pull request as ready for review August 31, 2026 01:24
@rnoack1
rnoack1 requested review from a team and Zedmor August 31, 2026 01:24
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Aug 31, 2026
@rnoack1
rnoack1 force-pushed the fix/reset-skip-if-busy branch from b698e48 to cb8c9b5 Compare August 31, 2026 03:16
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Aug 31, 2026
@rnoack1
rnoack1 force-pushed the fix/reset-skip-if-busy branch from cb8c9b5 to 90be992 Compare August 31, 2026 04:01
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Aug 31, 2026
@rnoack1
rnoack1 force-pushed the fix/reset-skip-if-busy branch from 90be992 to 3e3ea0a Compare August 31, 2026 04:43
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Aug 31, 2026
@rnoack1
rnoack1 force-pushed the fix/reset-skip-if-busy branch from 3e3ea0a to 252b301 Compare August 31, 2026 05:30
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Aug 31, 2026
@github-actions

github-actions Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review (fork) — ✅ no blocking findings

Reviewed f8b4d6a0878e1a67d5be02591d5dedce16108274 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] f8b4d6a

@github-actions

github-actions Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5, fork) — 🟡 CONCERNS

Design-level review of f8b4d6a0878e1a67d5be02591d5dedce16108274 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

I have direct, grounded evidence across the backend, channel, handlers, tests, frontend, and i18n portions of this ~14k-line patch. My findings don't depend on the pending agents, so I'll finalize.

Design-Verdict: CONCERNS

Sound correctness goal (refuse stale-directory/stale-agent sessions at claim time), but it bundles two new subsystems and four separable contract changes into one ~14k-line PR, and it removes a recovery lever it only promises to replace.

Watch

Removing the only in-band recovery for a wedged channel member. api_channel_clear_context now refuses busy members (409 turn_in_flight); the description concedes the sole remaining remedies are dismissing the member (destroys it) or waiting out chat_turn_timeout_secs (default 14400s), and the member-level stop that would replace the lost lever is marked "OWED FOLLOW-UP," i.e. not built. A user with a stuck member is stranded for up to 4h with no lossless option.
Clears when: a member-level stop (end the turn, keep the member) ships in this PR, or a maintainer explicitly accepts the 4h/dismiss gap.

The retirement-arm subsystem compensates for a root cause left unfixed. The spec text states the arm store exists only because "a cold start holds no registry entry until its provider binds," names that as "the ONLY open root cause," and rejects the simpler claim-states-its-own-requirement alternative because of it — then defers the fix. The result is intricate machinery (arm map, monotonic generation, transfer/supersede/spend matrix, park-and-settle guard, multiple source-text census tests) that every future teardown/writer must satisfy. High long-term maintenance surface for a mechanism the author says a later registry change would largely delete.
Clears when: either the "record a cold start in the registry before its provider binds" follow-up lands first (shrinking this to the generation counter), or a maintainer accepts the arm store as the durable design knowing the census-test burden it imposes.

Scope/blast radius. This one PR carries claim-time cwd validation, the arm subsystem, a separate lifecycle-lease/turn-active marker subsystem, the _queue_held drain-gate unification, the clear-context contract change, the channel log lock, frontend ErrorNotice/AgentSwitchNotice/capture scenes, and multi-locale i18n — well past the repo's "one logical change per commit, at most two commits per PR." Reviewing correctness of the concurrency machinery and reverting any single piece cleanly is impractical at this size.
Clears when: the independent pieces (drain-gate unification, channel log lock, clear-context contract, arm subsystem) are split into separate PRs, or a maintainer accepts the combined review.

Suggestions

Land the drain-gate unification and the channel log-lock fix as their own small PRs first — both are self-contained and would shrink the concurrency-heavy core to a reviewable diff.

[DESIGN-REVIEWED] f8b4d6a

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Aug 31, 2026
@rnoack1
rnoack1 force-pushed the fix/reset-skip-if-busy branch from 02cee22 to c0bc80b Compare August 31, 2026 11:51
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Aug 31, 2026
@rnoack1
rnoack1 force-pushed the fix/reset-skip-if-busy branch from c0bc80b to 3f8f14e Compare August 31, 2026 13:03
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Aug 31, 2026
@bolichen97

Copy link
Copy Markdown
Contributor

Open PR relationship audit

This is a consolidated, point-in-time code-level audit note. It compares complete merge-base diffs and current/merged code; it does not treat a shared topic as duplication or partial coverage as completion.

Relationship findings

  • PR #4118 is OVERLAPPING relative to this PR. The goals differ or the implementations can complement each other; this is not a duplicate claim. Recommended action for PR #4118: KEEP. Independent goals in adjacent code; neither subsumes the other and no conflict is expected. Files: src/kiro_crew/dashboard/chat_runner.py.
  • PR #7709 is OVERLAPPING relative to this PR. The goals differ or the implementations can complement each other; this is not a duplicate claim. Recommended action for PR #7709: KEEP. Same expression, orthogonal conditions — coexist as two conjuncts; only a textual merge-order conflict. Files: src/kiro_crew/dashboard/chat_runner.py.

No PR, Issue, label, branch, or review state was changed by the relationship-note portion of this audit.

bolichen97
bolichen97 previously approved these changes Sep 4, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The core fix is right and minimal: _consume_pending_reset now passes skip_if_busy=True so the busy check and the teardown are one step under the session lock, matching the sibling discard_conversation call in the same function, and the ambiguous reset return (session is not None) is correctly disambiguated with a has_session presence probe rather than has_active_turn — presence is the right signal since a turn holding the semaphore with no prompt in flight is invisible to the latter. mark_retire_on_next_claim keying on the string rather than the session object is the load-bearing detail: a cold start holds no registry entry, so an object pin would miss exactly the provider already en route to the pre-change directory. The stale-cwd check is placed correctly in _reacquire_and_validate (semaphore held, so eviction cannot land under a streaming reply) instead of the pre-semaphore reuse decision, it normalizes both sides through Path so /p/a vs \\p\\a doesn't evict every warm session on Windows, and it guards on both sides being non-empty so a provider reporting no binding fails open rather than churning. The cwd_moved teardown ordering (pop under the permit, release in finally) is deliberate and argued, and the idempotence note makes the interrupted case safe. Collapsing _last_turn_auth_required into _queue_held is justified by the measurement that no site distinguished the two, and it fixes the real pre-existing leak where a signed-out CLI held the tail drain but not _run_pending_synthesis, which drains the queue too. Grepped the head: no stale _last_turn_auth_required references remain in chat_runner/chat_orchestrator/state.

@github-actions

github-actions Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5, fork) — 🟡 CONCERNS

UX-level review of f8b4d6a0878e1a67d5be02591d5dedce16108274 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

I have enough to reconcile. Key facts: this is the fork lane (no blind read), and the PR's "screenshots" are raw.githubusercontent.com links to a fork commit (4eed28cec1) that the PR body itself admits were removed from the tree and never re-attached as GitHub user-attachments — so the attachment/recording lists are empty and nothing was downloaded for me. No committed images exist. Every new user-visible surface is therefore an evidence gap.

The copy itself is sound: refusal strings state cause + remedy ("Context kept for {{roles}} — still working. Try again when they finish."), the workspace-unavailable notice asserts + offers an action, warn-vs-danger severity is correctly separated, and the destructive confirm button restates the act ("Clear context and delete messages"). No hedged-state notice, no BLOCK-class hard swap (the new row marks are async acknowledgments, lens 4, not a transform of a persistent element).

UX-Verdict: CONCERNS

Usable and well-copied, but no first-time reader has seen any of it — the PR's screenshots point at a deleted fork commit, not attachments, so nothing rendered was verifiable here.

Evidence gaps

  • Clear-all confirmation Modal (title "Clear all context", body paragraph, danger button "Clear context and delete messages") — shown in no reachable screenshot; re-attach 01-clear-all-* as a GitHub user-attachment.
  • Partial/total clear-context refusal banner (ErrorNotice warn variant: "Context partially cleared" / "Context not cleared" + role list) — not reachable; re-attach 01-clear-all-two-roles-busy-* and 04-total-refusal-409-*.
  • Per-agent in-row marks — warn CircleAlert ("Context kept — still working") and ok Check ("Context cleared.") beside the clear button — not reachable; re-attach 02-per-agent-role-busy-*.
  • Clean-clear acknowledgment line ("Context cleared." / "…The channel's messages were deleted too.") — not reachable; re-attach 03-clean-acknowledged-*.
  • AgentSwitchNotice floating toast (workspace-unavailable with agent hand-off; turn-in-flight without) — not reachable; re-attach agent-switch-workspace-unavailable/*.
  • No blind read ran (fork lane), so comprehension of every control above is unverified. A maintainer pushing the branch to this repo would close both this and the coverage gaps.

Suggestions

  • Per-agent Clear-context still uses a native confirm() (OK/Cancel) while the all-scope path was upgraded to the restating Modal; consider the same styled confirm so the irreversible per-agent clear is confirmed by a button that names it, not "OK" (ChannelPage.tsx onClearContext).

[UX-REVIEWED] f8b4d6a

… clears

A claim could reuse a session bound to a superseded project or agent, so a turn's relative writes landed in the directory the user had just moved away from. The refusal is now raised at claim time and a refused clear is reported instead of silently reading as done.

Re-roll: unreachable timing assertion on a loaded CI runner
@chenmingwei23

Copy link
Copy Markdown
Contributor

🤖 Kiro Crew [operator: chenmingwei23]: This PR has been inactive for 7+ days. I reviewed the blockers but they require your input:

  • The PR is ~12,600 lines across 89 files touching the core ACP/session/dashboard subsystem — too much surface for automated drive-to-green to reason about safely without changing your design intent.
  • A prior review was dismissed. Please confirm whether that feedback is resolved, and rebase onto main to clear the current merge conflict.

When you've addressed these, the pipeline will re-assess on its next cycle.

@iamwhatever

Copy link
Copy Markdown
Contributor

Thanks for this, @rnoack1, and for the honest rewrite of the description — that made the review much easier.

Closing as superseded. The one-line guard this PR set out to add has already landed on main independently: reset(pending_key, skip_if_busy=True) is at src/kiro_crew/dashboard/chat_runner.py:5681, and effective_session_key(slot) is resolved at the switch handlers in src/kiro_crew/dashboard/chat_handlers.py (e.g. lines 371, 669, 720). Your own rewritten body reaches the same conclusion — quoting it: "The one-line guard the old title named has landed upstream independently, so the red-then-green verification the old text described could not occur against this base."

What remains is ~12.6k lines across 89 files touching core ACP/session/channel code, with no single coherent fix left to land against current main. Rather than carry that as one large PR, it would be much easier to review as a focused change.

You're very welcome to reopen this, or to open a smaller PR scoped to one of the specific windows you describe (the claim-time cwd validation, or the clear-context busy refusal) if you'd like to pursue those individually. Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge needs-author-decision PR blocked on author input

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants