fix(llm): isolate retry policy histories
This commit is contained in:
@@ -67,6 +67,8 @@ export interface Config {
|
||||
toolTasks?: NonNullable<agentCore.Config['toolTasks']>
|
||||
/** Persisted same-session goals; owner defaults enable them, or false disables the stack and tools. */
|
||||
goals?: agentCore.GoalConfig | false
|
||||
/** Invalid at app level; configure `retryPolicy` under each provider. */
|
||||
llmRetry?: never
|
||||
}
|
||||
|
||||
// Each front door owns a complete, directly readable config schema; extracting
|
||||
@@ -92,6 +94,8 @@ export const Config: z<Config> = z.object({
|
||||
toolBash: agentCore.ToolBashConfigSchema,
|
||||
toolTasks: z.union([z.const(false), agentCore.ToolTasksConfigSchema]),
|
||||
goals: z.union([z.const(false), agentCore.GoalConfigSchema]),
|
||||
// Provider retryPolicy makes a top-level llmRetry invalid.
|
||||
llmRetry: z.never(),
|
||||
})
|
||||
/* jscpd:ignore-end */
|
||||
|
||||
|
||||
@@ -76,6 +76,16 @@ async function withIsolatedSkillHomes<T>(run: () => Promise<T>): Promise<T> {
|
||||
}
|
||||
|
||||
describe('dsh-acp-demo composition', () => {
|
||||
it('rejects app-level llmRetry config through plugin validation', async () => {
|
||||
const ctx = new Context()
|
||||
await expect(ctx.plugin(acpAgent, {
|
||||
provider: 'mock',
|
||||
model: 'mock',
|
||||
workspaceContext: false,
|
||||
llmRetry: { maxTransientRetries: 2 },
|
||||
} as never)).rejects.toThrow(/llmRetry/)
|
||||
})
|
||||
|
||||
it('brings up the spine + persistence + the ACP bridge', async () => {
|
||||
const ctx = await mount({
|
||||
provider: 'mock',
|
||||
|
||||
@@ -207,6 +207,20 @@ describe.skipIf(!existsSync(acpBin))('dsh-acp-demo BUILT bin (node lib/bin.js, n
|
||||
expect(code).not.toBe(0)
|
||||
expect(stderr).toContain('config file not found')
|
||||
}, 30_000)
|
||||
|
||||
it('rejects legacy app-level llmRetry through the published Loader path', async () => {
|
||||
consumer = await makeConsumer()
|
||||
const configPath = join(consumer, 'cordis.yml')
|
||||
const config = await readFile(configPath, 'utf8')
|
||||
await writeFile(configPath, config.replace(
|
||||
' workspaceContext: false',
|
||||
' workspaceContext: false\n llmRetry:\n maxTransientRetries: 2',
|
||||
))
|
||||
|
||||
const { code, stderr } = await runBinExpectingExit('./cordis.yml', consumer)
|
||||
expect(code).not.toBe(0)
|
||||
expect(stderr).toContain('llmRetry')
|
||||
}, 30_000)
|
||||
})
|
||||
|
||||
/** Spawn the built acp bin against `configArg` and resolve with its exit code + stderr. */
|
||||
|
||||
Reference in New Issue
Block a user