feat: add CodeBuddy CLI harness adapter - #110
Open
aleexjiang wants to merge 2 commits into
Open
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
aleexjiang
force-pushed
the
feat/codebuddy-harness-adapter
branch
from
September 1, 2026 13:08
4cac20b to
7e87b00
Compare
Integrate the Tencent CodeBuddy CLI as a new external Harness so its Agent can run as a native Thread inside Codex Desktop, alongside Pi, Claude Code, DeepSeek Harness, OpenCode, Grok, and OMP. The adapter drives the CodeBuddy CLI over its bidirectional stream-json print transport (`-p --output-format stream-json --input-format stream-json --include-partial-messages`) and reuses the same process across Turns: - create / resume Sessions (fork and rollback reported as unsupported) - streaming text and reasoning deltas via stream_event projections - tool call / result projection into commandExecution and toolExecution items - Permission Mode selection at Session creation; unattended full-access delegation maps to bypassPermissions - Model Catalog parsed from `codebuddy --help` with a static fallback - Usage (tokens, context window, total cost) from the terminal result frame, plus transcript-based history snapshots under ~/.codebuddy/projects Registration wiring covers model routing, adapter composition, host-runtime metadata, root tsconfig references, and the full renderer surface (agent selection state, binding probe, transport model codec, icons, picker, sidebar, connections page). Interactive approvals/questions, mid-session model switching, thinking options, fork, and rollback are explicitly not supported in this first iteration and are reported as such instead of being silently degraded.
aleexjiang
force-pushed
the
feat/codebuddy-harness-adapter
branch
from
September 1, 2026 13:13
7e87b00 to
9291f0f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Integrates the Tencent CodeBuddy CLI as a new external Harness, so its Agent runs as a native Thread inside Codex Desktop — alongside Pi, Claude Code, DeepSeek Harness, OpenCode, Grok, and OMP.
The adapter follows the repo
s native-interface integration approach (see.agents/skills/codexhost-add-harness): it drives the CodeBuddy CLI over its **bidirectional stream-json print transport** (-p --output-format stream-json --input-format stream-json --include-partial-messages`) and keeps one CLI process alive across Turns, projecting frames into the standard HarnessAdapter contract.What is supported
--resume <sessionId>(fork and rollback are reported as unsupported)stream_eventframes, with an assistant-text fallback for CLI builds that skip deltastool_use/tool_resultprojected intocommandExecution/toolExecutionitems (Bash/PowerShell mapped to command execution)--permission-mode;unattended-full-accessdelegation maps tobypassPermissionscodebuddy --help, filtered to transport-safe Model Ref IDs, with a static fallback catalogresultframe~/.codebuddy/projects/<slug>/<sessionId>.jsonl(with project-slug scan fallback); Native Turn Refs keyed by persisted user-message ids--resumeExplicitly not supported (reported, never silently degraded)
Wiring
packages/adapters/codebuddy— new adapter package (transport, accumulator, usage, history, discovery, model catalog, session/adapter)protocol-core—codebuddyadded toEXTERNAL_HARNESS_IDS, transport Model codec (codexhost/codebuddy-native, encodes model + permission mode)host-runtime— adapter registration,CODEXHOST_CODEBUDDY_COMMANDoverride, approval-server naming, package metadatarenderer-extension— agent selection state, binding probe, transport model codec, icon/labels, picker, sidebar, connections pageTesting
npx tsc -b— clean (alsotsc -p tests/tsconfig.json --noEmit)vitest run— 185 files / 1595 tests passing, including 40 new tests covering frame parsing, turn projection, usage mapping, transcript history, and the full create → turn → stream → complete / cancel / crash lifecycle against a fake child processeslint/prettier --check— clean for all touched filesNote: two pre-existing eslint errors exist in
packages/adapters/opencode/src/opencode-adapter.ts(non-null assertions at lines 1726/1736) on the untouchedmaincode; left as-is to keep this PR focused.