Notify merge-queue when workers complete PRs#18
Conversation
Previously, when a worker completed (via `multiclaude agent complete`), only the supervisor was notified. The merge-queue had to rely on periodic 2-minute polling to discover new PRs. This fix ensures the merge-queue receives an immediate notification when workers complete, enabling faster PR processing. Changes: - daemon.go: handleCompleteAgent now sends completion messages to both supervisor and merge-queue - worker.md: Updated to reflect that merge-queue is also notified - merge-queue.md: Added new section about receiving completion notifications Fixes #16 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
whitmo
left a comment
There was a problem hiding this comment.
Review: PR #18 — pr-triage
Scope Discrepancy (Critical)
Claimed: "Merges 5 clean PRs from upstream (#342, #334, #336, #340, #335)" with "659 lines of new tests"
Actual: 99 commits, 91 files changed, 17,183 insertions, 5,535 deletions across the entire upstream history since the fork diverged.
Only 7 of the 99 commits (5 merge commits + the original 5 source commits + 1 test commit) relate to the claimed PRs. The other 92 commits include:
- Full CLI restructuring (noun-group refactors for
repo,worker,agent,message) - Fork-aware workflow implementation (#267, #274, #275, #276)
- Agent definitions infrastructure (#236, #237, #238, #239, #240)
- Configurable agents feature (#247)
- Task management support (#313)
- CI pipeline changes (golangci-lint, gofmt checks)
- Repo lifecycle / hibernate / status commands (#315, #316, #317)
- Dozens of test/refactoring commits
Verdict: The PR description is severely misleading. It represents a full upstream sync disguised as a focused 5-PR triage.
Test Results
- Passes:
go build ./cmd/multiclaude✅ - Passes: 24/25 test packages ✅
- Fails:
pkg/tmux— 2 flaky timing-dependent tests (TestSendKeys,TestSendKeysLiteralWithEnter)- These appear to be pre-existing flaky tests, not introduced by this PR
Code Quality (Gemini + Claude Review)
Positives:
periodicLoophelper — good DRY refactoring for daemon loopsstartAgentWithConfig— consolidates agent startup, reduces duplicationsocket.SuccessResponse/socket.ErrorResponse— cleaner response handlingappendToSliceMap— eliminates repeated nil-check boilerplate- Error message updates correctly reference new CLI noun groups (
multiclaude repo initvsmulticlaude init) - New structured error constructors (
RepoNotFound,RepoAlreadyExists,WorkspaceAlreadyExists, etc.)
Concerns:
- Fragile agent type derivation —
handleSpawnAgentinfersAgentTypeReviewfromstrings.Contains(agentName, "review"). Naming convention as type system is brittle. - Removed crash notification — The diff removes
notifySupervisorOfCrashfor workers/review agents. Transient agents are now fire-and-forget without supervisor notification. Impact unclear. - Removed selective wake —
agentHasWorklogic removed; all agents get woken uniformly. Could waste resources. - Removed branch/config cleanup —
DeleteBranchandRemoveAll(agentConfigDir)were removed from agent cleanup. Risk of orphaned branches and config directories accumulating. - PID=0 in test mode —
MULTICLAUDE_TEST_MODE=1skips Claude startup, leaving PID at 0. Code paths checkingisProcessAlive(agent.PID)may behave unexpectedly.
Security
No obvious security issues. No credential handling changes, no user input injection vectors observed in the key files.
Recommendation
Request Changes — This PR should not be merged as-is:
- Split the PR — The upstream sync and the 5 targeted PRs should be separate operations. Either:
- Rebase onto upstream main first (separate PR), then cherry-pick the 5 PRs
- Or clearly label this as "full upstream sync" in the description
- Fix the description — Currently misleading about scope
- Address the 5 code concerns above (especially the removed crash notification and cleanup logic)
The underlying code changes are mostly good quality refactoring, but the review surface is unreasonably large for what's described as a 5-PR merge.
Review by swift-badger (Claude) + Gemini second opinion
🤖 Generated with Claude Code
Review: PR #18 — pr-triageScope Discrepancy (Critical)Claimed: Merges 5 clean PRs from upstream (#342, #334, #336, #340, #335) with 659 lines of new tests Actual: 99 commits, 91 files changed, 17,183 insertions, 5,535 deletions across the entire upstream history since the fork diverged. Only 7 of the 99 commits relate to the claimed PRs. The other 92 include full CLI restructuring, fork-aware workflow, agent definitions infrastructure, task management, CI pipeline changes, and dozens of test/refactoring commits. Verdict: PR description is severely misleading. This is a full upstream sync disguised as a focused 5-PR triage. Test Results
Code Quality (Gemini + Claude Review)Positives:
Concerns:
Recommendation: Request Changes
The code changes are mostly good quality refactoring, but review surface is unreasonably large for what is described as a 5-PR merge. Review by swift-badger (Claude) + Gemini second opinion |
Review found PR description severely misleading: claims 5 upstream PRs but contains 99 commits (full upstream sync). Code quality is mostly good but has 5 specific concerns around removed cleanup logic, fragile type inference, and removed crash notifications. Posted review comment: dlorenc#18 (comment) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
multiclaude agent complete, the daemon now notifies both supervisor AND merge-queueInvestigation Findings
The root cause was in
internal/daemon/daemon.go:handleCompleteAgent:Changes
handleCompleteAgentto send completion notifications to both supervisor and merge-queueTest plan
go test ./...)multiclaude agent complete, verify merge-queue receives notification🤖 Generated with Claude Code