Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

MUL-8215: fix(runtimes): show Qoder Cloud Agents without encryption setup

Shi Peipeif4250e4298fd
diff --git a/.env.example b/.env.example
index 8676616f6a..5ed6674f2a 100644
--- a/.env.example
+++ b/.env.example
@@ -726,6 +726,6 @@ ANALYTICS_ENVIRONMENT=
# Force the no-op client even when POSTHOG_API_KEY is set (CI / opt-out).
ANALYTICS_DISABLED=
-# Server-managed QCA (Qoder Cloud Agents) runtimes are available whenever
-# MULTICA_VCS_SECRET_KEY is set: it encrypts the saved Qoder and GitHub tokens
+# Server-managed QCA (Qoder Cloud Agents) connections require
+# MULTICA_VCS_SECRET_KEY: it encrypts the saved Qoder and GitHub tokens
# and the run journal in the database. Keep it stable across restarts.
diff --git a/packages/views/agents/create/choose-runtime-page.tsx b/packages/views/agents/create/choose-runtime-page.tsx
index b45169b3d7..94060651b4 100644
--- a/packages/views/agents/create/choose-runtime-page.tsx
+++ b/packages/views/agents/create/choose-runtime-page.tsx
@@ -88,7 +88,7 @@ export function ChooseRuntimePage({
const ownerName = (ownerId: string | null) =>
members.find((m) => m.user_id === ownerId)?.name ?? null;
- const qoder = qoderConnection?.available ? qoderConnection : null;
+ const qoder = qoderConnection ?? null;
const qoderRuntime = groups.qoderRuntime;
const qoderState = qoder
? qoderChoiceState(qoder, qoderRuntime?.status === "online")
diff --git a/packages/views/agents/create/runtime-choice-list.test.tsx b/packages/views/agents/create/runtime-choice-list.test.tsx
index 8fa1c17947..9acb76a5a4 100644
--- a/packages/views/agents/create/runtime-choice-list.test.tsx
+++ b/packages/views/agents/create/runtime-choice-list.test.tsx
@@ -169,6 +169,17 @@ describe("RuntimeChoiceList", () => {
expect(screen.getByText("Ask an admin to connect")).toBeInTheDocument();
});
+ it("keeps Qoder discoverable but unselectable without server encryption setup", () => {
+ const qoder = { ...unconnectedQoder, available: false };
+ const props = mount({ qoder, qoderState: qoderChoiceState(qoder, false) });
+ expect(screen.getByText("Qoder Cloud Agents")).toBeInTheDocument();
+ fireEvent.click(screen.getByRole("button", { name: "Connect" }));
+ expect(props.onConnectQoder).toHaveBeenCalledOnce();
+ expect(props.onSelectQoder).not.toHaveBeenCalled();
+ expect(qoderChoiceState({ ...qoder, configured: true, enabled: true, status: "online" }, true))
+ .toBe("not_configured");
+ });
+
it("says so when nothing matches the search", () => {
mount({ query: "zzz" });
expect(screen.getByText("Nothing matches “zzz”")).toBeInTheDocument();
diff --git a/packages/views/agents/create/runtime-choice-list.tsx b/packages/views/agents/create/runtime-choice-list.tsx
index d8eb76d3d4..26a9befaf9 100644
--- a/packages/views/agents/create/runtime-choice-list.tsx
+++ b/packages/views/agents/create/runtime-choice-list.tsx
@@ -41,7 +41,7 @@ export function qoderChoiceState(
connection: QoderConnection,
runtimeOnline: boolean,
): QoderChoiceState {
- if (!connection.configured) return "not_configured";
+ if (!connection.available || !connection.configured) return "not_configured";
if (!connection.enabled) return "stopped";
if (connection.status === "error") return "error";
return runtimeOnline && connection.status === "online" ? "ready" : "starting";
diff --git a/packages/views/runtimes/components/qoder-configuration.test.tsx b/packages/views/runtimes/components/qoder-configuration.test.tsx
index 2da91f2671..82f99e058a 100644
--- a/packages/views/runtimes/components/qoder-configuration.test.tsx
+++ b/packages/views/runtimes/components/qoder-configuration.test.tsx
@@ -68,6 +68,16 @@ function mount(onConnected?: () => void) {
);
return client;
}
+it("explains missing server encryption setup without offering credential submission", async () => {
+ mocks.getQoderConnection.mockResolvedValue({ available: false, configured: false });
+ const client = mount();
+ expect(
+ await screen.findByText("Server setup is required: configure MULTICA_VCS_SECRET_KEY."),
+ ).toBeInTheDocument();
+ expect(screen.queryByPlaceholderText("pt-…")).not.toBeInTheDocument();
+ expect(mocks.saveQoderConnection).not.toHaveBeenCalled();
+ client.clear();
+});
it("points an existing connection to its runtime page", async () => {
const client = mount();
expect(
diff --git a/packages/views/runtimes/components/runtimes-page.test.tsx b/packages/views/runtimes/components/runtimes-page.test.tsx
index 2de1c6aac9..e2f87ba5fd 100644
--- a/packages/views/runtimes/components/runtimes-page.test.tsx
+++ b/packages/views/runtimes/components/runtimes-page.test.tsx
@@ -215,10 +215,10 @@ describe("RuntimesPage", () => {
});
expect(screen.getByText("dev-machine.local")).toBeInTheDocument();
expect(screen.queryAllByText("Qoder Cloud Agents")).toHaveLength(
- connection.available ? 1 : 0,
+ 1,
);
expect(screen.getByRole("button", { name: /^All/ })).toHaveTextContent(
- connection.available ? "2" : "1",
+ connection.configured ? "2" : "1",
);
unmount();
}
diff --git a/packages/views/runtimes/components/runtimes-page.tsx b/packages/views/runtimes/components/runtimes-page.tsx
index b8fca630ec..de324cde91 100644
--- a/packages/views/runtimes/components/runtimes-page.tsx
+++ b/packages/views/runtimes/components/runtimes-page.tsx
@@ -238,7 +238,7 @@ export function RuntimesPage({
}
const isDesktop = hasLocalMachine === true;
- const qoder = qoderConnection?.available === true ? qoderConnection : null;
+ const qoder = qoderConnection ?? null;
const qoderHref = paths.runtimeDetail(QODER_RUNTIME_LOCATOR);
// Qoder's runtime registers like a machine, but it is listed once, as a
// cloud service — never as a machine, even when this server cannot run
diff --git a/server/cmd/qoder-runtime/README.md b/server/cmd/qoder-runtime/README.md
index 802dc1e03f..fa7a571be3 100644
--- a/server/cmd/qoder-runtime/README.md
+++ b/server/cmd/qoder-runtime/README.md
@@ -189,7 +189,7 @@ Multica agent linked to an existing QCA Agent and uses the configured environmen
Workspace administrators can open **Runtimes → Add → Cloud services → Qoder Cloud Agents** to configure one
managed QCA connection per workspace, load environments from the PAT and check environment access, bind GitHub
repository tokens, and **Connect**. The Qoder Cloud Agents page can later **Pause** an idle runtime, resume it, or
-**Disconnect** it. The menu entry only appears when the server has `MULTICA_VCS_SECRET_KEY` set. The existing project
+**Disconnect** it. The menu entry remains visible without `MULTICA_VCS_SECRET_KEY`; opening it shows the required server setup instead of a connection form. The existing project
resource picker selects the repository and starting branch. The managed form
offers Qoder's official regions, `https://api.qoder.com/api/v1/cloud` (Global) and
`https://api.qoder.com.cn/api/v1/cloud` (China); a PAT works only in the region