Skip to content

docs: Gemini review of upstream PRs #334 and #336#345

Closed
whitmo wants to merge 19 commits intodlorenc:mainfrom
whitmo:work/cool-wolf
Closed

docs: Gemini review of upstream PRs #334 and #336#345
whitmo wants to merge 19 commits intodlorenc:mainfrom
whitmo:work/cool-wolf

Conversation

@whitmo
Copy link
Copy Markdown

@whitmo whitmo commented Mar 1, 2026

Summary

Key Findings

PR #334 — Session ID Fix

  • Correctness confirmed: new UUID on no-history, reuse on history
  • Error handling appropriate: UpdateAgent failure is non-fatal
  • Risk: Low

PR #336 — Process Detection

  • signal(0) usage correct on Unix
  • GetPanePID confirmed to exist in pkg/tmux/client.go
  • Actionable: EPERM from signal(0) means process running as different user — current code treats as "not running" and could start a duplicate. Suggest handling EPERM as "already running".
  • Risk: Low-Medium

Test plan

  • Review file is accurate and complete
  • No code changes — documentation only

🤖 Generated with Claude Code

whitmo and others added 19 commits January 22, 2026 13:40
Wrap all prose lines in README.md to a maximum of 80 characters for
better readability in code editors and terminal windows. ASCII art
diagrams and markdown tables are preserved in their original format
for visual consistency.

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Wrap all prose paragraphs in README.md to 80 characters maximum while
preserving:
- Code blocks (both fenced and indented)
- Markdown tables
- ASCII art diagrams
- Command examples

This improves readability in terminal viewers and text editors with
80-column displays.

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Fixes branch and config directory leaks in worker cleanup. Adds test coverage.
Adds actionable suggestions to error messages and creates new structured error constructors for common patterns.
Fixes /refresh slash command to detect and use upstream remote in fork workflows.
Adds PR URL and number tracking to task history when workers complete. P1 roadmap item.
When createWorker fails partway through (e.g., daemon communication
error, tmux failure, Claude startup failure), orphaned worktrees,
tmux windows, and prompt files were left behind. Add deferred cleanup
that tracks created resources and removes them if the function returns
an error after the worktree has been created.

Addresses PR #9 audit finding.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Five commands had custom repo detection logic that didn't check git
remotes, so running them from a tracked repo's directory without
--repo would fail. Now all commands use the unified resolveRepo()
which checks: --repo flag, git remote URL, multiclaude CWD, then
default repo.

Also enhanced findRepoFromGitRemote() to check both origin and
upstream remotes, supporting fork workflows where origin points to
the user's fork.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Tests pass locally (fork - no GitHub CI). Docs-only change.
The P1 "Task history" feature is fully implemented:
- TaskHistoryEntry struct with Name, Task, Branch, PRURL, Status, Summary
- TaskStatus enum (open, merged, closed, no-pr, failed)
- State methods: AddTaskHistory, GetTaskHistory, UpdateTaskHistoryStatus
- Daemon records history when workers complete
- CLI command: multiclaude history with --status, --search, -n, --full
- Live PR status from GitHub via gh pr list

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Implements the P1 roadmap item "Agent restart: Gracefully restart
crashed agents without losing context".

Changes:
- Add CrashedAt field to Agent state to track when crash was detected
- Add UpdateAgentCrashed and ClearAgentCrashed state methods
- Modify checkAgentHealth to detect crashed workers (dead PID + window exists)
- Check for uncommitted work in crashed worker's worktree
- Send notification to supervisor when workers crash
- Add "crashed" status to handleListAgents response
- Add StatusCrashed to format package for CLI display
- Update listWorkers CLI to show crashed status with distinct styling
- Clear crashed state when agent is successfully restarted

The existing `multiclaude agent restart` command already preserves
context via Claude's --resume flag and the preserved worktree.

Addresses Gap 2 from PR #9 (Worker Lifecycle Audit).

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Add a new `multiclaude stats` command that displays agent activity
statistics for a repository:

- Summary: total tasks completed, active agents count
- PR Status: breakdown by merged/open/closed/failed/no-pr with percentages
- Time Statistics: average task duration, total time spent
- Success Metrics: PR creation rate, PR merge rate

This implements the P2 roadmap item "Agent metrics: Simple stats on
agent activity (tasks completed, PRs created)".

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Add three documentation files to improve onboarding (P2 roadmap item):

- docs/QUICKSTART.md: 5-minute getting started guide covering install,
  daemon, init, workers, and common issues
- docs/FAQ.md: Answers to common questions about agents, workflow,
  troubleshooting, configuration, and philosophy
- PRESS_RELEASE.md: Project announcement covering the Brownian Ratchet
  philosophy, key features, and comparison with Gastown

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Add comprehensive visual diagrams covering:
- System overview and component relationships
- The Brownian Ratchet philosophy
- Agent types and relationships
- Worker lifecycle (spawn → complete → cleanup)
- Message routing and status flow
- Repository initialization sequence
- Health check loop logic
- Daemon goroutine structure
- File system layout
- Shutdown sequence
- State thread safety model

These diagrams complement the existing ASCII diagrams in ARCHITECTURE.md
and render properly in GitHub's Markdown viewer.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Adds new error constructors to internal/errors/:
- InvalidFlagValue: for invalid CLI flag values with allowed options
- InvalidSelection/SelectionOutOfRange: for interactive selection errors
- NoItemsAvailable: when selection list is empty
- WorkspaceAlreadyExists: for duplicate workspace names
- InvalidRepoName: for empty/invalid repository names
- FailedToReadInput: for terminal input failures

Converts raw fmt.Errorf calls to use structured errors:
- selector.go: All user-facing errors now have suggestions
- cli.go: Invalid flag values use InvalidFlagValue constructor
- cli.go: Daemon communication errors use DaemonCommunicationFailed
- cli.go: Workspace/repo validation uses appropriate constructors

Every error now tells the user what went wrong and how to fix it.

Addresses ROADMAP.md P0 item: "Clear error messages"

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Add on-demand worktree sync capability to complement the daemon's
automatic 5-minute refresh loop. This enables event-driven sync
when PRs are merged.

Changes:
- Add `refresh_worktrees` socket handler in daemon
- Add `multiclaude refresh` CLI command with local fallback
- Update merge-queue prompt to call refresh after merges

This addresses P0 roadmap item: "Keep agent worktrees in sync
with main as PRs merge"

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Instead of blindly waking all agents every 2 minutes, only wake agents
that actually have work to do. This reduces unnecessary context churn
and token usage for idle agents.

Wake conditions by agent type:
- Supervisor: woken when active workers exist to monitor
- Merge-queue: woken when there are open PRs (active or in history)
- Workers: only woken for pending messages (they drive their own work)
- Review: only woken for pending messages

Adds HasPending() to messages.Manager for efficient pending message
detection, and agentHasWork() to daemon for per-agent work checking.

Addresses P2 roadmap item: "Selective wakeup: Only wake agents when
there's work to do"

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Review findings for session ID fix (PR dlorenc#334) and error messages +
process detection (PR dlorenc#336) from dlorenc/multiclaude.

Both LGTM. One actionable finding: PR dlorenc#336 should handle EPERM
from signal(0) to avoid starting duplicate instances.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@whitmo whitmo closed this Mar 1, 2026
@whitmo whitmo deleted the work/cool-wolf branch March 1, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant