diff --git a/src/assets/__tests__/__snapshots__/assets.snapshot.test.ts.snap b/src/assets/__tests__/__snapshots__/assets.snapshot.test.ts.snap index c97e8e032..bf1d715db 100644 --- a/src/assets/__tests__/__snapshots__/assets.snapshot.test.ts.snap +++ b/src/assets/__tests__/__snapshots__/assets.snapshot.test.ts.snap @@ -356,10 +356,12 @@ export class AgentCoreStack extends Stack { const { spec, mcpSpec, credentials, harnesses } = props; // Create AgentCoreApplication with all agents and harness roles - this.application = new AgentCoreApplication(this, 'Application', { - spec, - harnesses: harnesses?.length ? harnesses : undefined, - }); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const appProps: Record = { spec }; + if (harnesses?.length) { + appProps.harnesses = harnesses; + } + this.application = new AgentCoreApplication(this, 'Application', appProps as any); // Create AgentCoreMcp if there are gateways configured if (mcpSpec?.agentCoreGateways && mcpSpec.agentCoreGateways.length > 0) { diff --git a/src/assets/cdk/lib/cdk-stack.ts b/src/assets/cdk/lib/cdk-stack.ts index a89efc850..a823b4433 100644 --- a/src/assets/cdk/lib/cdk-stack.ts +++ b/src/assets/cdk/lib/cdk-stack.ts @@ -58,10 +58,12 @@ export class AgentCoreStack extends Stack { const { spec, mcpSpec, credentials, harnesses } = props; // Create AgentCoreApplication with all agents and harness roles - this.application = new AgentCoreApplication(this, 'Application', { - spec, - harnesses: harnesses?.length ? harnesses : undefined, - }); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const appProps: Record = { spec }; + if (harnesses?.length) { + appProps.harnesses = harnesses; + } + this.application = new AgentCoreApplication(this, 'Application', appProps as any); // Create AgentCoreMcp if there are gateways configured if (mcpSpec?.agentCoreGateways && mcpSpec.agentCoreGateways.length > 0) {