Gateway process builds no worktree manager, so review_pr is never advertised #1162
Notifications
Due Date
No due date set.
Blocks
Reference: sam/archie#1162
Reference in new issue
Block a user
boot.prReviewer returns nil when b.trees is nil, by design (a review tool that can never run must not be advertised). RunGateway/startGatewayRuntime never calls buildTreesAndIdentities, so b.trees is nil in the Gateway process and setupGatewayChat wires ChatPRReviewer: nil.
Pre-existing since the Gateway extraction for web chat. 8cda.6.4 widened it: Telegram used to get a real reviewer through the daemon's setupTelegramGateway (the daemon does call buildTreesAndIdentities), and now reaches chat through the Gateway, so /review_pr is unavailable on every channel.
TestRunBuildsWorktreeManagerBeforeGateways pinned the daemon-side ordering and was deleted in 8cda.6.4 because the daemon no longer builds a router. Whatever fixes this should pin the equivalent ordering in startGatewayRuntime.
Close reason
Landed on main (c3284de1 cherry-picked as
ca433865, gate-clean in 2m03s, patch-id 24314e4f identical). Option A, decided by the maintainer: the Gateway composes its own worktree manager in startGatewayRuntime before setupGatewayChat, through a manager-only helper shared with the daemon buildTreesAndIdentities so the two cannot drift. The deliberate nil-guard stays and TestPrReviewerNilWithoutTrees remains green. Verified behaviourally, not only by composition order: the Gateway trees carry the configured WorkDir/BaseURL/token, prReviewer() is non-nil, and gateway.ReviewTools contains review_pr. Daemon composition provably unchanged (main.go diff empty). The PRD claims that the daemon supplies the reviewer were corrected in the same lane.Imported from beads
archie-core-8cda.6.7· GitHub #908 · type bug · priority P1 · created 2026-09-19 · closed 2026-09-21