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 by d66b6bcbf, 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 after cd39f8858, 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:
YeonGyu-Kim
2026-05-22 00:05:42 +09:00
parent beed9e8906
commit bc0da0fad3
10 changed files with 55 additions and 41 deletions
@@ -1,5 +1,4 @@
declare const require: (name: string) => any
const { afterEach, describe, expect, test } = require("bun:test")
import { afterEach, describe, expect, test } from "bun:test"
import { injectContinuation } from "./continuation-injection"
import { OMO_INTERNAL_INITIATOR_MARKER } from "../../shared/internal-initiator-marker"
@@ -42,14 +41,14 @@ describe("injectContinuation", () => {
ctx: ctx as never,
sessionID: "ses_display_name_agent",
resolvedInfo: {
agent: "Sisyphus - Ultraworker",
agent: "Sisyphus - ultraworker",
model: { providerID: "anthropic", modelID: "claude-sonnet-4-20250514" },
},
sessionStateStore: sessionStateStore as never,
})
// then
expect(capturedAgent).toBe("Sisyphus - Ultraworker")
expect(capturedAgent).toBe("Sisyphus - ultraworker")
})
test("#given resolved agent name still carries a ZWSP sort prefix #when continuation is injected #then promptAsync receives the agent name without the ZWSP prefix", async () => {
@@ -80,14 +79,14 @@ describe("injectContinuation", () => {
ctx: ctx as never,
sessionID: "ses_zwsp_agent",
resolvedInfo: {
agent: "\u200B\u200BSisyphus - Ultraworker",
agent: "\u200B\u200BSisyphus - ultraworker",
model: { providerID: "anthropic", modelID: "claude-sonnet-4-20250514" },
},
sessionStateStore: sessionStateStore as never,
})
// then
expect(capturedAgent).toBe("Sisyphus - Ultraworker")
expect(capturedAgent).toBe("Sisyphus - ultraworker")
expect(capturedAgent).not.toContain("\u200B")
})
@@ -254,7 +253,12 @@ describe("injectContinuation", () => {
},
},
}
const state = { inFlight: false, lastInjectedAt: 0, consecutiveFailures: 0 }
const state = {
inFlight: false,
lastInjectedAt: 0,
consecutiveFailures: 0,
awaitingPostInjectionProgressCheck: false,
}
const sessionStateStore = {
getExistingState: () => state,
}
@@ -276,7 +280,7 @@ describe("injectContinuation", () => {
ctx: ctx as never,
sessionID,
resolvedInfo: {
agent: "Sisyphus - Ultraworker",
agent: "Sisyphus - ultraworker",
model: { providerID: "anthropic", modelID: "claude-sonnet-4-20250514" },
},
sessionStateStore: sessionStateStore as never,
@@ -320,7 +324,7 @@ describe("injectContinuation", () => {
ctx: ctx as never,
sessionID: "ses_continuation_eof",
resolvedInfo: {
agent: "Sisyphus - Ultraworker",
agent: "Sisyphus - ultraworker",
model: { providerID: "anthropic", modelID: "claude-sonnet-4-20250514" },
},
sessionStateStore: sessionStateStore as never,
@@ -633,7 +633,7 @@ describe("unstable-agent-babysitter hook", () => {
// then
const payload = promptCalls[0]?.input as { body?: { parts?: Array<{ text?: string }> } } | undefined
const text = payload?.body?.parts?.[0]?.text ?? ""
expect(text).toContain("Agent: Sisyphus - Ultraworker")
expect(text).toContain("Agent: Sisyphus - ultraworker")
expect(text).not.toContain("Agent: sisyphus")
})
@@ -657,7 +657,7 @@ describe("unstable-agent-babysitter hook", () => {
// then
const payload = promptCalls[0]?.input as { body?: { parts?: Array<{ text?: string }> } } | undefined
const text = payload?.body?.parts?.[0]?.text ?? ""
expect(text).toContain("Agent: Sisyphus - Ultraworker")
expect(text).toContain("Agent: Sisyphus - ultraworker")
expect(text).not.toContain("Agent: Sisyphus (Ultraworker)")
})
})