Skip to content

feat(agents): wake shared agents from channel-scoped mentions - #114

Open
tee8z wants to merge 1 commit into
feat/shared-agent-harnessfrom
feat/shared-agent-wakeup
Open

tee8z wants to merge 1 commit into
feat/shared-agent-harnessfrom
feat/shared-agent-wakeup

Conversation

@tee8z

@tee8z tee8z commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

An ordinary channel mention could reach history but fail to wake a sleeping remote agent live. The wake listener subscribed without channel scope and treated its own history-close acknowledgement as an error. This layer discovers up to 64 current agent channel memberships, subscribes explicitly to those channels, overlaps history with the installed live subscription, and accepts requested close acknowledgements.

With the manager's shared_tasks setting enabled, cross-owner mentions use the same current-grant policy and atomic admission journal as running harness turns. A verified shared task constructs a confined launch in the target owner's existing namespace; it never manufactures an owner-signed control event. Permanent refusals produce durable channel replies. Owner lifecycle operations remain separately authorized.

Depends on #113. Review order: #108 → #101 → #110 → #112 → #113 → this PR.

Validation:

  • Complete local workflow passed against a real membership-enabled relay and Postgres/Redis: two human owners, two agent identities, owner opt-in grants, server-side wakeup, actual buzz-acp processes, an actual CLI handoff, replies in the original thread, then revocation preventing another model turn.
  • The model was a deterministic ACP adapter and the Kubernetes API was simulated; this does not claim a staging Pod or external model test.
  • Fixed the Kubernetes fixture to preserve namespace isolation when listing Pods, so one owner's Pod does not incorrectly block another owner's launch.
  • Production-path regression requires the live listener to survive the relay's acknowledgement of the requested history close and deliver the next mention on that connection. The fake relay now models channel-scoped live routing.
  • Manager: 141 passed, 2 ignored. Kubernetes provider: 224 unit tests and 5 integration tests passed, 1 real-cluster test ignored. Clippy passed across all targets for both packages; formatting and the repository file-size gate passed.
  • The ignored real-relay workflow was run explicitly and passed; the other ignored tests require separate infrastructure. Full local Tauri CI remains limited by the host missing GLib development files.

Rollout remains disabled by default. Deploy matching relay, manager, and agent images, enable mention startup and shared_tasks in the manager config, then let each human owner publish channel grants. Existing older thread configurations require explicit recovery or a new thread. The infrastructure switch is voltage-terraform #1015. Server startup also needs voltage-terraform #1014 and CD #667. No capacity, Spot policy, IAM, or session quota expansion is included in this sharing layer.

Human acceptance remains pending. After rollout, a second channel member should invoke an opted-in agent, hand work to another owner's opted-in agent, and revoke one grant. The next shared turn must visibly refuse; owner DMs and owner lifecycle controls must still work. No review-completion attestation is claimed.

@tee8z tee8z self-assigned this Nov 4, 2026
@tee8z
tee8z requested a review from thebrandonlucas November 4, 2026 01:20
@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 12 billable files and costs up to $3.00.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 3 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 50 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between bca433e and 6e9dcd7.

Files ignored due to path filters: 1
  • Cargo.lock is excluded by !**/*.lock
Files selected for processing: 12
  • crates/buzz-backend-kubernetes/src/sandbox_fake.rs
  • crates/buzz-sandbox-reaper/Cargo.toml
  • crates/buzz-sandbox-reaper/src/manager.rs
  • crates/buzz-sandbox-reaper/src/mentions.rs
  • crates/buzz-sandbox-reaper/src/mentions/channels.rs
  • crates/buzz-sandbox-reaper/src/mentions/tests.rs
  • crates/buzz-sandbox-reaper/src/mentions/tests/relay.rs
  • crates/buzz-sandbox-reaper/src/mentions/tests/shared_agent.py
  • crates/buzz-sandbox-reaper/src/mentions/tests/shared_live.rs
  • crates/buzz-sandbox-reaper/src/mentions/worker.rs
  • crates/buzz-sandbox-reaper/src/mobile_launch.rs
  • docs/shared-channel-agents.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@tee8z
tee8z added this pull request to stack #111 November 4, 2026 01:21
@tee8z

tee8z commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

Agent review and exercised workflow: the implementation now subscribes to bounded, current agent channel memberships. It derives the history fence after the live subscription is installed and accepts acknowledgements of its own closed discovery/history subscriptions. The production listener regression fails if the close-ack guard is removed; the fake relay now models Buzz's channel-only live routing.

Cross-owner wakeup runs the same fresh policy and durable budget admission as running turns, then constructs an immutable target-owner launch without forging an owner signature. The manager still uses configured namespaces, saved launch credentials, image policy, and quotas. Refused starts retain a signed channel notice. Per-agent discovery is bounded at 64 channels and uses the agent's own relay identity.

The complete local workflow passed with a real relay, Postgres/Redis, actual harness processes and CLI commands: another human invokes a sleeping shared agent, that agent hands off to another owner's agent, the response stays in the original thread, and revocation prevents another model turn. The ACP model adapter and Kubernetes API were simulated; this is not staging or external-model evidence.

Manager: 140 tests passed; Kubernetes provider: 223 unit and 5 integration tests passed. Two manager tests and one provider test require separate infrastructure; the new real-relay test was run explicitly and passed. Clippy passed across all targets for both packages, as did formatting and the repository file-size gate. No remaining concrete blocker found in this layer. Minimalism, elegance, correctness: 9/10 each. Human acceptance and staging rollout remain pending.

Signed-off-by: Tee8z <tee8z@protonmail.com>
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