Skip to content

feat(prime): detect Buzz orchestrator, tailor whisper/murmur guidance - #716

Merged
rsnodgrass merged 2 commits into
mainfrom
ryan/ox-buzz-integration
Jul 24, 2026
Merged

rsnodgrass merged 2 commits into
mainfrom
ryan/ox-buzz-integration

Conversation

@rsnodgrass

@rsnodgrass rsnodgrass commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Makes ox recognize when it's running under Block's Buzz (block/buzz) — whose buzz-acp ACP harness spawns Claude Code / Codex as sub-agents — and adapt its coordination guidance, since Buzz does not fire the lifecycle hooks SageOx normally relies on.

Two parts:

  • Detection — bumps github.com/sageox/agentx v0.1.10 → v0.1.11 (merged as sageox/agentx#12), which adds AgentTypeBuzz + a new Environment.ProcessAncestry() probe. Buzz sets no marker env var on the child, so the reliable signal is that buzz-acp is always a process ancestor of the agent. ox agent prime already stamps agentx.OrchestratorType() as the X-Orchestrator header, so once the dep resolves Buzz, detection flows with no change to that call site.
  • Guidance (the ox code here) — when the detected orchestrator is buzz, prime emits a new OrchestratorDirective: under Buzz, real-time push-whispers don't arrive (they ride hooks Buzz doesn't fire), so the agent is told to pull teammates' signals with ox agent <id> whisper and publish its own with ox murmur. A clean no-op for every other environment.
flowchart LR
    Buzz["buzz-acp"] -->|"spawns via ACP"| Agent["Claude / Codex"]
    Agent -->|"runs ox agent prime"| DET{"orchestrator is buzz?"}
    DET -->|"yes"| G["emit directive: pull whispers<br/>via ox agent id whisper"]
    DET -->|"no"| N["normal prime output"]
    G --> HDR["X-Orchestrator: buzz on API calls"]
Loading

Change surface (ox):

