Skip to content

feat(tools,core): background shell execution and completion notifications#3352

Merged
bug-ops merged 4 commits intomainfrom
3328-monitor-push-notification
Apr 24, 2026
Merged

feat(tools,core): background shell execution and completion notifications#3352
bug-ops merged 4 commits intomainfrom
3328-monitor-push-notification

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Apr 24, 2026

Summary

Key design decisions

  • Background completion N1: all pending completions + user text merged into one user-role block
  • sanitize_applescript_payload: strips ", \, U+2028, U+2029 (AppleScript has no backslash escaping)
  • ToolEventTx changed from unbounded to bounded mpsc::Sender (cap 1024)
  • Zero new crate-level dependencies

Test plan

  • cargo nextest run --workspace --lib --bins — 8323 tests pass
  • cargo clippy --workspace -- -D warnings — clean
  • cargo +nightly fmt --check — clean
  • Live: zeph notify test fires macOS notification
  • Live: background bash run completes and appears in next turn context
  • Live: webhook URL with file:// scheme → startup warning, no POST
  • See .local/testing/playbooks/background-shell-notifications.md for full scenarios

Coverage

New rows added to .local/testing/coverage-status.md with status Untested for live scenarios.

Closes #3328, #3329

@github-actions github-actions Bot added enhancement New feature or request documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate dependencies Dependency updates config Configuration file changes size/XL Extra large PR (500+ lines) and removed enhancement New feature or request labels Apr 24, 2026
@bug-ops bug-ops force-pushed the 3328-monitor-push-notification branch from 4646928 to 6e3c3ba Compare April 24, 2026 16:41
@bug-ops bug-ops enabled auto-merge (squash) April 24, 2026 16:41
@github-actions github-actions Bot added the enhancement New feature or request label Apr 24, 2026
@bug-ops bug-ops force-pushed the 3328-monitor-push-notification branch 2 times, most recently from 6782e98 to 2f54d01 Compare April 24, 2026 17:15
bug-ops added 4 commits April 24, 2026 20:41
…notifications

Add background=true parameter to bash tool: commands spawn immediately and return
a run_id stub; completion is delivered as a synthetic user-role block prepended to
the next user message (N1 invariant: single user-role block satisfies Anthropic
strict alternation). Buffer cap 32 with drop-oldest + sentinel on overflow. New
ShellExecutor methods: spawn_background, shutdown, with_background_completion_tx.
ToolEventTx changed to bounded mpsc::Sender (cap 1024). New config fields:
tools.shell.max_background_runs (default 8) and background_timeout_secs (default
1800). New TaskClass::BackgroundShell isolated from Enrichment tasks.

Add per-turn completion notifier: fires after channel.flush_chunks() via macOS
osascript (stdin-fed, injection-safe via control-char strip + U+2028/U+2029 + quote
strip) and/or ntfy-compatible JSON webhook. Gate: enabled switch, zero-LLM-success
skip, only_on_error, min_turn_duration_ms (bypassed for errors). Webhook URL
validated for HTTPS scheme at startup (SSRF prevention). New zeph notify test CLI
subcommand and /notify-test slash command. New [notifications] config section.

Closes #3328, #3329
@bug-ops bug-ops force-pushed the 3328-monitor-push-notification branch from b04a6d4 to 932e5cb Compare April 24, 2026 18:41
@bug-ops bug-ops merged commit dc35bd7 into main Apr 24, 2026
32 checks passed
@bug-ops bug-ops deleted the 3328-monitor-push-notification branch April 24, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration file changes core zeph-core crate dependencies Dependency updates documentation Improvements or additions to documentation enhancement New feature or request rust Rust code changes size/XL Extra large PR (500+ lines)

Projects

None yet

1 participant