Repository navigation
feat(codebuddy): add native ACP sessions and private login - #525
Merged
Merged
Conversation
stamp-build
Bot
force-pushed
the
agent/otter/codebuddy-acp
branch
2 times, most recently
from
October 29, 2026 17:05
cadd80f to
4dc8c93
Compare
stamp-build
Bot
force-pushed
the
agent/otter/codebuddy-acp
branch
from
October 29, 2026 17:23
4dc8c93 to
9fe877e
Compare
Merged
stamp-build Bot
added a commit
that referenced
this pull request
Oct 29, 2026
<!-- stamp:review:v1 --> <sup><img src="https://api.raft.build/api/avatars/pixel/bXVn.svg" width="16" height="16" align="absmiddle" alt=""> <b>Cindy</b> from open-agent-runtime opened this pull request through Stamp</sup><br><sup><a href="https://stamp.build/review?receipt=prc_1ddbf6fe52e5c4f2350a317486748453"><picture><source media="(prefers-color-scheme: dark)" srcset="https://stamp.build/assets/brand/stamp-glyph-dark.d907ffcadb44.svg"><img src="https://stamp.build/assets/brand/stamp-glyph-light.58a2c10ed108.svg" width="13" height="12" align="absmiddle" alt=""></picture> View in Stamp →</a></sup> --- <!-- /stamp:review:v1 --> Minor release: CodeBuddy Code joins the built-in runtimes. ## Breaking changes ### Runtime set, brand keys and redaction rules (#525) - `defaultRuntimes` now includes `codebuddyRuntime` (id `codebuddy`). Code that assumes the previous set of runtime ids needs a case for it. - `runtimeBrands` gains `codebuddy`; because it is declared `as const`, an exhaustive `Record<keyof typeof runtimeBrands, ...>` must add the key. - `REDACTION_RULES.version` is now 2 and `frameTypePrefixes` adds `_codebuddy.ai/authUrl`. A host that pre-filters stored records by these prefixes, or caches redaction by version, should re-run redaction on stored records. Records OAR itself wrote are unaffected: earlier releases had no CodeBuddy, and live CodeBuddy frames are redacted before they are recorded. ## New ### CodeBuddy Code (#525) `codebuddyRuntime`, also at `@botiverse/oar/runtimes/codebuddy`. The root entry also exports `codebuddySession`, `codebuddyInstallation`, `codebuddyListModels` and `projectCodebuddyModels`; brand assets `codebuddy.svg`, `codebuddy-on-light.svg` and `codebuddy-on-dark.svg` are added. Install the vendor CLI separately; OAR finds `OAR_CODEBUDDY_BIN`, `codebuddy` on PATH or `~/.local/bin/codebuddy`. There is no OAR installer, updater, logout, account quota reader or provider facade for CodeBuddy. - **Sessions** use CodeBuddy's own ACP server (`codebuddy --acp`), one native process per session, with ACP new/load and the native session ID as the resume key. Messages queue in OAR (`queue.durable: false`) and can be withdrawn before dispatch. There is no `steer`: no native injection interface was verified. Sessions run with `--permission-mode bypassPermissions`, which is not a sandbox. - **Why ACP:** with a custom model endpoint, CodeBuddy's stream-json interface sent a prompt that followed the previous `result` immediately to the model twice, so any tool calls in it would repeat too. This happened in all three immediate runs and in 8 of 9 runs with 0.5 to 2 second provider response delays (the ninth timed out); a one-second delay before the second input did not duplicate. It was not reproduced on the official account backend in four immediate runs plus a one-second control. With the same custom endpoint, native ACP sent exactly one request per input in three immediate and three one-second-delay runs. Reported upstream as CodeBuddy issue 1847 on CNB. - **Login and status** use CodeBuddy's private stream-json control channel (`initialize`, `authenticate`): one browser authorization per login, the URL delivered as an `auth_url` event and never stored in records. `openBrowser: false` sets a login-only `BROWSER` (`true` on POSIX, `hostname.exe` on Windows). A native authentication failure maps to `cancelled`, or to `failed` with `timed_out` or `process_failed` by its native type; no explicit native denial signal was verified, so OAR does not report `rejected`. A native success contradicted by a fresh status read is `failed` / `not_logged_in`, and a throwing URL handler is `interaction_failed`. Status reads the native account (object, null or absent). With `CODEBUDDY_API_KEY` set, status is `unknown` with `configured: ["environment: CODEBUDDY_API_KEY"]`, because the native account can be synthesized from the key without validating it. - **Models and effort:** `listModels()` opens a disposable ACP session without a prompt. Opening applies the model through `session/set_config_option` but does not strictly confirm it; effort is checked against the native readback. - **System prompt** replacement through a private mode-0600 file, never argv; an empty replacement and appended prompts are refused. `disallowedTools`, MCP (stdio and HTTP, with credential overlays) and images are supported. - **Failures:** a successful prompt reply carrying `refusal` or a `FAILED*` native outcome is a failed turn, with the native message as its reason and the native error category taking precedence over HTTP status. - **Usage:** ACP `usage_update` describes context, not a billing ledger, so `usage().total` stays null. A native `used: 0, size: 0` is kept as reported and does not mean the context is empty. - **Refused options:** `goals: true`, `appendSystemPrompt`, `userConfiguration: "exclude"`, `outputSchema`, `name`, `serviceTier`, `additionalDirectories`; in `launchArgs`, transport, permission, session-identity and system-prompt flags and `--`. - **Verified:** CodeBuddy 2.178.1; the shared behavior suite and five native tests with a scripted provider in Linux and macOS CI; Linux x64 with a local provider; and Linux arm64 with a real international account (login, status, two immediate turns and a resumed third turn). Not verified: Windows, logout, renewal, the China region, and real-account login on other platforms. ### CLI (#525) `@botiverse/oar-cli` builds its registry from `defaultRuntimes`, so `oar list`, `installation`, `models`, `run` and `login` include `codebuddy`, commands without a runtime argument also probe it, and `oar mcp` offers it to subagents unless `--runtimes` narrows the set. ## Fixes - Qoder daemon protocol (1.1.81 and later): frames and input with `session_id: null` are treated as connection-wide instead of as another session's (#525). ## Docs - Runtime version checks for October 29: Antigravity 1.4.4, Kimi 2.4.0 (CI now installs it), OpenCode v2 2.2.1 and Qwen 0.26.4 (#532). - OpenCode 2.2.1 known limitation: concurrent first starts over a fresh data directory can fail with `table account_state already exists`; hosts can finish the first start before opening more sessions (#532). Tracked upstream in anomalyco/opencode#53879. Co-authored-by: Cindy <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
CodeBuddy Code becomes a built-in runtime using its native ACP session interface. Hosts can list models, open and resume native history, queue consecutive turns, cancel, replace the system prompt through a private file, deny tools, and attach credentialed stdio/HTTP MCP. Model setters apply the request without claiming strict readback; effort requires matching native readback. Login and local status use a separate private stream-json control process.
ACP passed immediate consecutive-input controls where the custom-endpoint stream-json reproduction duplicates work. Official-account stream-json controls did not reproduce the issue; the cause remains unknown. The adapter adds no delay workaround. Reproducers, sanitized login/ACP reports and the transport decision are retained in
experiments/codebuddy-native/2026-10-29anddocs/runtimes/codebuddy.md.Native
FAILED*outcomes preserve their reason and use native error categories before HTTP status. Login timeouts and cancellation remain distinct from sanitized process failures; genericauth_faileddoes not imply user denial. A non-empty environment API key reportsunknownwith a configured source label because native initialization can synthesize an account from an unvalidated key. Tokens, account identity and authorization URLs stay out of session records and errors; redaction rule version 2 also cleans stored CodeBuddy authorization notifications.Unsupported steer, logout, quota, child attribution and a billing-token ledger remain absent. Native context 0/0 is preserved without claiming an empty context; missing usage stays null. The earlier real-login report's 6,730/8 token counts came from its stream-json helper, not ACP. Linux/macOS native CI jobs are added; Windows native support remains unverified. A small Qoder follow-up preserves connection notifications whose
session_idis explicitly null.Validation: full
CI=1 pnpm run checkand both package builds; CodeBuddy 2.178.1 shared behavior (16 passes, three capability skips) and five native vendor regressions covering consecutive turns/history, native failure, private prompts/tool denial, MCP credentials/persistence, and resume in a different cwd. Focused tests cover authentication error classification and cleanup, account identity redaction, environment overlays, live/stored authorization redaction, and prompt-file modes/lifetime. International-account ACP verification on Linux arm64 already passed two immediate turns and a third after process restart with the same session ID. No credentials or account identifiers are included.Raft task #60.