Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/buzz-acp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ All configuration is via environment variables (or CLI flags — every env var h
| `BUZZ_ACP_MCP_COMMAND` | no | `""` (empty) | Path to an optional MCP server binary to provide to the agent subprocess. |
| `BUZZ_ACP_IDLE_TIMEOUT` | no | `620` | Idle timeout: max seconds of silence before cancelling a turn. Resets on any agent stdout activity. |
| `BUZZ_ACP_MAX_TURN_DURATION` | no | `7200` | Absolute wall-clock cap per turn (safety valve). |
| `BUZZ_ACP_CHANNEL_DISCOVERY_REFRESH_SECS` | no | `90` | Safety reconciliation interval for missed channel joins/removals. `0` disables; live membership notifications remain active. |
| `BUZZ_API_TOKEN` | no | — | API token (required if relay enforces token auth). |

**Note:** `BUZZ_ACP_AGENT_ARGS` splits on commas. For args with values, use: `-c,key="value"`.
Expand Down
27 changes: 27 additions & 0 deletions crates/buzz-acp/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ pub(crate) const DEFAULT_MAX_TURN_DURATION_SECS: u64 = 7200;
/// deadline (`max_turn_duration + IN_FLIGHT_DEADLINE_BUFFER_SECS`).
pub(crate) const MAX_TURN_DURATION_CEILING_SECS: u64 = 604_800;

/// Default interval (seconds) between periodic channel re-discovery sweeps.
///
/// The live kind:44100 member-added notification is the primary subscribe
/// trigger for newly joined channels. Notifications can still be missed during
/// outages, backpressure, or compatibility with older relay/writer versions;
/// the periodic sweep re-runs startup discovery so a running agent converges.
/// Removals require two consecutive successful sweeps before cleanup.
///
/// Override via `--channel-discovery-refresh-secs` /
/// `BUZZ_ACP_CHANNEL_DISCOVERY_REFRESH_SECS`. 0 disables.
pub(crate) const DEFAULT_CHANNEL_DISCOVERY_REFRESH_SECS: u64 = 90;

#[derive(Debug, Error)]
pub enum ConfigError {
#[error("failed to parse nostr keys: {0}")]
Expand Down Expand Up @@ -387,6 +399,16 @@ pub struct CliArgs {
#[arg(long, env = "BUZZ_ACP_NO_TYPING")]
pub no_typing: bool,

/// Seconds between periodic channel re-discovery sweeps that reconcile
/// missed channel joins and removals. 0 disables the sweep; live membership
/// notifications remain active either way.
#[arg(
long,
env = "BUZZ_ACP_CHANNEL_DISCOVERY_REFRESH_SECS",
default_value_t = DEFAULT_CHANNEL_DISCOVERY_REFRESH_SECS
)]
pub channel_discovery_refresh_secs: u64,

/// Enable NIP-AE agent core memory injection.
///
/// Memory injection is on by default. When enabled, the harness
Expand Down Expand Up @@ -547,6 +569,9 @@ pub struct Config {
pub max_turns_per_session: u32,
pub presence_enabled: bool,
pub typing_enabled: bool,
/// Seconds between periodic channel re-discovery sweeps. 0 = disabled.
/// See [`DEFAULT_CHANNEL_DISCOVERY_REFRESH_SECS`].
pub channel_discovery_refresh_secs: u64,
/// Whether NIP-AE agent core memory injection is enabled. When false,
/// the harness skips the per-session core engram fetch and renders no
/// `[Agent Memory — core]` section. On by default; disabled via the
Expand Down Expand Up @@ -1123,6 +1148,7 @@ impl Config {
max_turns_per_session: args.max_turns_per_session,
presence_enabled: !args.no_presence,
typing_enabled: !args.no_typing,
channel_discovery_refresh_secs: args.channel_discovery_refresh_secs,
memory_enabled: args.memory && !args.no_memory,
model,
effort_level: args.effort_level,
Expand Down Expand Up @@ -1499,6 +1525,7 @@ mod tests {
max_turns_per_session: 0,
presence_enabled: true,
typing_enabled: true,
channel_discovery_refresh_secs: DEFAULT_CHANNEL_DISCOVERY_REFRESH_SECS,
memory_enabled: true,
model: None,
effort_level: None,
Expand Down
Loading