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:
@@ -175,8 +175,8 @@ describe("applyAgentConfig builtin override protection", () => {
|
||||
})
|
||||
|
||||
// then every registered agent key must be HTTP-header-safe (no parentheses)
|
||||
// Parentheses in agent names cause HTTP header validation errors in
|
||||
// x-opencode-agent-name and prevent the agents from showing in the OpenCode UI.
|
||||
// Agent keys can flow into HTTP header values in some plugin paths.
|
||||
// Parentheses and ZWSP characters violate RFC 7230 header value rules.
|
||||
for (const key of Object.keys(result)) {
|
||||
expect(key).not.toMatch(/[()]/)
|
||||
}
|
||||
|
||||
@@ -4,10 +4,12 @@
|
||||
* Display names include suffixes for UI/logs (e.g., "Sisyphus - Ultraworker").
|
||||
*
|
||||
* IMPORTANT: Display names MUST NOT contain parentheses or other characters
|
||||
* that are invalid in HTTP header values per RFC 7230. OpenCode passes the
|
||||
* agent name in the `x-opencode-agent-name` header, and parentheses cause
|
||||
* header validation failures that prevent agents from appearing in the UI
|
||||
* type selector dropdown. Use ` - ` (space-dash-space) instead of `(...)`.
|
||||
* that are invalid in HTTP header values per RFC 7230. Config object keys
|
||||
* can flow into HTTP header values in some plugin paths. Use ` - `
|
||||
* (space-dash-space) instead of `(...)` to avoid header validation failures.
|
||||
*
|
||||
* 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> = {
|
||||
sisyphus: "Sisyphus - Ultraworker",
|
||||
|
||||
Reference in New Issue
Block a user