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:
@@ -87,7 +87,7 @@ describe("createChatMessageHandler - /start-work integration", () => {
|
||||
await handler(input, output)
|
||||
|
||||
// then
|
||||
expect(output.message["agent"]).toBe("Sisyphus (Ultraworker)")
|
||||
expect(output.message["agent"]).toBe("sisyphus")
|
||||
expect(output.parts[0].text).toContain("<auto-slash-command>")
|
||||
expect(output.parts[0].text).toContain("Auto-Selected Plan")
|
||||
expect(output.parts[0].text).toContain("boulder.json has been created")
|
||||
@@ -397,7 +397,7 @@ describe("createChatMessageHandler - TUI variant passthrough", () => {
|
||||
//#then
|
||||
expect(output.message["model"]).toBeUndefined()
|
||||
expect(getSessionModel("test-session")).toEqual({ providerID: "openai", modelID: "gpt-5.4" })
|
||||
expect(getSessionAgent("test-session")).toBe("Prometheus (Plan Builder)")
|
||||
expect(getSessionAgent("test-session")).toBe("Prometheus - Plan Builder")
|
||||
})
|
||||
|
||||
test("respects a mid-conversation model switch instead of reusing the previous stored model", async () => {
|
||||
|
||||
Reference in New Issue
Block a user