Skip to content

An open-source, faster Devin alternative

TypeScript

fix: read public Slack channel responses

Mohamed Habibfdd0298396cb
diff --git a/cli/package-lock.json b/cli/package-lock.json
index 3f42eca1..2b89444e 100644
--- a/cli/package-lock.json
+++ b/cli/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@opencomputer/cli",
- "version": "0.3.8",
+ "version": "0.3.9",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@opencomputer/cli",
- "version": "0.3.8",
+ "version": "0.3.9",
"dependencies": {
"@opencode-ai/sdk": "1.18.4",
"@opentui/core": "^0.4.5",
diff --git a/cli/package.json b/cli/package.json
index 83cbfe0a..4228225e 100644
--- a/cli/package.json
+++ b/cli/package.json
@@ -1,6 +1,6 @@
{
"name": "@opencomputer/cli",
- "version": "0.3.8",
+ "version": "0.3.9",
"description": "Build, test, connect, deploy, and share OpenComputer agents as code.",
"type": "module",
"bin": {
diff --git a/cli/src/api.test.ts b/cli/src/api.test.ts
new file mode 100644
index 00000000..6efae045
--- /dev/null
+++ b/cli/src/api.test.ts
@@ -0,0 +1,43 @@
+import assert from "node:assert/strict";
+import test from "node:test";
+import { OpenComputerClient } from "./api.js";
+
+test("reads channels from the public managed-agents response", async () => {
+ const originalFetch = globalThis.fetch;
+ globalThis.fetch = async () =>
+ Response.json({
+ channels: [
+ {
+ id: "channel-1",
+ channel: "slack",
+ agentId: "agent-1",
+ alias: "production",
+ teamName: "OpenComputer",
+ status: "connected",
+ createdAt: "2026-08-01T00:00:00.000Z",
+ updatedAt: "2026-08-01T00:00:00.000Z",
+ },
+ ],
+ });
+
+ try {
+ const client = new OpenComputerClient({
+ apiUrl: "https://app.opencomputer.dev",
+ apiKey: "osb_test",
+ });
+ assert.deepEqual(await client.channelConnections(), [
+ {
+ id: "channel-1",
+ channel: "slack",
+ agentId: "agent-1",
+ alias: "production",
+ teamName: "OpenComputer",
+ status: "connected",
+ createdAt: "2026-08-01T00:00:00.000Z",
+ updatedAt: "2026-08-01T00:00:00.000Z",
+ },
+ ]);
+ } finally {
+ globalThis.fetch = originalFetch;
+ }
+});
diff --git a/cli/src/api.ts b/cli/src/api.ts
index b64154ed..1feaf09a 100644
--- a/cli/src/api.ts
+++ b/cli/src/api.ts
@@ -291,9 +291,10 @@ export class OpenComputerClient {
async channelConnections(): Promise<ManagedSlackConnection[]> {
const result = await this.request<{
- connections: ManagedSlackConnection[];
+ channels?: ManagedSlackConnection[];
+ connections?: ManagedSlackConnection[];
}>("/api/managed-agents/channels");
- return result.connections;
+ return result.channels ?? result.connections ?? [];
}
completeSlackConnection(connectionId: string, botToken: string) {
diff --git a/cli/src/index.ts b/cli/src/index.ts
index d057b26c..c809f158 100644
--- a/cli/src/index.ts
+++ b/cli/src/index.ts
@@ -2,7 +2,7 @@
import { runCommand, type GlobalOptions } from "./commands.js";
-const VERSION = "0.3.8";
+const VERSION = "0.3.9";
const BANNER = String.raw` ____ ______ __
/ __ \____ ___ ____ / ____/___ ____ ___ ____ __ / /____ _____