Repository navigation
Fix agent_picker_pending surviving realm changes - #32
Conversation
ElSargo
left a comment
There was a problem hiding this comment.
Brood QA review
Checked: diff/view; CI run 35150445688 was IN_PROGRESS at review start; friction agent-picker section + Fixes #28; audit alignment.
Code: Correct remittance. agent_picker_pending: Option<(backend_id, session_id)>; clear_agent_registry_for_realm_change on Snapshot, layout-state focus change, activate/create completion, and worktree realm change; fulfill_pending_agent_picker only opens UI when pending realm == current. Defense-in-depth test for mismatched pending without prior clear. Author: 46 lib tests locally.
CI: Was in progress; sibling PRs fail on runner ENOSPC — re-run after disk relief before merge.
Race-doc: Agent-picker realm friction remitted accurately.
Desktop verify: Blocked (no nix/client build). Manual A→B session switch before registry reply still recommended.
Residual / merge: Stacks with #21/#29 on session-switcher + friction doc. Residual: discovery picker correlation hole (backend-discovery constant) remains open elsewhere.
— Brood QA
ElSargo
left a comment
There was a problem hiding this comment.
Brood QA review
Checked: gh pr view/diff/checks 32; issue #28 + docs/frictions/ui-concurrency.md; all agent_picker_pending / realm-mutation sites in plugins/session-switcher; local RUSTFLAGS='-C linker=cc' cargo test --manifest-path plugins/session-switcher/Cargo.toml --lib → 46 passed.
Code: Correct remittance of “Agent-picker intent changes realm while it waits”. Pending is now Option<(backend_id, session_id)>; Snapshot, layout-state focus, activate/create CommandCompleted, and worktree completion clear via clear_agent_registry_for_realm_change; fulfill_pending_agent_picker no-ops (and clears) on realm mismatch. Matches #28 expected behavior, including the activate/create gap called out in the issue.
Tests: agent_picker_pending_must_not_fulfill_after_realm_change + agent_picker_pending_ignores_mismatched_realm_without_prior_clear cover clear+fulfill and defense-in-depth. (Nit: helpers rather than full reducers — acceptable.)
CI: Run 35150445688 failed with runner ENOSPC (same infra class as sibling PRs). Not a code fail; treat green CI / re-run after disk relief as merge gate.
Desktop verify: Not needed — reducer race is unit-covered; manual session-switch while waiting remains optional polish.
Residual / merge: Stacks with #21/#29 on session-switcher + shared friction doc — coordinate merge order. No logic objection.
— Brood QA
Scope the coding-agent shortcut pending intent to (backend_id, session_id), clear it on Snapshot/layout-state/activate-create/worktree realm changes, and ignore mismatched registry fulfillment. Remits the ui-concurrency friction. Fixes #28
76edc0e to
55adc92
Compare
Summary
agent_picker_pending: boolwithOption<(backend_id, session_id)>.clear_agent_registry_for_realm_changeon Snapshot, layout-state focus change, activate/createCommandCompleted, and worktree completion realm changes.fulfill_pending_agent_picker).docs/frictions/ui-concurrency.md.Fixes #28
Test plan
cd plugins/session-switcher && RUSTFLAGS='-C linker=cc' cargo test --lib— 46 passed (includes 2 new realm-change / mismatched-pending regressions)