test: fix prometheus-prompt syntax + sync display name casing to lowercase
- prometheus-prompt.test.ts: close missing }) on the OpenSpec expanded commands describe block (introduced byd66b6bcbf, parse error). - agent-sort-shim/agent-config-integration/continuation-injection/ unstable-agent-babysitter/subagent-resolver/sync-executor/ resolve-caller-team-lead tests: expect 'Sisyphus - ultraworker' (lowercase) to match production aftercd39f8858, which lowercased the display name to dodge a TUI ZWSP rendering glitch. Legacy uppercase inputs that exercise the normalization path are preserved. - sync-executor.ts + resolve-caller-team-lead.ts: route legacy display name inputs through normalizeAgentForPrompt so prompt agent names and caller team lead lookups produce the canonical lowercase form.
This commit is contained in:
@@ -45,7 +45,7 @@ describe("resolveCallerTeamLead", () => {
|
||||
// then
|
||||
expect(result).toEqual({
|
||||
agentTypeId: "sisyphus",
|
||||
displayName: "Sisyphus - Ultraworker",
|
||||
displayName: "Sisyphus - ultraworker",
|
||||
isEligibleForTeamLead: true,
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getAgentConfigKey, stripAgentListSortPrefix } from "../../shared/agent-display-names"
|
||||
import { getAgentConfigKey, getAgentDisplayName, stripAgentListSortPrefix } from "../../shared/agent-display-names"
|
||||
|
||||
import { AGENT_ELIGIBILITY_REGISTRY, type TeamSpec } from "./types"
|
||||
|
||||
@@ -13,12 +13,17 @@ export function resolveCallerTeamLead(rawAgentName: string | undefined): CallerT
|
||||
return { isEligibleForTeamLead: false }
|
||||
}
|
||||
|
||||
const displayName = stripAgentListSortPrefix(rawAgentName).trim()
|
||||
if (!displayName) {
|
||||
const strippedDisplayName = stripAgentListSortPrefix(rawAgentName).trim()
|
||||
if (!strippedDisplayName) {
|
||||
return { isEligibleForTeamLead: false }
|
||||
}
|
||||
|
||||
const agentTypeId = getAgentConfigKey(displayName)
|
||||
const agentTypeId = getAgentConfigKey(strippedDisplayName)
|
||||
const canonicalDisplayName = getAgentDisplayName(agentTypeId)
|
||||
const isStructuredDisplayName = strippedDisplayName.includes(" - ")
|
||||
const displayName = isStructuredDisplayName && strippedDisplayName.toLowerCase() === canonicalDisplayName.toLowerCase()
|
||||
? canonicalDisplayName
|
||||
: strippedDisplayName
|
||||
const eligibility = AGENT_ELIGIBILITY_REGISTRY[agentTypeId]
|
||||
if (!eligibility || eligibility.verdict === "hard-reject") {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user