GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||
GeezerVison is showing github.com — feat: add durable heartbeat monitoring and timeline UI by MacroModel · Pull Request #47166 · anomalyco/opencode Conversation
|
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
haha |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
A monitor tool (plus monitor_list/monitor_stop) lets the model watch a long-running background command's output for a pattern, or until it exits, and get notified back into the session as new messages -- a standing watch, not just a one-shot check. Analogous to Claude Code's own Monitor tool. Gated behind OPENCODE_EXPERIMENTAL_MONITOR, matching the existing experimentalBackgroundSubagents convention. Ported from upstream anomalyco/opencode PR anomalyco#33806 "feat: add Monitor tool" (1,398 lines, closed by the automated PR-cleanup bot, never reviewed) -- built directly on this fork's existing BackgroundJob primitive rather than modifying it. Reused nearly word-for-word: the re-arm/replace parameter shape, session-scoped list/stop logic, the untrusted-output fence with an unpredictable id so watched output can't forge its own closing tag, control-character stripping, the never-grant-"always"-for-a-glob-command permission rule, the detached-process-plus-parent-death-watchdog design, the flood guard, and most of the tool description and test scenarios. Rewritten rather than ported: avoided anomalyco#33806's own change to core BackgroundJob (a WakeScope to dodge a self-re-arm deadlock) by forking notifications into the tool's own scope instead, the same pattern task.ts already uses; its hand-written reader/debounce became an Effect Stream pipeline; its base64 command-wrapper isn't needed since this repo's bash tool already runs commands through plain ChildProcess.make; permission goes through the existing bash permission rather than a new one, so existing bash rules govern monitors too. Also considered anomalyco#44191 (cron scheduler, closed by the same bot the same week, praised by a human reviewer first) and the anomalyco#47166/anomalyco#47193/anomalyco#47284 durable-heartbeat resubmits (each closed within hours by a different, 2-hour PR-template-compliance bot, never reviewed) -- neither ported; see known gaps. Found and fixed a real, generalizable bug along the way: a command that writes output continuously with no pause (e.g. `yes`) hung teardown and starved timers, because the stdout read pipeline never yielded control back to the scheduler while data kept arriving. Fixed with a single Stream.tap(() => Effect.yieldNow), documented inline -- the same issue could affect other handle.stdout readers facing a non-pausing producer. Known gaps (deliberately scoped): not durable, in-memory only; no scheduler (only a shell poll-loop inside the watched command); opencode run's non-interactive mode exits once idle, killing active monitors; no UI (model-only via monitor_list); stdout only, 4000-char line cap, 5000-line flood guard; parent-death watchdog is POSIX-only; no external/webhook delivery. New packages/opencode/src/tool/monitor.ts (~360 lines) + monitor.txt. New packages/opencode/test/tool/monitor.test.ts (13 tests: self-cancel re-arm without deadlock, concurrency, list/stop, byte-flood guard, multi-line commands) -- passes 3 runs in a row. Verified against this fork's current dev (not just the agent's own stale worktree base): bun typecheck clean; full packages/opencode suite 3600 pass, only the 4 pre-existing, confirmed-unrelated cf-ai-gateway failures. Co-Authored-By: Claude Sonnet 5 <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.