fix(cli): use getAgentRuntimeName for agent resolution in run command

This commit is contained in:
YeonGyu-Kim
2026-04-15 14:46:50 +09:00
parent 81a03fa9d0
commit 47aa3025db
2 changed files with 18 additions and 15 deletions
+8 -7
View File
@@ -3,6 +3,7 @@
import { afterEach, beforeEach, describe, expect, it, spyOn } from "bun:test"
import { OhMyOpenCodeConfigSchema, type OhMyOpenCodeConfig } from "../../config"
import { resolveRunAgent } from "./agent-resolver"
import { getAgentRuntimeName } from "../../shared/agent-display-names"
const createConfig = (overrides: Partial<OhMyOpenCodeConfig> = {}): OhMyOpenCodeConfig =>
OhMyOpenCodeConfigSchema.parse(overrides)
@@ -31,7 +32,7 @@ describe("resolveRunAgent", () => {
)
// then
expect(agent).toBe("Hephaestus - Deep Agent")
expect(agent).toBe(getAgentRuntimeName("hephaestus"))
})
it("uses env agent over config", () => {
@@ -43,7 +44,7 @@ describe("resolveRunAgent", () => {
const agent = resolveRunAgent({ message: "test" }, config, env)
// then
expect(agent).toBe("Atlas - Plan Executor")
expect(agent).toBe(getAgentRuntimeName("atlas"))
})
it("uses config agent over default", () => {
@@ -54,7 +55,7 @@ describe("resolveRunAgent", () => {
const agent = resolveRunAgent({ message: "test" }, config, {})
// then
expect(agent).toBe("Prometheus - Plan Builder")
expect(agent).toBe(getAgentRuntimeName("prometheus"))
})
it("falls back to sisyphus when none set", () => {
@@ -65,7 +66,7 @@ describe("resolveRunAgent", () => {
const agent = resolveRunAgent({ message: "test" }, config, {})
// then
expect(agent).toBe("Sisyphus - Ultraworker")
expect(agent).toBe(getAgentRuntimeName("sisyphus"))
})
it("skips disabled sisyphus for next available core agent", () => {
@@ -76,10 +77,10 @@ describe("resolveRunAgent", () => {
const agent = resolveRunAgent({ message: "test" }, config, {})
// then
expect(agent).toBe("Hephaestus - Deep Agent")
expect(agent).toBe(getAgentRuntimeName("hephaestus"))
})
it("maps display-name style default_run_agent values to canonical display names", () => {
it("maps display-name style default_run_agent values to canonical runtime names", () => {
// given
const config = createConfig({ default_run_agent: "Sisyphus - Ultraworker" })
@@ -87,7 +88,7 @@ describe("resolveRunAgent", () => {
const agent = resolveRunAgent({ message: "test" }, config, {})
// then
expect(agent).toBe("Sisyphus - Ultraworker")
expect(agent).toBe(getAgentRuntimeName("sisyphus"))
})
})