Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Check real CLI credentials, MCP, stream parsing and native-tool restrictions
env:
AGENTFLOW_TEST_NATIVE_PROVIDERS: '1'
run: go test -p=2 ./internal/httpapi ./internal/runtime -run 'TestAssistantNativeProviderGateway|TestNativeProviderCustomGateway' -count=1 -v
run: go test -p=2 ./internal/httpapi ./internal/runtime -run 'TestAssistantNativeProviderGateway|TestNativeProviderCustomGateway|TestFeatureModelsWithoutCodeBuddy' -count=1 -v
- run: go vet ./...
- run: go run golang.org/x/vuln/cmd/govulncheck@v1.9.0 ./...
- run: python3 scripts/collect-go-notices.py
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache
COPY --from=chatbot /src/web/native-chat/ web/native-chat/
RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build GOOS=${TARGETOS} GOARCH=${TARGETARCH} bash scripts/build-binaries.sh --platform /out
FROM node:22-bookworm
ARG CODEBUDDY_PACKAGE=@tencent-ai/codebuddy-code@2.167.0
RUN --mount=type=cache,target=/root/.npm apt-get update && apt-get install -y --no-install-recommends ca-certificates git openssh-client bash curl python3 ripgrep \
&& rm -rf /var/lib/apt/lists/* \
&& npm install -g @openai/codex@0.162.1 @tencent-ai/codebuddy-code@2.167.0 @deepseek-ai/dsh@0.2.2-rc.1 @wecom/cli@1.3.4 \
&& wecom-cli --version
&& npm install -g @openai/codex@0.162.1 @deepseek-ai/dsh@0.2.2-rc.1 @wecom/cli@1.3.4 \
&& wecom-cli --version \
&& if [ -n "$CODEBUDDY_PACKAGE" ]; then npm install -g "$CODEBUDDY_PACKAGE"; fi
# A relocatable Python that sandboxes of images without python3 mount for the
# native CLI hooks (internal/runtime/toolchain.go). Its terminfo database has
# names differing only in case, which a case-insensitive data directory (macOS)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ New accounts join the **LoopForge demo project**, which includes an SOP made onl

<br>

- **Executors.** Pick one of ten CLIs beside the home composer, then a model. Every SOP role can choose its executor independently (built-in roles default to CodeBuddy). Requirement clarification, AI notification summaries, Bot replies and run evals currently use CodeBuddy, so their model pickers list CodeBuddy models only and the server refuses a model of another CLI instead of switching it to CodeBuddy; scheduled assistant tasks run on the CLI the task selects.
- **Executors.** Choose a CLI and model for chat, requirement clarification, Bot replies, notification reports, run evaluation, or static preview. Each SOP role can select its own CLI, and built-in templates still default to CodeBuddy. Scheduled prompts use the CLI selected on the schedule. The platform can run without a CodeBuddy installation or key once its workflows use other CLIs. [Deployment and upgrade](docs/deployment.md#choosing-an-executor)

| Executor | Credentials | Installation |
| --- | --- | --- |
| **CodeBuddy** | Personal key, or a shared key an administrator configures for chat and SOP runs | In the Docker image |
| **CodeBuddy** | Personal key, or a shared key an administrator configures for chat and SOP runs | Bundled by default, optional on source builds |
| **Codex** | Personal key; a connected execution machine can use its local login | In the Docker image |
| **Claude Code** | Personal key; a connected execution machine can use its local login | Installed from npm on first use, then cached |
| **OpenCode · Kimi Code · Pi** | Personal key only | Installed from npm on first use, then cached |
Expand Down
4 changes: 2 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ GitLab、Gitea、Gogs 等托管可[配置 Git SSH](docs/deployment.md#git-reposi

<br>

- **执行器。** 在首页输入框旁从 10 种 CLI 中选择一种,再选择模型。每个 SOP 角色都可以独立选择执行器(内置角色默认 CodeBuddy)。需求澄清、通知 AI 汇总、Bot 回复和运行评测目前使用 CodeBuddy,这些入口的模型列表只列 CodeBuddy 模型,服务端收到其他 CLI 的模型会直接拒绝并说明原因,不会悄悄换成 CodeBuddy;定时助手任务使用任务所选的执行器。
- **执行器。** 首页对话、需求澄清、Bot 回复、通知汇报、运行评测和静态预览均可选择 CLI 与模型。每个 SOP 角色可以独立选择 CLI,内置模板仍默认使用 CodeBuddy。定时提示词使用任务所选的 CLI。将使用中的流程配置为其他 CLI 后,平台可在未安装 CodeBuddy、未配置其 Key 的环境中运行。[部署与升级说明](docs/deployment.md#choosing-an-executor)

| 执行器 | 凭据 | 安装方式 |
| --- | --- | --- |
| **CodeBuddy** | 个人 Key,或管理员配置的平台共享 Key(覆盖对话和 SOP 运行) | Docker 镜像内置 |
| **CodeBuddy** | 个人 Key,或管理员配置的平台共享 Key(覆盖对话和 SOP 运行) | 默认内置,源码构建时可省略 |
| **Codex** | 个人 Key;已连接的执行机器可使用本机登录 | Docker 镜像内置 |
| **Claude Code** | 个人 Key;已连接的执行机器可使用本机登录 | 首次使用时从 npm 安装并缓存 |
| **OpenCode · Kimi Code · Pi** | 仅个人 Key | 首次使用时从 npm 安装并缓存 |
Expand Down
48 changes: 19 additions & 29 deletions chatbot/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import { reconcileOperation, visibleSidebarArtifact } from "./platform.js";
import { isGeneratedArtifact, shouldRevealArtifactPanel } from "./artifact-autoreveal.js";
import { IconButton, Dialog, Menu, SelectMenu, CredentialAction } from "./ui";
import { CLIInstallAction } from "./cli-install.jsx";
import { credentialHint, openCredentialSettings } from "./credentials";
import { openCredentialSettings } from "./credentials";
import { groupSessionHistory, scheduledSession, sessionProjectName } from "./session-history.js";
import { runSessionState, sessionReplyStatus, sessionTooltip, sidebarReplyStatus } from "./session-status.js";
import { unreadReply, useReadReplies } from "./session-unread.js";
Expand All @@ -77,7 +77,7 @@ import ModelPicker from "./ModelPicker";
import ModelProviderIcon, { hasProviderLogo } from "./ModelProviderIcon";
import PermissionPicker, { normalizeApprovalMode } from "./PermissionPicker";
import { useComposerOptions } from "./composer-preferences.js";
import { conversationEngine, engineBrand } from "./engines.js";
import { EXECUTORS, conversationEngine, engineBrand } from "./engines.js";
import { effortOptions } from "./effort.js";
import QuickAccessWizard from "./QuickAccessWizard";
import HarnessSelect from "./HarnessSelect";
Expand Down Expand Up @@ -391,7 +391,7 @@ export default function App() {
const approvalScope = chat.activeId
? chat.session?.id === chat.activeId && sessionApprovalScope(chat.session)
: draftApprovalScope(newDraftSlot, chat.projectId);
const approval = normalizeApprovalMode(approvalScope && readApproval(approvalScope).mode);
const approval = normalizeApprovalMode((approvalScope && readApproval(approvalScope).mode) || (!chat.activeId && chat.defaultApproval));
function setApproval(value) {
if (!approvalScope) return;
const mode = normalizeApprovalMode(value);
Expand Down Expand Up @@ -508,17 +508,20 @@ export default function App() {
"个人对话";
const sessionLoading = !!chat.activeId && chat.session?.id !== chat.activeId;
const composerLoading = sessionLoading || chat.replyStatePending;
const hasComposerExecutor = !!chat.executor || chat.local;
const needsExecutor = chat.ready && chat.user && !chat.user.isGuest && !chat.readOnly &&
!hasComposerExecutor && !composerLoading && (chat.machinesReady || chat.machineError);
const selectedModel = chat.models.find((m) => m.id === chat.model) || (!chat.local ? chat.modelDetails : null);
const modelLabel =
(selectedModel?.name || chat.model)?.replace(/^Claude-/, "").replace(/^GPT-/, "") || "模型";
(hasComposerExecutor && (selectedModel?.name || chat.model)?.replace(/^Claude-/, "").replace(/^GPT-/, "")) || "模型";
// The CLI switch is only for a conversation that has not started. A reply
// in flight, or one already saved, keeps that CLI; another CLI needs a new chat.
const lockedExecutorId = chat.session
? conversationEngine(chat.session.messages, chat.models, chat.session.executor) ||
(chat.busy ? chat.executor : "")
: "";
const pinnedExecutor = lockedExecutorId
? (chat.executors || []).find((item) => item.id === lockedExecutorId)
? EXECUTORS.find((item) => item.id === lockedExecutorId)
: undefined;
const projectOptions = projectPickerOptions(
chat.projects,
Expand Down Expand Up @@ -813,7 +816,7 @@ export default function App() {
closeMenu();
}
async function submit() {
if (uploading || composerLoading || draftReady.current !== draftKey ||
if (!hasComposerExecutor || uploading || composerLoading || draftReady.current !== draftKey ||
(!chat.activeId && savingDraftApproval.current)) return;
follow.current = true;
const snapshot = draftSnapshot({ text, attachments, references });
Expand Down Expand Up @@ -1885,29 +1888,15 @@ export default function App() {
</IconButton>
</div>
) : null}
{chat.ready &&
!chat.local &&
chat.user &&
!chat.user.isGuest &&
!chat.user.codeBuddyApiKeyConfigured &&
!chat.sponsoredModel &&
chat.executor === "codebuddy" &&
!chat.readOnly &&
credentialHint(chat.error)?.field !== "codeBuddyApiKey" ? (
{needsExecutor ? (
<div className="credential-notice" role="status">
<HarnessIcon name="key" size={15} aria-hidden="true" />
<span>
当前执行器 CodeBuddy 需要先配置 CodeBuddy API Key。
{chat.user.codexApiKeyConfigured ||
chat.user.claudeCodeApiKeyConfigured
? "你已配置 Codex / Claude Code Key,也可以在输入框下方把执行器切换过去。"
: ""}
</span>
<HarnessIcon name="terminal" size={16} aria-hidden="true" />
<span>添加一个执行器即可开始对话</span>
<button
type="button"
onClick={() => openCredentialSettings("codeBuddyApiKey")}
onClick={() => openCredentialSettings("executors")}
>
去配置
新增执行器
</button>
</div>
) : null}
Expand Down Expand Up @@ -2219,7 +2208,7 @@ export default function App() {
e.target.value = "";
}}
/>
{chat.executors.length > 1 && !pinnedExecutor && !chat.submitting ? (
{hasComposerExecutor && chat.executors.length > 0 && !pinnedExecutor && !chat.submitting ? (
<PermissionPicker
label="CLI"
disabled={composerLoading}
Expand All @@ -2242,8 +2231,8 @@ export default function App() {
/>
) : null}
<ModelPicker
models={chat.models}
disabled={composerLoading}
models={hasComposerExecutor ? chat.models : []}
disabled={composerLoading || !hasComposerExecutor}
value={chat.model}
label={modelLabel}
open={menu?.type === "model"}
Expand All @@ -2255,7 +2244,7 @@ export default function App() {
/>
<PermissionPicker
label="思考强度"
disabled={composerLoading}
disabled={composerLoading || !hasComposerExecutor}
options={effortOptions(selectedModel)}
value={chat.effort}
onSelect={chat.setEffort}
Expand Down Expand Up @@ -2293,6 +2282,7 @@ export default function App() {
title={chat.busy ? "当前回复结束后自动发送" : undefined}
disabled={
!chat.ready ||
!hasComposerExecutor ||
chat.submitting ||
chat.machineSaving ||
composerLoading ||
Expand Down
Loading
Loading