Skip to content

feat(agents): bundle native monitoring tools - #234

Draft
johnmatthewtennant wants to merge 2 commits into
mainfrom
jtennant/native-berd-monitor
Draft

feat(agents): bundle native monitoring tools#234
johnmatthewtennant wants to merge 2 commits into
mainfrom
jtennant/native-berd-monitor

Conversation

@johnmatthewtennant

@johnmatthewtennant johnmatthewtennant commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Bundle long-lived monitoring and cross-session orchestration directly with Berd:

  • add a native berd-monitor sidecar that detaches producers, buffers line-oriented output across Berd downtime, wakes the owning session through berdctl, and stops complete process trees on macOS, Linux, and Windows;
  • bundle berd-monitor and berd-orchestrator skills so agents can discover and use those workflows without private configuration;
  • add optional free-form berdctl session send --from attribution, rendered and replayed as a concise sender label, with berd-monitor using --from berd-monitor.

Monitor state is private, session-scoped, and exclusively owned. Failed launches surface synchronously, oversized output is safely chunked, final delivery retries until success or explicit stop, and stopped runs do not leak pending output into later runs.

Related issue

none found

Testing

  • NODE_OPTIONS=--no-experimental-webstorage just ci (7,100 frontend tests passed, 1 skipped; Rust checks, clippy, release-script tests, and production build passed)
  • cargo test -p berd-monitor --manifest-path src-tauri/Cargo.toml (8 passed)
  • cargo check -p berd-monitor --manifest-path src-tauri/Cargo.toml --target x86_64-pc-windows-msvc
  • scripts/prepare-berdctl-sidecar.sh (staged both release sidecars)
  • direct detached lifecycle smoke test: verified a nonexistent producer fails synchronously, a duplicate state key is rejected, and stopping a shell producer also terminates its child process
  • focused berdctl/message replay tests (246 passed)

Reviewer-reproducible examples

Build the monitor, then verify launch errors are reported rather than silently detached:

cargo build -p berd-monitor --manifest-path src-tauri/Cargo.toml
BERD_MONITOR_STATE_DIR="$(mktemp -d)" \
  src-tauri/target/debug/berd-monitor run \
  --state-key missing --label missing --session-id test-session -- \
  command-that-does-not-exist-berd-monitor

The command exits nonzero and prints the producer launch error.

The lifecycle regressions are also executable directly:

cargo test -p berd-monitor --manifest-path src-tauri/Cargo.toml \
  stop_terminates_the_producer_process_group_and_discards_pending
cargo test -p berd-monitor --manifest-path src-tauri/Cargo.toml \
  simultaneous_owner_claims_have_one_winner

The transcript attribution is text-only and has no layout change; queued send, bubble rendering, and replay persistence are covered by the focused frontend tests above.

Signed-off-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
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