Skip to content

chore: update README and CLI to enhance AgentMesh watcher functionali… - #8

Merged
ar4ntic merged 4 commits into
mainfrom
dev
May 28, 2026
Merged

ar4ntic merged 4 commits into
mainfrom
dev

Conversation

@ar4ntic

@ar4ntic ar4ntic commented May 28, 2026

Copy link
Copy Markdown
Contributor

…ty and trust approval process


Note

Medium Risk
Changes default init/start side effects (background process lifecycle) and watcher startup timing; failures could block or confuse setup until timeout or env opt-out.

Overview
Init and agentmesh start now start a persistent background watcher after hook installation (unless hooks are skipped or AGENTMESH_DISABLE_WATCHER_AUTOSTART is set), with dry-run/plan output and init dry-run reflecting Start watcher.

The watcher waits up to 10s for a background child to reach running, puts Unix spawns in a new process group, and lets a foreground child take over when the state file is background-spawned with the same PID.

Docs and CLI copy clarify that start enables immediate sync on direct edits to AGENTS.md, CLAUDE.md, and .ai/, and expand Codex one-time hook trust steps plus fallback sync paths (watcher, Claude hooks, manual agentmesh sync).

Tests disable watcher autostart on Windows, stop watchers after noisy flows, and assert start leaves the watcher running on Unix.

Reviewed by Cursor Bugbot for commit bc21b37. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread crates/agentmesh/src/main.rs

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 90e2bcb. Configure here.

}
std::thread::sleep(Duration::from_millis(50));
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No early exit when spawned watcher process dies

Medium Severity

wait_for_background_start only checks process_running(pid) as part of the success condition (alongside STATE_RUNNING). If the spawned child process crashes before writing STATE_RUNNING, the process is dead but the function never detects this — it loops for the full 10-second BACKGROUND_START_TIMEOUT before returning an error. Since this is called during init and start, a watcher that crashes on launch causes those commands to hang for 10 seconds with no feedback.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 90e2bcb. Configure here.

@ar4ntic
ar4ntic merged commit b623026 into main May 28, 2026
7 checks passed
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