Repository navigation
Offer Claude Code in the bot editor (#196) - #312
Merged
Merged
Conversation
The provider list offers Claude Code when the CLI is found. A CLI bot gets a
free model field, the two access levels and the CLI's status from
GET /providers/cli/{id}: where it is, its version and whether
`claude auth status` reports a login, or why it can't run.
regnull
reviewed
Nov 3, 2026
regnull
left a comment
Owner
There was a problem hiding this comment.
LGTM. Risk 3. CI is green (backend and frontend) and the merge state is CLEAN at 91c7f9b.
Musts: none.
External-author checks
- No new dependencies. No CI or workflow changes. No secrets touched.
- The new
GET /providers/cli/{provider}is the only thing that runs a process. It only accepts providers inADAPTERS(404 otherwise). The executable comes fromfind_executable(adapter, settings), never from the request. It runs only main's existing version andauth statusargv, underchild_env(), which strips OpenBot's private env such as provider keys. Only the exit code is returned from the login check, not its output. - The model string is still validated by main's
settings_error(_MODELregex) on save and before each run. withCoderenders backtick spans as React<code>elements, with nodangerouslySetInnerHTML.
Shoulds
BotEditorPage.tsx: when a bot switches to a CLI provider, the Tools, Skills and MCP sections are hidden, buttool_namesandskill_namesstay in the form and get saved. Clear them, or say they're kept, so they don't silently come back when the bot switches away.BotEditorPage.tsxstatus hint: ifversionis null (an adapter with no minimum version), it shows "… null at /path". Not reachable for Claude Code today.
Verified
- I tested on a local merge of this PR with main and #313; it had no conflicts.
uv run pytest tests/test_cli_agents.pypassed 49/49, andruff check .is clean.- vitest on BotEditorPage, SettingsPage and toolGroups passed 16/16 (under Node 22, since jsdom needs it).
tsc -bis clean.
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.
Part of #196, after #285: the editor side for CLI bots.
GET /providersgets acli_agentsfield for that, a file lookup only; the existingproviderslist stays as it is, since Settings shows a key badge for each entry. A bot already on Claude Code keeps the option, marked "not found", when the CLI is gone.GET /providers/cli/{id}runs the CLI once for the editor: where it is, its version and whetherclaude auth statusreports a login (its exit code; the output is not passed on), or why it can't run (not found, too old, not logged in). The editor shows that under the provider and refetches it on focus, so a login in a terminal shows up when you come back.sonnet,opusandhaikuas suggestions; empty uses the CLI's default.I left the setup wizard alone: it sets up the chat provider that thread titles and memory need even for a CLI bot, and a CLI doesn't replace that.
Testing
claude(found or not without running it, status with and without login, missing and too old).ruff checkpasses; the full suite passes on Windows 11 (Python 3.13).typecheck,lintandtestpass, exceptelectron/main.test.ts, which needsbashon PATH.claude auth statusstill reported the expired OAuth login as logged in until the first failed run, so the editor's login state is only as good as what the CLI says.