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:
@@ -1,3 +1,5 @@
|
||||
/// <reference types="bun-types" />
|
||||
|
||||
import { unsafeTestValue } from "../../../test-support/unsafe-test-value"
|
||||
import { describe, test, expect, mock } from "bun:test"
|
||||
|
||||
@@ -140,7 +142,7 @@ describe("executeSync", () => {
|
||||
|
||||
//#then
|
||||
const promptInput = recorder.getCapturedInput()
|
||||
expect(promptInput?.body.agent).toBe("Sisyphus - Ultraworker")
|
||||
expect(promptInput?.body.agent).toBe("Sisyphus - ultraworker")
|
||||
})
|
||||
|
||||
test("#given subagent_type is the lowercase config key 'hephaestus' #when executeSync runs #then prompt receives the registered display name 'Hephaestus - Deep Agent'", async () => {
|
||||
@@ -449,7 +451,7 @@ describe("executeSync", () => {
|
||||
|
||||
//#then
|
||||
const promptInput = recorder.getCapturedInput()
|
||||
expect(promptInput?.body.agent).toBe("Sisyphus - Ultraworker")
|
||||
expect(promptInput?.body.agent).toBe("Sisyphus - ultraworker")
|
||||
})
|
||||
|
||||
test("returns generic prompt failure with task metadata", async () => {
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { PluginInput } from "@opencode-ai/plugin"
|
||||
import { clearSessionAgent, setSessionAgent, subagentSessions, syncSubagentSessions } from "../../features/claude-code-session-state"
|
||||
import { dispatchInternalPrompt, isInternalPromptDispatchAccepted } from "../../hooks/shared/prompt-async-gate"
|
||||
import { getAgentToolRestrictions, isAmbiguousPostDispatchPromptFailure, log } from "../../shared"
|
||||
import { getAgentDisplayName, stripAgentListSortPrefix } from "../../shared/agent-display-names"
|
||||
import { normalizeAgentForPrompt, stripAgentListSortPrefix } from "../../shared/agent-display-names"
|
||||
import {
|
||||
clearDelegatedChildSessionBootstrap,
|
||||
registerDelegatedChildSessionBootstrap,
|
||||
@@ -118,7 +118,7 @@ export async function executeSync(
|
||||
log(`[call_omo_agent] Sending prompt to session ${sessionID}`)
|
||||
log(`[call_omo_agent] Prompt text:`, args.prompt.substring(0, 100))
|
||||
const normalizedSubagentType = stripAgentListSortPrefix(args.subagent_type)
|
||||
const promptAgent = getAgentDisplayName(normalizedSubagentType)
|
||||
const promptAgent = normalizeAgentForPrompt(normalizedSubagentType) ?? normalizedSubagentType
|
||||
const promptTools = buildSyncPromptTools(normalizedSubagentType)
|
||||
setSessionAgent(sessionID, promptAgent)
|
||||
setSessionTools(sessionID, promptTools)
|
||||
|
||||
Reference in New Issue
Block a user