Skip to content

Allow creating agents with Claude Code - #678

Open
salman1993 wants to merge 4 commits into
mainfrom
codex/claude-code-agents
Open

salman1993 wants to merge 4 commits into
mainfrom
codex/claude-code-agents

Conversation

@salman1993

@salman1993 salman1993 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Why

Settings can install and sign in to Claude Code after #654, but Create agent cannot select it. Complete that path using the existing native controller.

What

Offer Claude Code in Create/Edit when its tools are installed. Use Claude's own model and credentials. Preserve the dedicated Settings row and guidance for missing tools or sign-in.

How

Reuse the shared harness preset and native setup discovery. Save the selected adapter's absolute path with empty default arguments. Managed launches use pinned Node and the installed Claude CLI. External launches resolve local tools. Explicit Advanced environment overrides remain supported. A saved CLAUDE_CODE_EXECUTABLE bypasses CLI discovery while Node resolution remains required.

The installed adapter lacked its SDK's optional native binary. It passed --version but failed at session creation. Pointing it at the existing Claude CLI fixes that path without reinstalling. Windows batch login launchers remain excluded from the JavaScript SDK override; those installs need the SDK's native optional dependency.

The pinned Buzz runtime already handles Claude's ACP sessions, system-prompt append, permissions and cancellation. Identity creation, Start/Stop/Restart, profile publication and retry keep their existing owners. No runtime dependency update or second lifecycle owner is added.

Risk

Claude launch discovery, its form choice, and local transcript export change. Model browsing, provider controls and device-wide Claude defaults remain outside this slice. Picker availability confirms installed tools, not inference. Existing model/provider values remain visible for explicit recovery to Claude defaults.

Testing

Verified the missing-CLI override case under a macOS sandbox that denied reads from the host’s global CLI fallback directories. The extended launch regression failed before the fix with “Install Claude Code” and passed after it. The fixture supplied only a runnable custom CLI outside discovery paths. No installed tools were changed. Independent review found no blockers.

/usr/bin/sandbox-exec -p '(version 1)(allow default)(deny file-read* (subpath "/opt/homebrew/bin") (subpath "/usr/local/bin"))' target/debug/deps/buzz_agent_controller-23c0c66bb07d8feb --exact runtime::tests::external_claude_launch_resolves_node_and_avoids_windows_batch_cli_overrides --nocapture

Added Claude session viewing instructions and a non-interactive HTML exporter. Verified transcript lookup using the requested Buzz thread and generated a 35-message local viewer. Chromium and WebKit displayed messages and expanded tool results with zero external requests. The source transcript was unchanged. Independent review found no blockers. No raw transcript data is included.

The human created a Claude agent and showed its live channel replies. The transcript confirmed that the initial empty reply came from a shell alias whose target was outside the runtime PATH. Bypassing the alias delivered the reply. Runtime behavior is unchanged by this documentation follow-up.

On macOS arm64, exercised installed adapter 0.85.1 with the same restricted environment as the launch path. Initialization passed before the fix, but session/new failed with a missing native binary. With the selected managed Claude CLI, session creation passed and a prompt returned exactly BUZZ_CLAUDE_OK with end_turn.

Exercised the actual creation dialog in isolated Chromium and WebKit fixtures: selected Claude, confirmed provider/model controls were absent, and observed Create → Start → profile completion. Fixtures use synthetic identities and fake native host responses. No browser journeys were added or removed. Independent agent review found no blockers.

Normal PR CI and hosted DCO passed at c790c3f2. The later run at 1a82986a checked a synthetic merge into main 515554ef; JavaScript and integration jobs failed on the upstream message composer’s undefined mentionCandidates, also reported by failing browser jobs. That file is outside this PR. Windows native CI failed in archive paging and project-Git helper cancellation tests outside the changed files; its Claude tests passed. Windows validation remains incomplete.

Deferred: packaged native Create/Edit, human Stop/Start acceptance, and actual Windows/Linux/Intel macOS launches. A real adapter prompt and browser fixture do not establish those flows. No buzz-review-completed attestation is claimed.

To try locally, run bin/just desktop from this worktree. In Settings → Agents, confirm Claude is signed in. Open Agents → Add agent, choose Claude Code, name it, select a workspace, and create it. Add or mention it in a channel and check its reply, then Stop/Start it.

Bigger picture

This is the second Claude Code PR after #654. It learns from old Buzz's launch behavior while reusing the new app's existing owners.

Generated with Codex

Signed-off-by: Salman Mohammed <smohammed@squareup.com>
@salman1993
salman1993 requested a review from wpfleger96 October 6, 2026 22:57

@wesbillman wesbillman 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.

Carl, an automated reviewer, commenting via Wes’s GitHub account.

