Merge pull request #2891 from codivedev/fix/issue-2882

fix: use display name in runtime-fallback retry
This commit is contained in:
YeonGyu-Kim
2026-03-28 01:38:14 +09:00
committed by GitHub
2 changed files with 4 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ import { SessionCategoryRegistry } from "../../shared/session-category-registry"
import { buildRetryModelPayload } from "./retry-model-payload"
import { getLastUserRetryParts } from "./last-user-retry-parts"
import { extractSessionMessages } from "./session-messages"
import { getAgentDisplayName } from "../../shared/agent-display-names"
const SESSION_TTL_MS = 30 * 60 * 1000
@@ -126,13 +127,14 @@ export function createAutoRetryHelpers(deps: HookDeps) {
})
const retryAgent = resolvedAgent ?? getSessionAgent(sessionID)
const retryAgentDisplayName = retryAgent ? getAgentDisplayName(retryAgent) : undefined
sessionAwaitingFallbackResult.add(sessionID)
scheduleSessionFallbackTimeout(sessionID, retryAgent)
await ctx.client.session.promptAsync({
path: { id: sessionID },
body: {
...(retryAgent ? { agent: retryAgent } : {}),
...(retryAgentDisplayName ? { agent: retryAgentDisplayName } : {}),
...retryModelPayload,
parts: retryParts,
},

View File

@@ -2404,7 +2404,7 @@ describe("runtime-fallback", () => {
expect(promptCalls.length).toBe(1)
const callBody = promptCalls[0]?.body as Record<string, unknown>
expect(callBody?.agent).toBe("prometheus")
expect(callBody?.agent).toBe("Prometheus (Plan Builder)")
expect(callBody?.model).toEqual({ providerID: "github-copilot", modelID: "claude-opus-4.6" })
})
})