fix(agents): restore canonical core agent ordering
Remap the core agent keys, default agent, and command routing back to\nlist display names so OpenCode's name-based sorting keeps the\ncanonical Sisyphus -> Hephaestus -> Prometheus -> Atlas order.\n\nAlso teach tool config lookups to resolve the prefixed list keys and\nadd regression tests that exercise the real ordering and routing path.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { describe, it, expect, beforeEach, afterEach } from "bun:test"
|
||||
import { applyToolConfig } from "./tool-config-handler"
|
||||
import type { OhMyOpenCodeConfig } from "../config"
|
||||
import { getAgentListDisplayName } from "../shared/agent-display-names"
|
||||
|
||||
function createParams(overrides: {
|
||||
taskSystem?: boolean
|
||||
@@ -250,6 +251,22 @@ describe("applyToolConfig", () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe("#given agentResult uses exported list display keys", () => {
|
||||
it("#then should still resolve atlas permissions through the prefixed key", () => {
|
||||
const atlasKey = getAgentListDisplayName("atlas")
|
||||
const params = createParams({ agents: [atlasKey] })
|
||||
|
||||
applyToolConfig(params)
|
||||
|
||||
const agent = params.agentResult[atlasKey] as {
|
||||
permission: Record<string, unknown>
|
||||
}
|
||||
expect(agent.permission.task).toBe("allow")
|
||||
expect(agent.permission["task_*"]).toBe("allow")
|
||||
expect(agent.permission.teammate).toBe("allow")
|
||||
})
|
||||
})
|
||||
|
||||
describe("#given disabled_tools includes 'question'", () => {
|
||||
let originalConfigContent: string | undefined
|
||||
let originalCliRunMode: string | undefined
|
||||
|
||||
Reference in New Issue
Block a user