One P2 launch blocker; changes requested. Address the inline finding and cover an explicit CLI override with no discoverable CLI.

Reviewed head c790c3f28be09a198ea2a64ce4853c9d11c97b14 against merge-base 04ab197ae95dabe8e109141cebfcc7935ab28472 (target tip fc594b28964a39e401f2c86c3d89bfd14f9c2686). Independent frontend/native review plus a local probe using the unchanged Rust discovery helpers; no local app launch or duplicated broad suites.

Normal PR CI and DCO pass. The separate Windows run failed in archive retention and Git-helper cancellation; its Claude tests passed. This is a separate CI issue, not evidence that this diff caused those failures. Please update the stale “pending” note. Packaged native Create/Edit, live relay replies, mixed-version external CLI use, and actual cross-platform launches remain unverified by this review.

Comment thread crates/agent-controller/src/runtime.rs Outdated
Comment on lines +359 to +364
let cli = if let Some(app_data) = managed_data {
managed_tool(app_data, "claude").or_else(|| installed_npm_tool("claude"))
} else {
installed_npm_tool("claude")
}
.ok_or("Install Claude Code in Settings → Agents → Harnesses")?;

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.

[P2] Honor the explicit CLI override before requiring autodiscovery

command_checked calls claude_tools before applying/checking the saved CLAUDE_CODE_EXECUTABLE override. Consequently this unconditional error prevents a valid custom CLI from being used when no separate claude is discoverable. For example, enter an absolute adapter through Custom executable / current value, with Node beside it, and set Advanced CLAUDE_CODE_EXECUTABLE to a runnable CLI outside the searched PATH (or move an existing agent’s CLI there). Save succeeds, but Start returns “Install Claude Code” without launching. Disabling the ordinary picker does not prevent this supported custom-entry/saved-agent path.

I reproduced the discovery failure with the unchanged helpers: the complete fixture succeeds; removing only the discoverable CLI fails despite a runnable explicitly selected CLI. The new override test retains the discoverable CLI, so it misses this case.

Pass the effective override into launch preparation and skip the unrelated CLI-discovery requirement when it is explicitly supplied, while retaining Node resolution. Add coverage where only the overridden CLI exists.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤖 Fixed in 211cb7e. A saved CLAUDE_CODE_EXECUTABLE now bypasses CLI discovery while retaining Node resolution and PATH setup. Extended the launch fixture with only a runnable custom CLI outside discovery paths; the isolated regression failed before the fix with “Install Claude Code” and passed afterward. All 58 active runtime tests passed. Updated the CI notes to distinguish the unrelated upstream message-composer and Windows failures.

Signed-off-by: Salman Mohammed <smohammed@squareup.com>
Signed-off-by: Salman Mohammed <smohammed@squareup.com>
Signed-off-by: Salman Mohammed <smohammed@squareup.com>
@salman1993
salman1993 requested a review from wesbillman October 6, 2026 23:58
@salman1993
salman1993 marked this pull request as ready for review October 6, 2026 23:58
@salman1993
salman1993 requested review from a team and comp615 as code owners October 6, 2026 23:58
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T00:02:45.953930Z 211cb7e Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@wesbillman wesbillman 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.

Carl, an automated reviewer, commenting via Wes’s GitHub account.

Prior P2 addressed; no new code blockers found. Re-reviewed 211cb7e2eb7b9cb32dcd5a44c96cab0ddd1749b5 against merge-base 04ab197ae95dabe8e109141cebfcc7935ab28472, focusing on changes since c790c3f2.

  • The explicit CLI override now reaches launch preparation before discovery. An isolated probe of the unchanged helpers passed override-only external and managed installs, retained both Node requirements, and retained missing-CLI rejection without an override. The added command-level regression preserves the override in the child environment.
  • No blockers in the new local exporter. Independent review exercised the actual exporter and file viewer in Chromium/WebKit: inert text, expandable tool results, no external requests, unchanged source, and owner-only output permissions on macOS.

Current-head CI is still running; DCO passes. No broad suites or native agent launch were rerun here. Packaged lifecycle and cross-platform launch acceptance remain deferred as documented. This is a comment review, not approval.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 211cb7e2eb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"setupHint": "Install Hermes with ACP support and configure it with `hermes model`. Store provider API keys in `~/.hermes/.env`; Buzz doesn’t inherit shell exports. Verify with `hermes acp --check`."
},
{
"id": "claude",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add the required DCO sign-off trailer

Commit 0bc0f3a1dd7ad8c99ed86660602494fc879db87d has no Signed-off-by trailer, so it violates the repository’s mandatory DCO policy and cannot satisfy the required hosted DCO check. Recreate the commit with git commit --signoff using the verified effective author identity.

AGENTS.md reference: AGENTS.md:L157-L162

Useful? React with 👍 / 👎.

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