Skip to content

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

Open
johnmatthewtennant wants to merge 22 commits into
mainfrom
jtennant/native-berd-monitor
Open

feat(agents): bundle native monitoring tools#234
johnmatthewtennant wants to merge 22 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, durably buffers line-oriented output, 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 these workflows without private configuration.
  • Add optional --from attribution to berdctl session create and session send, while retaining trusted Berd provenance. Monitor deliveries use --from berd-monitor.
  • Add optional --delivery-id to session send. Repeated IDs for one session are accepted without creating duplicate user turns, so a monitor can safely retry after a crash between delivery and local acknowledgement.

Monitor state is private, session-scoped, and exclusively owned. Failed or timed-out launches terminate and reap their detached child. Producer trees are cleaned up on every exit path. Delivery subprocesses have a monitor-owned deadline. Unterminated and oversized output is bounded and safely chunked, and final delivery retries until success or explicit stop.

Related issue

none found

Testing

  • cargo test -p berdctl: 52 passed, 1 ignored
  • cargo test -p berd-monitor: 22 passed
  • cargo check -p berd-monitor --target x86_64-pc-windows-msvc
  • Live smoke tests verified custom create/send attribution, detached monitor wake-up, duplicate-owner rejection, synchronous launch failure, and process-tree termination.

Signed-off-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
@johnmatthewtennant
johnmatthewtennant marked this pull request as ready for review August 28, 2026 17:00
@johnmatthewtennant
johnmatthewtennant requested a review from a team August 28, 2026 17:00

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Automated code review

REQUEST_CHANGES: the exact three-dot comparison introduces two blocking issues and two non-blocking reliability issues. Static review covered every changed flow and file, including monitor launch/stop/delivery and persistence, cross-session create/send/steer/queue/replay behavior, sender-label rendering, packaging on Unix and Windows, accessibility, localization, navigation/consent boundaries, async/error/never-completes/lifecycle/race behavior, test honesty, and project/design-system rules. Findings were consolidated by underlying issue and anchored only to current changed lines. Supplied GitHub evidence was inspected: DCO, frontend checks/unit tests, Rust checks on Windows/macOS/Linux, and clean-room install passed; Transcript virtualization and Frontend build smoke were still in progress at capture time. Required checks independently govern merge readiness.

Deterministic publication result: 2 blocking and 2 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.

Comment thread src-tauri/crates/berd-monitor/src/main.rs Outdated
Comment thread src/features/chat/ui/MessageBubble.tsx
Comment thread src-tauri/crates/berd-monitor/src/main.rs Outdated
Comment thread src-tauri/crates/berd-monitor/src/main.rs
Signed-off-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Automated code review

REQUEST_CHANGES: the fresh full review of the exact three-dot comparison found four new blocking monitor lifecycle and delivery issues. All changed files and user flows were reviewed, including monitor launch, ownership, producer execution, stop, delivery, retries, durable buffering, and packaging; cross-session create/send/steer/queue/drain/replay and provenance; accessibility; English and Spanish localization; navigation and consent guards; async, error, never-completes, lifecycle, and race behavior; test honesty; design-system and project-law compliance; duplicate memory and overlap. The four supplied prior threads are resolved with substantive human-account replies and their fixes remain present. Supplied GitHub evidence was structurally valid and inspected: all listed check runs passed, while combined status remained pending at capture time. Required checks independently govern merge readiness.

Deterministic publication result: 4 blocking and 0 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.

Comment thread src-tauri/crates/berd-monitor/src/main.rs
Comment thread src-tauri/crates/berd-monitor/src/main.rs
Comment thread src-tauri/crates/berd-monitor/src/main.rs
Comment thread src-tauri/crates/berd-monitor/src/main.rs Outdated
Signed-off-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Automated code review

REQUEST_CHANGES: the fresh full review of the exact three-dot comparison found three new blocking correctness issues in delivery deduplication and monitor output handling. The review covered every changed file and user flow, including monitor launch, ownership, producer cleanup, stop, bounded delivery, retry, durable buffering and idempotency; cross-session create/send/steer/queue/drain/replay and provenance; accessibility; English and Spanish localization; navigation and consent guards; async, error, never-completes, lifecycle, and race behavior; test honesty; design-system and project-law compliance; and duplicate overlap. All eight supplied threads were read: the four resolved threads have substantive human replies, and the four unresolved findings are fixed in the current comparison, so none is repeated or suppressed as a still-present issue. Supplied GitHub evidence was structurally valid and inspected: DCO passed and the remaining listed checks were in progress at capture time. Required checks independently govern merge readiness.

Deterministic publication result: 3 blocking and 0 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.

Comment thread src/features/berdctl/bridge/useBerdctlQueuedMessageDrain.ts
Comment thread src/features/berdctl/commands/impl/sendSession.ts Outdated
Comment thread src-tauri/crates/berd-monitor/src/main.rs Outdated
Signed-off-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Automated code review

