fix(delegate-task): route sync prompts by directory
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
promptSyncWithModelSuggestionRetry,
|
||||
promptWithModelSuggestionRetry,
|
||||
} from "../../shared/model-suggestion-retry"
|
||||
import { routePromptRetry, routePromptSyncRetry } from "../../shared/session-route"
|
||||
import { formatDetailedError } from "./error-formatting"
|
||||
import { getAgentToolRestrictions } from "../../shared/agent-tool-restrictions"
|
||||
import { stripInvisibleAgentCharacters } from "../../shared/agent-display-names"
|
||||
@@ -59,6 +60,7 @@ export async function sendSyncPrompt(
|
||||
args: DelegateTaskArgs
|
||||
systemContent: string | undefined
|
||||
categoryModel: DelegatedModelConfig | undefined
|
||||
directory: string
|
||||
toastManager: { removeTask: (id: string) => void } | null | undefined
|
||||
taskId: string | undefined
|
||||
sisyphusAgentConfig?: SisyphusAgentConfig
|
||||
@@ -99,11 +101,12 @@ export async function sendSyncPrompt(
|
||||
}
|
||||
|
||||
try {
|
||||
await deps.promptWithModelSuggestionRetry(client, promptArgs)
|
||||
const routedPromptArgs = routePromptRetry(promptArgs, input.directory)
|
||||
await deps.promptWithModelSuggestionRetry(client, routedPromptArgs)
|
||||
} catch (promptError) {
|
||||
if (isOracleAgent(input.agentToUse) && isUnexpectedEofError(promptError)) {
|
||||
try {
|
||||
await deps.promptSyncWithModelSuggestionRetry(client, promptArgs)
|
||||
await deps.promptSyncWithModelSuggestionRetry(client, routePromptSyncRetry(promptArgs, input.directory))
|
||||
return null
|
||||
} catch (oracleRetryError) {
|
||||
promptError = oracleRetryError
|
||||
|
||||
Reference in New Issue
Block a user