From f6c766c06754bc67b3c5152985b70a3a8ed42413 Mon Sep 17 00:00:00 2001 From: LIU9293 Date: Wed, 11 Mar 2026 11:13:44 +0000 Subject: [PATCH] fix: simplify codex Slack channel settings --- package.json | 2 +- packages/agents/codex/client.ts | 2 +- packages/agents/test/cli-command.test.ts | 12 ++++++++++++ packages/core/runtime/message-options.ts | 4 ++-- packages/ims/shared/settings-domain.ts | 4 ++-- packages/ims/slack/commands.ts | 5 ++++- 6 files changed, 22 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 8dcbeb72..d906cb63 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ode", - "version": "0.1.19", + "version": "0.1.20", "description": "Coding anywhere with your coding agents connected", "module": "packages/core/index.ts", "type": "module", diff --git a/packages/agents/codex/client.ts b/packages/agents/codex/client.ts index bccfd754..2dd033f9 100644 --- a/packages/agents/codex/client.ts +++ b/packages/agents/codex/client.ts @@ -40,7 +40,7 @@ type CodexJsonEvent = { function getCodexModel(options?: OpenCodeOptions): string | undefined { const configured = options?.model?.modelID?.trim(); if (configured) return configured; - return DEFAULT_CODEX_MODEL; + return undefined; } type CodexModelCatalog = { diff --git a/packages/agents/test/cli-command.test.ts b/packages/agents/test/cli-command.test.ts index 309b68a8..cd5f32b6 100644 --- a/packages/agents/test/cli-command.test.ts +++ b/packages/agents/test/cli-command.test.ts @@ -139,6 +139,18 @@ describe("agent cli command formatting", () => { expect(command).toContain("'plan this change'"); }); + it("omits the Codex model flag when no model is configured", () => { + const args = buildCodexCommandArgs({ + sessionId: "session-3", + prompt: "hello from codex", + }); + const command = buildCodexCommand(args); + + expect(command).not.toContain("--model"); + expect(command).toContain("session-3"); + expect(command).toContain("'hello from codex'"); + }); + it("builds the Kimi print command", () => { const args = buildKimiCommandArgs({ sessionId: "session-4", diff --git a/packages/core/runtime/message-options.ts b/packages/core/runtime/message-options.ts index ada0f870..8143460d 100644 --- a/packages/core/runtime/message-options.ts +++ b/packages/core/runtime/message-options.ts @@ -1,4 +1,4 @@ -import { DEFAULT_CODEX_MODEL, getChannelModel } from "@/config"; +import { getChannelModel } from "@/config"; import type { OpenCodeOptions } from "@/agents"; type ProviderId = "opencode" | "claudecode" | "codex" | "kimi" | "kiro" | "kilo" | "qwen" | "goose" | "gemini"; @@ -24,7 +24,7 @@ export function buildMessageOptions(params: { const channelModel = getChannelModel(channelId)?.trim(); const codexModel = providerId === "codex" - ? (channelModel && channelModel.length > 0 ? channelModel : DEFAULT_CODEX_MODEL) + ? (channelModel && channelModel.length > 0 ? channelModel : undefined) : undefined; const kiloModel = providerId === "kilo" ? toKiloModel(channelModel) : undefined; diff --git a/packages/ims/shared/settings-domain.ts b/packages/ims/shared/settings-domain.ts index a898f3ee..7222667c 100644 --- a/packages/ims/shared/settings-domain.ts +++ b/packages/ims/shared/settings-domain.ts @@ -66,9 +66,9 @@ export function describeChannelSettingsIssues(channelId: string): string[] { ? lists.codex : lists.kilo; const modelSet = new Set(models.map(normalizeModel)); - if (!model) { + if (!model && provider !== "codex") { issues.push("Model not configured."); - } else if (!modelSet.has(normalizeModel(model))) { + } else if (model && !modelSet.has(normalizeModel(model))) { issues.push(`Model not available in configured ${getAgentProviderLabel(provider)} models.`); } } diff --git a/packages/ims/slack/commands.ts b/packages/ims/slack/commands.ts index 42405c25..249c6f46 100644 --- a/packages/ims/slack/commands.ts +++ b/packages/ims/slack/commands.ts @@ -291,7 +291,6 @@ function buildSettingsModal(params: { blocks.push({ type: "input" as const, block_id: WORKING_DIR_BLOCK, - optional: true, label: { type: "plain_text" as const, text: "Working Directory" }, element: { type: "plain_text_input" as const, @@ -700,6 +699,10 @@ export function setupInteractiveHandlers(): void { } } + if (!workingDirectory.trim()) { + errors[WORKING_DIR_BLOCK] = "Enter a working directory."; + } + if (Object.keys(errors).length > 0) { await ack({ response_action: "errors", errors }); return;