Skip to content

feat: add CodeBuddy support - #1581

Merged
MischaPanch merged 3 commits into
oraios:mainfrom
studyzy:feat/codebuddy-support
Jun 28, 2026
Merged

feat: add CodeBuddy support#1581
MischaPanch merged 3 commits into
oraios:mainfrom
studyzy:feat/codebuddy-support

Conversation

@studyzy

@studyzy studyzy commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds native support for CodeBuddy as a supported CLI client, alongside existing support for Claude Code and Codex.

CodeBuddy is a CLI coding agent that shares a similar architecture with Claude Code — it supports MCP server configuration, hooks (PostToolUse, Notification, SessionStart, Stop), and the same tool naming conventions (read, grep, edit, etc.).

Changes

New features

  • Client setup handler (ClientSetupHandlerCodeBuddy): Enables serena setup codebuddy to auto-configure the MCP server. Includes version detection and stderr suppression.
  • CodeBuddy context (contexts/codebuddy.yml): A single-project context that disables overlapping tools (read_file, search_for_pattern, execute_shell_command, etc.) and encourages the agent to prefer Serena's symbolic tools.
  • Hook support: Extends the existing hook system (serena-hooks) to recognize --client=codebuddy, applying the same remind, activate, cleanup, and auto-approve hooks as Claude Code.

Documentation

  • README.md — added CodeBuddy alongside Claude Code and Codex in client lists.
  • docs/02-usage/030_clients.md — new "CodeBuddy" section with setup instructions (both auto and manual), MCP configuration examples, hook configuration JSON, and hook descriptions.
  • docs/02-usage/020_running.md, docs/02-usage/040_workflow.md, docs/02-usage/050_configuration.md — updated references to include CodeBuddy in lists of single-project contexts and supported clients.
  • CHANGELOG.md — updated a reference to include CodeBuddy in a prior fix note.

Bug fixes

  • Suppress stderr noise in is_applicable() checks: execute_shell_command() calls in ClaudeCode and Codex handlers now use capture_stderr=True, preventing shell "command not found" errors from leaking to the terminal when a client binary is not installed.
  • Relaxed version check for CodeBuddy: CodeBuddy's --version outputs only a version number (e.g. "2.106.4") without a recognizable binary name, so the version check only validates the return code rather than parsing stdout content.

Files changed

CHANGELOG.md                                       |   2 +-
README.md                                          |   6 +-
docs/02-usage/020_running.md                       |   6 +-
docs/02-usage/030_clients.md                       |  93 +++++++++++++-
docs/02-usage/040_workflow.md                      |   4 +-
docs/02-usage/050_configuration.md                 |   3 +-
src/serena/config/client_setup.py                  |  27 ++++-
src/serena/hooks.py                                |   5 +-
src/serena/resources/config/contexts/codebuddy.yml |  52 ++++++++
10 files changed, 183 insertions(+), 21 deletions(-)

Testing

  • Verified serena setup codebuddy correctly detects and configures CodeBuddy.
  • Verified hooks (remind, activate, cleanup, auto-approve) function correctly with --client=codebuddy.
  • Verified the CodeBuddy context properly disables overlapping tools and enforces single-project mode.

@studyzy

studyzy commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Hi @opcode81, would you have a chance to take a look at this PR when you get a moment? All CI checks have passed. Thanks!

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

Thanks for your contribution.

Please remove CodeBuddy from lists of examples to which it was added, i.e. a list as in "e.g. Claude Code, Codex or Copilot" should not be changed.
Non-exhaustive lists are supposed to contain the most prominent examples only.

Similarly, please move the CodyBuddy section to the end of the clients documentation file.

Address PR review feedback:
- Remove all documentation changes (docs/, CHANGELOG.md, README.md)
  per reviewer request to keep non-exhaustive example lists unchanged
  and avoid adding CodeBuddy to the clients documentation.
- Keep code changes only: ClientSetupHandlerCodeBuddy, hook support
  for --client=codebuddy, and the codebuddy context.
@studyzy
studyzy force-pushed the feat/codebuddy-support branch from 8e30fbf to c370b59 Compare June 23, 2026 09:14

@studyzy studyzy left a comment

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.

Hi @opcode81, thanks for the review.

I've updated the PR per your feedback:

  1. Removed CodeBuddy from non-exhaustive example lists — The README.md and other docs no longer list CodeBuddy alongside the prominent clients (Claude Code, Codex, Copilot, etc.).

  2. Moved CodeBuddy section to the end of the clients documentation file — The CodeBuddy section now appears before the "Other Clients" catch-all section in docs/02-usage/030_clients.md.

  3. No changes to CHANGELOG or other docs — Only 030_clients.md is modified (alongside the code changes).

  4. Added CodeBuddy-Code to the Terminal-Based Clients list — With a link to https://www.codebuddy.cn/cli/ in the "Other Clients" section.

The CI failures are pre-existing infrastructure issues unrelated to this PR:

  • macos-latest: clangd download timeout (github.com read timeout 60s)
  • windows-latest: unrelated test flake

All code-related checks pass (build, lint, CodeQL, spelling, analysis). The 3 code files changed (client_setup.py, hooks.py, codebuddy.yml) are identical to the previous passing CI runs.

This is ready for another review or merge. Thanks!

@MischaPanch

Copy link
Copy Markdown
Member

Thank you for addressing the comments, merging

@MischaPanch
MischaPanch merged commit 68a4af4 into oraios:main Jun 28, 2026
12 checks passed
@studyzy
studyzy deleted the feat/codebuddy-support branch June 29, 2026 01:24
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.

3 participants