fix: update model references from gpt-4o to gpt-5.2 in README and tests

This commit is contained in:
2026-03-20 10:17:11 +05:30
parent 5a56ed421d
commit d03e14178b
3 changed files with 35 additions and 35 deletions
+8 -8
View File
@@ -21,11 +21,11 @@ Add to your OpenCode config (`opencode.json`):
```bash ```bash
# Using bunx (no install) # Using bunx (no install)
bunx @username/opencode-multi-model open my-session -m openai/gpt-4o anthropic/claude-3-5-sonnet bunx @username/opencode-multi-model open my-session -m openai/gpt-5.2 anthropic/claude-3-5-sonnet
# Or install globally # Or install globally
bun install -g @username/opencode-multi-model bun install -g @username/opencode-multi-model
opencode-multi-model open my-session -m openai/gpt-4o opencode-multi-model open my-session -m openai/gpt-5.2
``` ```
### As Project Tool ### As Project Tool
@@ -54,7 +54,7 @@ export { openTool as open, closeTool as close }
**Open a session:** **Open a session:**
``` ```
Use multi-model-open tool: Use multi-model-open tool:
sessionName: my-session, models: ["openai/gpt-4o", "anthropic/claude-3-5-sonnet"] sessionName: my-session, models: ["openai/gpt-5.2", "anthropic/claude-3-5-sonnet"]
``` ```
**Close a session (using tool):** **Close a session (using tool):**
@@ -72,14 +72,14 @@ tmux kill-session -t my-session && rm -rf ~/.local/share/opencode/multi-model/my
**Open a session:** **Open a session:**
```bash ```bash
# Basic usage # Basic usage
opencode-multi-model open my-session -m openai/gpt-4o anthropic/claude-3-5-sonnet opencode-multi-model open my-session -m openai/gpt-5.2 anthropic/claude-3-5-sonnet
# With custom binary (via flag) # With custom binary (via flag)
opencode-multi-model open my-session -m openai/gpt-4o -b kilo opencode-multi-model open my-session -m openai/gpt-5.2 -b kilo
# With custom binary (via env) # With custom binary (via env)
export OPENCODE_MULTI_MODEL_BINARY=kilo export OPENCODE_MULTI_MODEL_BINARY=kilo
opencode-multi-model open my-session -m openai/gpt-4o opencode-multi-model open my-session -m openai/gpt-5.2
``` ```
**Close a session (CLI command):** **Close a session (CLI command):**
@@ -113,7 +113,7 @@ export OPENCODE_MULTI_MODEL_BINARY=kilo
**Via CLI flag:** **Via CLI flag:**
```bash ```bash
opencode-multi-model open my-session -m openai/gpt-4o -b kilo opencode-multi-model open my-session -m openai/gpt-5.2 -b kilo
``` ```
Priority: CLI flag > Environment variable > Default ("opencode") Priority: CLI flag > Environment variable > Default ("opencode")
@@ -140,7 +140,7 @@ bun run build
bun test bun test
# Test CLI locally # Test CLI locally
bun dist/cli.js open test-session -m openai/gpt-4o bun dist/cli.js open test-session -m openai/gpt-5.2
bun dist/cli.js close test-session bun dist/cli.js close test-session
``` ```
+1 -1
View File
@@ -26,7 +26,7 @@ import {
* ```ts * ```ts
* const result = await launchMultiModel({ * const result = await launchMultiModel({
* sessionName: "compare", * sessionName: "compare",
* models: ["openai/gpt-4o", "anthropic/claude-3-5-sonnet"], * models: ["openai/gpt-5.2", "anthropic/claude-3-5-sonnet"],
* binaryName: "opencode", * binaryName: "opencode",
* }); * });
* if (result.success) { * if (result.success) {
+26 -26
View File
@@ -68,7 +68,7 @@ describe("multi-model launch", () => {
"git rev-parse --is-inside-work-tree": { ok: true, stdout: "true", stderr: "" }, "git rev-parse --is-inside-work-tree": { ok: true, stdout: "true", stderr: "" },
"command -v tmux": { ok: true, stdout: "/usr/bin/tmux", stderr: "" }, "command -v tmux": { ok: true, stdout: "/usr/bin/tmux", stderr: "" },
"command -v opencode": { ok: true, stdout: "/usr/bin/opencode", stderr: "" }, "command -v opencode": { ok: true, stdout: "/usr/bin/opencode", stderr: "" },
"opencode models": { ok: true, stdout: "openai/gpt-4o\nanthropic/claude-3-5-sonnet", stderr: "" }, "opencode models": { ok: true, stdout: "openai/gpt-5.2\nanthropic/claude-3-5-sonnet", stderr: "" },
"tmux has-session -t test-session": { ok: false, stdout: "", stderr: "session not found" }, "tmux has-session -t test-session": { ok: false, stdout: "", stderr: "session not found" },
"git show-ref --verify --quiet refs/heads/opencode/test-session/gpt-4o": { ok: false, stdout: "", stderr: "" }, "git show-ref --verify --quiet refs/heads/opencode/test-session/gpt-4o": { ok: false, stdout: "", stderr: "" },
}; };
@@ -81,7 +81,7 @@ describe("multi-model launch", () => {
test("fails if session name is empty", async () => { test("fails if session name is empty", async () => {
const result = await launchMultiModel({ const result = await launchMultiModel({
sessionName: "", sessionName: "",
models: ["openai/gpt-4o"], models: ["openai/gpt-5.2"],
}); });
expect(result.success).toBe(false); expect(result.success).toBe(false);
@@ -103,7 +103,7 @@ describe("multi-model launch", () => {
test("fails if duplicate models are provided", async () => { test("fails if duplicate models are provided", async () => {
const result = await launchMultiModel({ const result = await launchMultiModel({
sessionName: "test-session", sessionName: "test-session",
models: ["openai/gpt-4o", "openai/gpt-4o"], models: ["openai/gpt-5.2", "openai/gpt-5.2"],
}); });
expect(result.success).toBe(false); expect(result.success).toBe(false);
@@ -116,7 +116,7 @@ describe("multi-model launch", () => {
const result = await launchMultiModel({ const result = await launchMultiModel({
sessionName: "test-session", sessionName: "test-session",
models: ["openai/gpt-4o"], models: ["openai/gpt-5.2"],
}); });
expect(result.success).toBe(false); expect(result.success).toBe(false);
@@ -129,7 +129,7 @@ describe("multi-model launch", () => {
const result = await launchMultiModel({ const result = await launchMultiModel({
sessionName: "test-session", sessionName: "test-session",
models: ["openai/gpt-4o"], models: ["openai/gpt-5.2"],
}); });
expect(result.success).toBe(false); expect(result.success).toBe(false);
@@ -145,7 +145,7 @@ describe("multi-model launch", () => {
const result = await launchMultiModel({ const result = await launchMultiModel({
sessionName: "test-session", sessionName: "test-session",
models: ["openai/gpt-4o"], models: ["openai/gpt-5.2"],
}); });
expect(result.success).toBe(false); expect(result.success).toBe(false);
@@ -178,7 +178,7 @@ describe("multi-model launch", () => {
const result = await launchMultiModel({ const result = await launchMultiModel({
sessionName: "test-session", sessionName: "test-session",
models: ["openai/gpt-4o"], models: ["openai/gpt-5.2"],
}); });
expect(result.success).toBe(false); expect(result.success).toBe(false);
@@ -195,7 +195,7 @@ describe("multi-model launch", () => {
test("successfully plans and executes tmux launch with single model", async () => { test("successfully plans and executes tmux launch with single model", async () => {
const result = await launchMultiModel({ const result = await launchMultiModel({
sessionName: "test-session", sessionName: "test-session",
models: ["openai/gpt-4o"], models: ["openai/gpt-5.2"],
}); });
expect(result.success).toBe(true); expect(result.success).toBe(true);
@@ -209,7 +209,7 @@ describe("multi-model launch", () => {
const result = await launchMultiModel({ const result = await launchMultiModel({
sessionName: "test-session", sessionName: "test-session",
models: ["openai/gpt-4o", "anthropic/claude-3-5-sonnet"], models: ["openai/gpt-5.2", "anthropic/claude-3-5-sonnet"],
}); });
expect(result.success).toBe(true); expect(result.success).toBe(true);
@@ -224,7 +224,7 @@ describe("multi-model launch", () => {
const result = await launchMultiModel({ const result = await launchMultiModel({
sessionName: "test session!", sessionName: "test session!",
models: ["openai/gpt-4o"], models: ["openai/gpt-5.2"],
}); });
expect(result.success).toBe(true); expect(result.success).toBe(true);
@@ -239,7 +239,7 @@ describe("multi-model launch", () => {
const result = await launchMultiModel({ const result = await launchMultiModel({
sessionName: "test-session", sessionName: "test-session",
models: ["openai/gpt-4o"], models: ["openai/gpt-5.2"],
}); });
expect(result.success).toBe(false); expect(result.success).toBe(false);
@@ -265,7 +265,7 @@ describe("multi-model launch", () => {
const result = await launchMultiModel({ const result = await launchMultiModel({
sessionName: "test-session", sessionName: "test-session",
models: ["openai/gpt-4o"], models: ["openai/gpt-5.2"],
}); });
expect(result.success).toBe(false); expect(result.success).toBe(false);
@@ -284,7 +284,7 @@ describe("multi-model launch", () => {
const result = await launchMultiModel({ const result = await launchMultiModel({
sessionName: "test-session", sessionName: "test-session",
models: ["openai/gpt-4o"], models: ["openai/gpt-5.2"],
}); });
expect(result.success).toBe(false); expect(result.success).toBe(false);
@@ -304,7 +304,7 @@ describe("multi-model launch", () => {
const result = await launchMultiModel({ const result = await launchMultiModel({
sessionName: "test-session", sessionName: "test-session",
models: ["openai/gpt-4o"], models: ["openai/gpt-5.2"],
}); });
expect(result.success).toBe(false); expect(result.success).toBe(false);
@@ -321,13 +321,13 @@ describe("multi-model launch", () => {
}); });
test("model name collision creates unique window names", async () => { test("model name collision creates unique window names", async () => {
mockCommandResponses["opencode models"] = { ok: true, stdout: "openai/gpt-4o\nanthropic/gpt-4o", stderr: "" }; mockCommandResponses["opencode models"] = { ok: true, stdout: "openai/gpt-5.2\nanthropic/gpt-4o", stderr: "" };
mockCommandResponses["git show-ref --verify --quiet refs/heads/opencode/test-session/gpt-4o"] = { ok: false, stdout: "", stderr: "" }; mockCommandResponses["git show-ref --verify --quiet refs/heads/opencode/test-session/gpt-4o"] = { ok: false, stdout: "", stderr: "" };
mockCommandResponses["git show-ref --verify --quiet refs/heads/opencode/test-session/gpt-4o-2"] = { ok: false, stdout: "", stderr: "" }; mockCommandResponses["git show-ref --verify --quiet refs/heads/opencode/test-session/gpt-4o-2"] = { ok: false, stdout: "", stderr: "" };
const result = await launchMultiModel({ const result = await launchMultiModel({
sessionName: "test-session", sessionName: "test-session",
models: ["openai/gpt-4o", "anthropic/gpt-4o"], models: ["openai/gpt-5.2", "anthropic/gpt-4o"],
}); });
expect(result.success).toBe(true); expect(result.success).toBe(true);
@@ -403,7 +403,7 @@ describe("core utils", () => {
}); });
test("array with mixed valid models, padded models, and empty strings", () => { test("array with mixed valid models, padded models, and empty strings", () => {
expect(normalizeModels([" openai/gpt-4o ", "", " anthropic/claude "])).toEqual(["openai/gpt-4o", "anthropic/claude"]); expect(normalizeModels([" openai/gpt-5.2 ", "", " anthropic/claude "])).toEqual(["openai/gpt-5.2", "anthropic/claude"]);
}); });
}); });
@@ -454,12 +454,12 @@ describe("core utils", () => {
describe("createWindowPlans", () => { describe("createWindowPlans", () => {
test("single model", () => { test("single model", () => {
expect(createWindowPlans(["openai/gpt-4o"])).toEqual([{ model: "openai/gpt-4o", windowName: "gpt-4o" }]); expect(createWindowPlans(["openai/gpt-5.2"])).toEqual([{ model: "openai/gpt-5.2", windowName: "gpt-4o" }]);
}); });
test("two models with the same base name", () => { test("two models with the same base name", () => {
expect(createWindowPlans(["openai/gpt-4o", "anthropic/gpt-4o"])).toEqual([ expect(createWindowPlans(["openai/gpt-5.2", "anthropic/gpt-4o"])).toEqual([
{ model: "openai/gpt-4o", windowName: "gpt-4o" }, { model: "openai/gpt-5.2", windowName: "gpt-4o" },
{ model: "anthropic/gpt-4o", windowName: "gpt-4o-2" } { model: "anthropic/gpt-4o", windowName: "gpt-4o-2" }
]); ]);
}); });
@@ -650,19 +650,19 @@ describe("core utils", () => {
describe("launchModelInWindow", () => { describe("launchModelInWindow", () => {
test("sends correct tmux command", async () => { test("sends correct tmux command", async () => {
mockCommandResponses["tmux send-keys -t session:window opencode --model 'openai/gpt-4o' C-m"] = { ok: true, stdout: "", stderr: "" }; mockCommandResponses["tmux send-keys -t session:window opencode --model 'openai/gpt-5.2' C-m"] = { ok: true, stdout: "", stderr: "" };
const result = await launchModelInWindow("session", { model: "openai/gpt-4o", windowName: "window" }); const result = await launchModelInWindow("session", { model: "openai/gpt-5.2", windowName: "window" });
expect(result.ok).toBe(true); expect(result.ok).toBe(true);
expect(executedCommands).toContain("tmux send-keys -t session:window opencode --model 'openai/gpt-4o' C-m"); expect(executedCommands).toContain("tmux send-keys -t session:window opencode --model 'openai/gpt-5.2' C-m");
}); });
test("uses custom binary name", async () => { test("uses custom binary name", async () => {
mockCommandResponses["tmux send-keys -t session:window kilo --model 'openai/gpt-4o' C-m"] = { ok: true, stdout: "", stderr: "" }; mockCommandResponses["tmux send-keys -t session:window kilo --model 'openai/gpt-5.2' C-m"] = { ok: true, stdout: "", stderr: "" };
const result = await launchModelInWindow("session", { model: "openai/gpt-4o", windowName: "window" }, "kilo"); const result = await launchModelInWindow("session", { model: "openai/gpt-5.2", windowName: "window" }, "kilo");
expect(result.ok).toBe(true); expect(result.ok).toBe(true);
expect(executedCommands).toContain("tmux send-keys -t session:window kilo --model 'openai/gpt-4o' C-m"); expect(executedCommands).toContain("tmux send-keys -t session:window kilo --model 'openai/gpt-5.2' C-m");
}); });
}); });