REQUEST_CHANGES: the fresh full review of the exact three-dot comparison found one new blocking lifecycle race and one new non-blocking metadata consistency issue. The review covered every changed file and flow: monitor launch, ownership, producer cleanup, stop, bounded delivery, retries, persistence and idempotency; cross-session create/send/steer/queue/drain/replay, manual edits, and provenance; accessibility; English and Spanish localization; navigation and consent guards; async, error, never-completes, lifecycle, and race behavior; test honesty; design-system and project-law compliance; and duplicate overlap. All eleven supplied threads were read; each is resolved with a substantive human-account reply and its discussed fix is present, so none is repeated or suppressed as a still-present issue. Supplied GitHub evidence was structurally valid and inspected: DCO, Windows and Linux Rust checks, and clean-room install passed; macOS Rust and frontend checks were in progress at capture time. Required checks independently govern merge readiness.

Deterministic publication result: 1 blocking and 1 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.

Comment thread src-tauri/crates/berd-monitor/src/main.rs Outdated
Comment thread src/features/chat/ui/ChatInput.tsx
Signed-off-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Automated code review

REQUEST_CHANGES: the fresh full review of the exact three-dot comparison found two new blocking reliability issues. The review covered every changed file and flow: monitor launch, ownership, producer cleanup, stdout capture, stop, bounded delivery, retries, persistence and idempotency; cross-session create/send/steer/queue/drain/replay, cold-session hydration, manual edits, and provenance; accessibility; English and Spanish localization; navigation and consent guards; async, error, never-completes, lifecycle, and race behavior; test honesty; design-system and project-law compliance; and duplicate overlap. All thirteen supplied threads were read; each is resolved with a substantive human-account reply and its discussed fix is present, so none is repeated or suppressed as a still-present issue. Supplied GitHub evidence was structurally valid and inspected: DCO, Linux Rust checks, and clean-room install passed; frontend, Windows Rust, and macOS Rust checks were in progress at capture time. Required checks independently govern merge readiness.

Deterministic publication result: 2 blocking and 0 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.

Comment thread src-tauri/crates/berd-monitor/src/main.rs Outdated
Comment thread src/features/berdctl/commands/runtime/sessionSend.ts Outdated
Signed-off-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Automated code review

REQUEST_CHANGES: the fresh full review of the exact three-dot comparison found one new blocking restart-recovery issue in queued delivery deduplication. The review covered every changed file and flow: monitor launch, ownership, producer cleanup, stdout capture and failures, stop, bounded delivery, retries, persistence and idempotency; cross-session create/send/steer/queue/drain/replay, cold-session hydration, manual edits, and provenance; accessibility; English and Spanish localization; navigation and consent guards; async, error, never-completes, lifecycle, and race behavior; test honesty; design-system and project-law compliance; and duplicate overlap. All fifteen supplied threads were read; each is resolved with a substantive human-account reply and its discussed fix is present, so none is repeated or suppressed as a still-present issue. Supplied GitHub evidence was structurally valid and inspected: DCO, frontend checks/unit tests, and clean-room install passed; build smoke, transcript virtualization, and Rust checks were in progress at capture time. Required checks independently govern merge readiness.

Deterministic publication result: 1 blocking and 0 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.

Comment thread src/features/berdctl/bridge/useBerdctlQueuedMessageDrain.ts
Signed-off-by: John Tennant <jtennant@block.xyz>

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Automated code review

REQUEST_CHANGES: the fresh full review of the exact three-dot comparison found one new blocking process-lifecycle issue. The review covered every changed file and flow: monitor launch, ownership, producer cleanup, stdout capture and failures, stop, bounded delivery, retries, persistence and idempotency; cross-session create/send/steer/queue/drain/replay, restart recovery, cold-session hydration, manual edits, and provenance; accessibility; English and Spanish localization; navigation and consent guards; async, error, never-completes, lifecycle, and race behavior; test honesty; design-system and project-law compliance; and duplicate overlap. All sixteen supplied threads were read; each is resolved with a substantive human-account reply and its discussed fix is present, so none is repeated or suppressed as a still-present issue. Supplied GitHub evidence was structurally valid and inspected: macOS, Windows, Linux, frontend checks/unit tests, clean-room install, and DCO passed; transcript virtualization and frontend build smoke were in progress at capture time. Required checks independently govern merge readiness.

Deterministic publication result: 1 blocking and 0 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.

Comment thread src-tauri/crates/berd-monitor/src/main.rs
Signed-off-by: John Tennant <jtennant@block.xyz>

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Automated code review

APPROVE: the fresh full review of the exact three-dot comparison found no new publishable findings. The review covered every changed file and flow: monitor launch, ownership, producer cleanup, stdout capture and failures, stop, bounded delivery, retries, persistence and idempotency; cross-session create/send/steer/queue/drain/replay, restart recovery, cold-session hydration, manual edits, and provenance; accessibility; English and Spanish localization; navigation and consent guards; async, error, never-completes, lifecycle, and race behavior; test honesty; design-system and project-law compliance; and duplicate overlap. All seventeen supplied threads were read; each is resolved with a substantive human-account reply and its discussed fix remains present, with no regression or still-existing issue requiring suppression. Supplied GitHub evidence was structurally valid and inspected: all listed checks passed. Required checks independently govern merge readiness.

Deterministic publication result: 0 blocking and 0 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.

Pending checks: 1 check(s) are not complete.

This approval reflects the completed code review only; merge readiness remains governed by the repository's required checks.

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.

2 participants