feat(daemon): add Codebuddy Code CLI agent adapter#3961
Conversation
|
Hey @LikewindANDcloud! 👋 Thanks for putting this together — the adapter structure mirrors the established pattern cleanly, the test suite covers the important cases (session resume, Heads-up — related open PR: PR #2022 (by @whinc) is also open and targets the same area — both PRs add Codebuddy Code support by touching Related feature request: This addresses the ask in #1138. I've tagged 💡 To drive this PR to merge hands-free, paste this to your AI coding agent (Claude Code / Codex / opencode / Cursor …): |
mrcfps
left a comment
There was a problem hiding this comment.
@LikewindANDcloud Thanks for wiring Codebuddy into the runtime registry — the Claude-compatible adapter shape and coverage look solid overall. I found one merge-safe issue where the advertised reasoning control is implemented in buildArgs but not exposed end-to-end, so I left the concrete fix inline below.
|
@LikewindANDcloud — @mrcfps has left a review with one concrete item to address before merge: the |
mrcfps
left a comment
There was a problem hiding this comment.
@LikewindANDcloud Thanks for the follow-up pass — the new reasoningOptions declaration fixes the original sanitization gap, and I re-checked the updated Codebuddy adapter/test coverage on this head. I found one merge-safe follow-up around how the new effort list maps into the existing picker UX, so I left it inline below.
|
@LikewindANDcloud — @mrcfps confirmed the |
mrcfps
left a comment
There was a problem hiding this comment.
@LikewindANDcloud I re-checked the updated Codebuddy adapter end-to-end: the runtime is registered, executable override/install metadata are wired, and the new reasoning sentinel/tests cover the picker fallback so --effort round-trips without forcing a value by default. I also inspected the changed daemon/test ranges on this head and did not find any actionable correctness or maintainability issues. Thanks for the careful follow-up here 🚀
|
@LikewindANDcloud — @mrcfps has approved this head 🎉 Both review threads are resolved: |
|
Hey @LikewindANDcloud — quick update: CI just came back with two failures on the current head, so it's blocking merge even though @mrcfps's approval is in. 🔴 Failing checks: Worth opening the Preflight log first — it usually surfaces the root cause, and the Validate workspace failure often follows from the same issue. Once both are green, this is in the merge queue. |
mrcfps
left a comment
There was a problem hiding this comment.
@aleexjiang I re-checked the new Codebuddy adapter head across the changed daemon/test ranges: the runtime is registered, the CODEBUDDY_BIN override and install/docs metadata are wired, and the default reasoning sentinel keeps the picker/default-path behavior aligned with buildArgs so --effort only appears for real effort levels. I also reviewed the added Codebuddy-focused test coverage and did not find any actionable correctness, safety, or maintainability issues in the scoped diff. Thanks for iterating through the follow-ups cleanly 🚀
|
Hey @aleexjiang — new push landed and @mrcfps has already reviewed this head (APPROVED ✅). CI is still running; once that turns green, this is in the merge queue with nothing else blocking. Hang tight! |
Add Codebuddy Code (codebuddy/cbc) as a supported agent runtime. - New adapter def in runtimes/defs/codebuddy.ts based on the Claude Code adapter pattern (compatible stream-json format, stdin prompt, MCP injection via .mcp.json, session resume) - Supports --effort flag for reasoning level control (minimal..max) - 16 model options across GLM, Claude, GPT, Gemini, DeepSeek, Kimi, MiniMax providers - Registered in daemon agent registry - Added CODEBUDDY_BIN env var override in executables - Added install/docs URLs in metadata - Full test suite (19 tests) in codebuddy.test.ts All 274 runtime tests pass with 0 regressions.
…nd-trip The buildArgs handler accepted options.reasoning but the adapter never declared reasoningOptions, causing the daemon API sanitizer to drop the effort level before spawn and the web UI to hide reasoning controls. - Add reasoningOptions (default/minimal/low/medium/high/xhigh/max) to the adapter definition, matching the Codebuddy CLI --effort flag. - Add round-trip tests: valid reasoning survives sanitization and lands in argv; every declared option maps to a correct --effort flag. All 279 runtime tests pass (279 passed | 1 skipped).
The previous commit incorrectly included a "default" level in reasoningOptions. Codebuddy CLI --effort actually supports exactly 6 levels: minimal, low, medium, high, xhigh, max. Omitting --effort entirely is how you get the default behavior — there is no "--effort default" flag. - Remove "default" from reasoningOptions (was never a valid --effort value) - Update tests: list now matches [minimal, low, medium, high, xhigh, max] - Round-trip test no longer skips any declared option All 279 runtime tests pass.
The previous push removed the synthetic "default" entry, but the web
pickers (AvatarMenu / SettingsDialog) fall back to reasoningOptions[0]
when no value is saved yet. Without a default sentinel:
- The implicit selection became "minimal" instead of "let Codebuddy decide"
- Users had no way to clear back to omit-the-flag (the <select> had no
empty/default entry)
Restore "default" as the FIRST option and treat it as a sentinel in
buildArgs: any value !== "default" gets passed via --effort, while
"default" (and unset) means no --effort flag.
- Adapter: re-add { id: default, label: Default } at the head of the list
- Adapter: buildArgs guards with options.reasoning && options.reasoning !== "default"
- Tests: round-trip suite now covers both branches; new test asserts the
default sentinel does NOT emit --effort and that it is the first option.
281 runtime tests pass (was 279).
The Preflight CI step runs tsc -p tsconfig.tests.json --noEmit which
has stricter undefined narrowing than tsconfig.json. The expression
`codebuddyAgentDef.reasoningOptions![0].id` triggered TS2532
("Object is possibly undefined") because the non-null assertion only
covers the property access, not the array indexing result.
Split the chain into a local variable with an explicit toBeDefined()
assertion before the .id access. Same runtime semantics, no more
TS2532 in strict mode.
26 codebuddy tests still pass.
de906f4 to
7b3d277
Compare
🎉 📡 You just leveled up to Giotto
🙌 Your contributions send a clear signal across the network: you care about making Open Design better. 💛 Thanks for helping Open Design move forward. Keep building in the open. 🚀 📊 Rank #198 among 198 contributors. |
|
Hi @aleexjiang! Your first Open Design PR has been merged! Huge thanks for jumping in and improving the project! You contributed: Merged PR: #3961 feat(daemon): add Codebuddy Code CLI agent adapter Your first contribution added a new CLI agent adapter, so we picked follow-up issues that stay close to runtime and local-tooling behavior. For your next contribution, we picked two issues that look like a good follow-up:
This fits well because it stays in the local-agent/runtime surface and improves how local tooling details are presented.
This is a good follow-up if you want to keep working on the local runtime and artifact-management path. If one of these looks interesting, feel free to comment /claim on the issue and we will help you get started! Once your second PR gets merged, you will move into our Continuous Contributor tier. We are also starting to highlight repeat contributors more actively in the community, so this is a great time to keep going! Thanks again for the first PR, and welcome to the Open Design contributor community! The Open Design team P.S. We hang out in Discord — come say hi: https://discord.gg/3C6EWXbdQQ |
|
Hey @aleexjiang — huge thanks again for landing this. The Codebuddy adapter ended up nicely scoped: runtime registration, And the follow-up suggestions above are on-point: if you feel like staying in the same local-runtime lane, #2874 and #1772 are both good next areas to explore. Really appreciate the contribution 🙌 |
Why
Codebuddy Code (https://www.codebuddy.cn) is a coding agent CLI with a stream-json interface compatible with Claude Code. Adding it as an agent adapter lets Open Design users choose Codebuddy as their runtime — useful for teams already on the Codebuddy platform or who want access to its multi-provider model roster (GLM, Claude, GPT, Gemini, DeepSeek, Kimi, MiniMax).
What users will see
codebuddy -pwith stream-json I/O, just like Claude Code--effortflag is supported for reasoning level control (minimal / low / medium / high / xhigh / max)Surface area
CODEBUDDY_BINenv var for overriding thecodebuddybinary pathValidation
pnpm -F @open-design/daemon test— 21 test files, 274 tests passed, 0 regressionstsc -p tsconfig.json --noEmit— 0 errorspnpm tools-dev start— Codebuddy Code shows as available agent withversion: 2.103.1,available: truecurl http://127.0.0.1:7456/api/agentsreturns the codebuddy entry with correct streamFormat, models, and path detection