docs: fix stale comments referencing non-existent x-opencode-agent-name header

Per OpenCode source investigation, no such header exists. Updated comments
to accurately reflect RFC 7230 compliance concerns for object keys.
This commit is contained in:
YeonGyu-Kim
2026-04-13 11:47:59 +09:00
parent 2ac23f7912
commit a8a0fea315
2 changed files with 8 additions and 6 deletions
@@ -175,8 +175,8 @@ describe("applyAgentConfig builtin override protection", () => {
}) })
// then every registered agent key must be HTTP-header-safe (no parentheses) // then every registered agent key must be HTTP-header-safe (no parentheses)
// Parentheses in agent names cause HTTP header validation errors in // Agent keys can flow into HTTP header values in some plugin paths.
// x-opencode-agent-name and prevent the agents from showing in the OpenCode UI. // Parentheses and ZWSP characters violate RFC 7230 header value rules.
for (const key of Object.keys(result)) { for (const key of Object.keys(result)) {
expect(key).not.toMatch(/[()]/) expect(key).not.toMatch(/[()]/)
} }
+6 -4
View File
@@ -4,10 +4,12 @@
* Display names include suffixes for UI/logs (e.g., "Sisyphus - Ultraworker"). * Display names include suffixes for UI/logs (e.g., "Sisyphus - Ultraworker").
* *
* IMPORTANT: Display names MUST NOT contain parentheses or other characters * IMPORTANT: Display names MUST NOT contain parentheses or other characters
* that are invalid in HTTP header values per RFC 7230. OpenCode passes the * that are invalid in HTTP header values per RFC 7230. Config object keys
* agent name in the `x-opencode-agent-name` header, and parentheses cause * can flow into HTTP header values in some plugin paths. Use ` - `
* header validation failures that prevent agents from appearing in the UI * (space-dash-space) instead of `(...)` to avoid header validation failures.
* type selector dropdown. Use ` - ` (space-dash-space) instead of `(...)`. *
* NOTE: ZWSP characters (\u200B) are used ONLY in the `name` field for
* UI sorting. ZWSP MUST NOT appear in object keys (see agent-key-remapper.ts).
*/ */
export const AGENT_DISPLAY_NAMES: Record<string, string> = { export const AGENT_DISPLAY_NAMES: Record<string, string> = {
sisyphus: "Sisyphus - Ultraworker", sisyphus: "Sisyphus - Ultraworker",