File Change
go.mod / go.sum agentx v0.1.10 → v0.1.11 (Buzz detection)
internal/prime/types.go new OrchestratorDirective field on prime Output
cmd/ox/agent_prime.go populate it when OrchestratorType() == buzz
cmd/ox/agent_prime_xml.go emit it in the XML session-context (mirrors MurmurDirective)
cmd/ox/*_test.go registration/detection guard + directive-emission test

Scope note: this is the interim, hook-independent shell path (agent runs ox murmur / ox agent whisper). The durable MCP-based path (an ox_murmur tool forwarded over ACP session/new) is deferred and tracked separately — it needs ox mcp serve, which doesn't exist yet.

Test Plan

  • agentx (v0.1.11): table-driven Detect (env hatch, BUZZ_ACP_AGENT_COMMAND, ancestry hit deep/prefixed, plus negative guards that BUZZ_RELAY_URL/BUZZ_PRIVATE_KEY alone do not detect) + a pure walkAncestry parser test (malformed rows, comm-with-spaces, self-parent loop, 20-level cap, PID-1 exclusion). make test + golangci-lint green; ancestry probe validated on a live host (returned [go zsh claude conductor-runtime conductor] — correctly surfaced the real orchestrator).
  • ox (this PR): TestBuzzOrchestratorRegistered (Buzz registered in the default registry and detects ORCHESTRATOR_ENV=buzz — deterministic via DetectByType, so it doesn't flake when the host also sets Conductor env vars) and TestOutputAgentPrimeXML_OrchestratorDirective (directive emitted when set, no-op when empty). make lint → 0 issues; make test → 16,879 passed, 0 failed.

Checklist (expand if needed)
  • Tests added
  • CHANGELOG entry added — agentx side ships the v0.1.11 entry; the ox side is additive guidance (no user-facing CLI/behavior change beyond a prime directive), so no ox CHANGELOG entry
  • Breaking change — none. The agentx Environment interface gained a method, verified non-breaking for ox (no ox-side implementers; full build + tests pass)
  • Ran /security-review — N/A. No auth/MCP/session-writer/redaction/upgrade code touched; the only go.sum change is the agentx version bump (a SageOx-owned module reviewed in feat(orchestrators): add Buzz (block/buzz) orchestrator detection agentx#12)

Co-authored-by: SageOx ox@sageox.ai

Summary by CodeRabbit

  • New Features
    • Added guidance for sessions running under Buzz when automatic teammate updates are unavailable.
    • Buzz sessions now receive instructions to manually retrieve teammate murmurs and publish work-in-progress updates.
    • The guidance is included in session startup output when applicable.

@socket-security

socket-security Bot commented Jul 24, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedgolang/​github.com/​sageox/​agentx@​v0.1.10 ⏵ v0.1.1197100100100100

View full report

@coderabbitai

coderabbitai Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 32 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d5c020bf-eb04-4253-8203-5e7dc586487a

📥 Commits

Reviewing files that changed from the base of the PR and between 91eb168 and e495aa1.

📒 Files selected for processing (1)
  • cmd/ox/agent_prime_orchestrator_test.go
📝 Walkthrough

Walkthrough

Prime output now detects the Buzz orchestrator, adds Buzz-specific manual whisper instructions, carries them through the prime output model, and conditionally renders them in session-context XML. Tests cover Buzz registration and directive rendering.

Changes

Buzz prime guidance

Layer / File(s) Summary
Buzz detection and directive contract
go.mod, cmd/ox/agent_prime_orchestrator_test.go, internal/prime/types.go
Updates agentx, verifies Buzz detection, and adds the optional OrchestratorDirective output field.
Directive generation and XML rendering
cmd/ox/agent_prime.go, cmd/ox/agent_prime_xml.go, cmd/ox/agent_prime_xml_test.go
Generates Buzz-specific whisper instructions and conditionally emits the XML-escaped directive in session context, with populated and empty-value tests.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • sageox/ox#712: Touches the same prime output and XML plumbing while adding compact-reprime behavior.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: Buzz orchestrator detection plus tailored whisper/murmur guidance.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ryan/ox-buzz-integration

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
cmd/ox/agent_prime_orchestrator_test.go (1)

22-31: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Make the registration test table-driven.

Add cases for the successful Buzz registration and an unregistered/invalid type so this test follows the repository’s Go testing convention while retaining explicit error-path coverage.

As per coding guidelines, Go test files should use table-driven tests and include error-path coverage.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cmd/ox/agent_prime_orchestrator_test.go` around lines 22 - 31, Convert
TestBuzzOrchestratorRegistered into a table-driven test with cases for
successful Buzz detection and an unregistered or invalid agent type. Run each
case through agentx.NewDetector().DetectByType, assert the expected error state
and detection result, and retain clear failure messages for both paths.

Source: Coding guidelines

cmd/ox/agent_prime_xml_test.go (1)

275-300: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert the session-context and escaping contract.

The whole-document Contains checks would pass if the directive were emitted outside <session-context>, and the current input does not exercise XML escaping. Make the populated/empty cases table-driven, scope assertions to the session-context block, include XML metacharacters, and cover the writer-error path.

As per coding guidelines, Go test files should use table-driven tests and include error-path coverage.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cmd/ox/agent_prime_xml_test.go` around lines 275 - 300, Update
TestOutputAgentPrimeXML_OrchestratorDirective to use table-driven populated and
empty cases, extract the <session-context> block before asserting directive
presence or absence, and include XML metacharacters in the populated directive
to verify escaping. Add a writer-error case by using a command output writer
that fails, and assert outputAgentPrimeXML returns the expected error.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cmd/ox/agent_prime.go`:
- Around line 780-789: Move the Buzz-specific OrchestratorDirective construction
in runAgentPrime before the authentication/degraded return. Ensure the computed
directive is assigned to both the degraded agentPrimeOutput and the normal fresh
output, while remaining a no-op for non-Buzz orchestrators.

---

Nitpick comments:
In `@cmd/ox/agent_prime_orchestrator_test.go`:
- Around line 22-31: Convert TestBuzzOrchestratorRegistered into a table-driven
test with cases for successful Buzz detection and an unregistered or invalid
agent type. Run each case through agentx.NewDetector().DetectByType, assert the
expected error state and detection result, and retain clear failure messages for
both paths.

In `@cmd/ox/agent_prime_xml_test.go`:
- Around line 275-300: Update TestOutputAgentPrimeXML_OrchestratorDirective to
use table-driven populated and empty cases, extract the <session-context> block
before asserting directive presence or absence, and include XML metacharacters
in the populated directive to verify escaping. Add a writer-error case by using
a command output writer that fails, and assert outputAgentPrimeXML returns the
expected error.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ae103388-cd0f-452f-a088-777aded63cb7

📥 Commits

Reviewing files that changed from the base of the PR and between aa87876 and 91eb168.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (6)
  • cmd/ox/agent_prime.go
  • cmd/ox/agent_prime_orchestrator_test.go
  • cmd/ox/agent_prime_xml.go
  • cmd/ox/agent_prime_xml_test.go
  • go.mod
  • internal/prime/types.go

Comment thread cmd/ox/agent_prime.go
@rsnodgrass
rsnodgrass marked this pull request as ready for review July 24, 2026 00:44
@rsnodgrass

Copy link
Copy Markdown
Contributor Author

Addressed the CodeRabbit nitpick in e495aa1: TestBuzzOrchestratorRegistered is now table-driven with a positive case (Buzz registered + detects ORCHESTRATOR_ENV=buzz) and a negative case (unregistered type returns a not-registered error, which proves the positive case's no-error result is a meaningful registration signal). The one inline thread (degraded-path directive) is resolved with reasoning — it's intentional, matching the auth-gated sibling directives.

@rsnodgrass
rsnodgrass merged commit 0951ec8 into main Jul 24, 2026
12 checks passed
@rsnodgrass
rsnodgrass deleted the ryan/ox-buzz-integration branch July 24, 2026 01:01
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