fix(agent-key): remove ZWSP from config object keys (RFC 7230)
Object keys containing ZWSP characters cause HTTP header validation failures in OpenCode 1.4.0+, breaking agent registration. - Use getAgentDisplayName() (no ZWSP) for object keys - Keep getAgentRuntimeName() (with ZWSP) only in name field for sorting - Maintains ZWSP sorting for Sisyphus, Hephaestus, Prometheus, Atlas Fixes #3220
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { OhMyOpenCodeConfig } from "../config";
|
||||
import { getAgentDisplayName, getAgentListDisplayName } from "../shared/agent-display-names";
|
||||
import { getAgentDisplayName } from "../shared/agent-display-names";
|
||||
import { isTaskSystemEnabled } from "../shared";
|
||||
|
||||
type AgentWithPermission = { permission?: Record<string, unknown> };
|
||||
@@ -16,7 +16,7 @@ function getConfigQuestionPermission(): string | null {
|
||||
}
|
||||
|
||||
function agentByKey(agentResult: Record<string, unknown>, key: string): AgentWithPermission | undefined {
|
||||
return (agentResult[getAgentListDisplayName(key)] ?? agentResult[getAgentDisplayName(key)] ?? agentResult[key]) as
|
||||
return (agentResult[getAgentDisplayName(key)] ?? agentResult[key]) as
|
||||
| AgentWithPermission
|
||||
| undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user