Skip to content

Commit 8398a04

Browse files
committed
optional chaining the parts
1 parent 1018c23 commit 8398a04

3 files changed

Lines changed: 13 additions & 12 deletions

File tree

agents/claude-code.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type {
1212
const sessionCache = new Map<string, string>();
1313

1414
export const models: string[] = [
15-
// "claude-sonnet-4-5",
15+
"claude-sonnet-4-5",
1616
// "claude-sonnet-4",
1717
// "claude-opus-4-1",
1818
// "claude-3-5-haiku",

agents/codex.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ const codexClient = new Codex();
2222
const threadCache = new Map<string, Thread>();
2323

2424
export const models: string[] = [
25-
// "gpt-5-codex",
26-
// "gpt-5.1-codex",
25+
"gpt-5-codex",
26+
"gpt-5.1-codex",
2727
// "gpt-5",
2828
// "o3",
2929
// "o4-mini"

agents/opencode.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ const opencode = await createOpencode({
5454
const sessionCache = new Map<string, string>();
5555

5656
export const models: string[] = [
57-
// "opencode/gpt-5-codex",
58-
// "opencode/gpt-5.1-codex",
59-
// "opencode/claude-sonnet-4-5",
60-
// "opencode/glm-4.6",
61-
// "opencode/gemini-3-pro",
62-
// "opencode/qwen3-coder",
57+
"opencode/gpt-5-codex",
58+
"opencode/gpt-5.1-codex",
59+
"opencode/claude-sonnet-4-5",
60+
"opencode/glm-4.6",
61+
"opencode/gemini-3-pro",
62+
"opencode/qwen3-coder",
6363
"opencode/kimi-k2",
64-
// "opencode/grok-code",
64+
"opencode/grok-code",
6565
];
6666

6767
function formatCommand(command: string, args: string[]): string {
@@ -199,12 +199,13 @@ const opencodeAgent: AgentDefinition = {
199199
actions.push(JSON.stringify(info));
200200
}
201201

202-
data.parts.forEach((part) => actions.push(JSON.stringify(part)));
202+
const parts = Array.isArray(data.parts) ? data.parts : [];
203+
parts.forEach((part) => actions.push(JSON.stringify(part)));
203204

204205
if (info) {
205206
logJson({ info }, options);
206207
}
207-
data.parts.forEach((part) => logJson(part, options));
208+
parts.forEach((part) => logJson(part, options));
208209
} catch (error) {
209210
console.error(
210211
`[opencode] Error in ${model}:`,

0 commit comments

Comments
 (0)