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,4 +1,4 @@
|
||||
import { getAgentListDisplayName, getAgentRuntimeName } from "../shared/agent-display-names"
|
||||
import { getAgentDisplayName, getAgentRuntimeName } from "../shared/agent-display-names"
|
||||
|
||||
function rewriteAgentNameForListDisplay(
|
||||
key: string,
|
||||
@@ -21,7 +21,7 @@ export function remapAgentKeysToDisplayNames(
|
||||
const result: Record<string, unknown> = {}
|
||||
|
||||
for (const [key, value] of Object.entries(agents)) {
|
||||
const displayName = getAgentListDisplayName(key)
|
||||
const displayName = getAgentDisplayName(key)
|
||||
if (displayName && displayName !== key) {
|
||||
result[displayName] = rewriteAgentNameForListDisplay(key, value)
|
||||
// Regression guard: do not also assign result[key].
|
||||
|
||||
Reference in New Issue
Block a user