fix(agent-names): use HTTP-header-safe display names and config keys for API calls (#3138)

Display names with parentheses like 'Atlas (Plan Executor)' cause HTTP
header validation errors in x-opencode-agent-name. This was blocking
Atlas/Prometheus from working via /start-work and auto-retry.

Changes:
- Display names: parens -> dashes ('Atlas - Plan Executor')
- Hooks (start-work, no-hephaestus-non-gpt, no-sisyphus-gpt): use
  config keys ('atlas', 'sisyphus', 'hephaestus') for agent API fields
- auto-retry: use config key instead of display name for promptAsync
- agent-override-protection: handle dash-suffix normalization
- Updated all test expectations to match new format

Closes #3138
This commit is contained in:
YeonGyu-Kim
2026-04-07 10:08:04 +09:00
parent ebfd4a41ee
commit f8c626086e
26 changed files with 146 additions and 144 deletions
+16 -16
View File
@@ -92,12 +92,12 @@ describe("Agent Config Integration", () => {
const displayNames = agents.map((agent) => getAgentDisplayName(agent))
// then - display names are correct
expect(displayNames).toContain("Sisyphus (Ultraworker)")
expect(displayNames).toContain("Hephaestus (Deep Agent)")
expect(displayNames).toContain("Prometheus (Plan Builder)")
expect(displayNames).toContain("Atlas (Plan Executor)")
expect(displayNames).toContain("Metis (Plan Consultant)")
expect(displayNames).toContain("Momus (Plan Critic)")
expect(displayNames).toContain("Sisyphus - Ultraworker")
expect(displayNames).toContain("Hephaestus - Deep Agent")
expect(displayNames).toContain("Prometheus - Plan Builder")
expect(displayNames).toContain("Atlas - Plan Executor")
expect(displayNames).toContain("Metis - Plan Consultant")
expect(displayNames).toContain("Momus - Plan Critic")
expect(displayNames).toContain("oracle")
expect(displayNames).toContain("librarian")
expect(displayNames).toContain("explore")
@@ -112,12 +112,12 @@ describe("Agent Config Integration", () => {
const displayNames = keys.map((key) => getAgentDisplayName(key))
// then - correct display names are returned
expect(displayNames[0]).toBe("Sisyphus (Ultraworker)")
expect(displayNames[1]).toBe("Atlas (Plan Executor)")
expect(displayNames[2]).toBe("Sisyphus (Ultraworker)")
expect(displayNames[3]).toBe("Atlas (Plan Executor)")
expect(displayNames[4]).toBe("Prometheus (Plan Builder)")
expect(displayNames[5]).toBe("Prometheus (Plan Builder)")
expect(displayNames[0]).toBe("Sisyphus - Ultraworker")
expect(displayNames[1]).toBe("Atlas - Plan Executor")
expect(displayNames[2]).toBe("Sisyphus - Ultraworker")
expect(displayNames[3]).toBe("Atlas - Plan Executor")
expect(displayNames[4]).toBe("Prometheus - Plan Builder")
expect(displayNames[5]).toBe("Prometheus - Plan Builder")
})
test("returns original key for unknown agents", () => {
@@ -189,8 +189,8 @@ describe("Agent Config Integration", () => {
const prometheusDisplay = getAgentDisplayName("prometheus")
// then - display names are correct
expect(sisyphusDisplay).toBe("Sisyphus (Ultraworker)")
expect(prometheusDisplay).toBe("Prometheus (Plan Builder)")
expect(sisyphusDisplay).toBe("Sisyphus - Ultraworker")
expect(prometheusDisplay).toBe("Prometheus - Plan Builder")
// then - config values are preserved
expect(result.migrated.sisyphus).toEqual({ model: "anthropic/claude-opus-4-6", temperature: 0.1 })
@@ -218,8 +218,8 @@ describe("Agent Config Integration", () => {
const atlasDisplay = getAgentDisplayName("atlas")
// then - display names are correct
expect(sisyphusDisplay).toBe("Sisyphus (Ultraworker)")
expect(atlasDisplay).toBe("Atlas (Plan Executor)")
expect(sisyphusDisplay).toBe("Sisyphus - Ultraworker")
expect(atlasDisplay).toBe("Atlas - Plan Executor")
})
})
})