fix: bound POSIX installer lock waits - #414
jamilahmadzai wants to merge 3 commits into
Conversation
Prevent a wedged concurrent installer from blocking every later launcher indefinitely. Keep the generated POSIX copies in sync and add kernel-lock regression coverage.\n\nFixes monk-io#413
|
Independent fork CI is green on the current head |
|
Refreshed this PR against current main, preserving the newly added CI cases alongside the lock-deadline regression. All five local POSIX regression scripts pass, and the three shipped installer copies match. The current-head fork Install E2E run passes on Ubuntu, macOS, and Windows: https://github.com/jamilahmadzai/monk-plugin/actions/runs/34205983157. Ready for review; upstream fork-workflow approval may still be required. |
Summary
Fixes #413.
A live but wedged POSIX installer currently leaves every later bootstrap blocked in bare
flock 3forever. Sinceensure-monk-agent.shruns from the plugin startup path, this can make all subsequent coding-agent sessions on the host appear hung.This change:
flock -w;MONK_AGENT_INSTALL_LOCK_TIMEOUTas a validated non-negative integer, allowing deterministic tests and operator tuning;Verification
The new regression first failed on unmodified v0.1.58: its five-second watchdog had to terminate
scripts/ensure-monk-agent.sh. After the patch, all three copies exit on the configured one-second deadline and emit the expected diagnostic. A deterministic release-before-deadline case also proves the installer acquires the released lock and returns the managed binary without using the network.Locally passed:
Additional checks:
sh -non all changed shell scriptsgit diff --checkensure-monk-agent.shcopiesBounty/product-use context
I installed official plugin v0.1.58 through the Monk Codex marketplace, started
monk-agent, authenticated the MCP server with the same GitHub-linked Monk account, initialized this repository as a workspace, and successfully calledmonk.project.analyze. The linked report is therefore based on a live installed product run, with a deterministic concurrency reproduction—not code reading alone.