Skip to content

Commit c3f52fd

Browse files
committed
fix(dev): skip deploy for plain agents without harnesses
`agentcore dev` was triggering a full CDK deploy even for plain agents (Strands, LangGraph, etc.) that only need a local dev server. This blocked users from iterating locally without AWS credentials/targets configured. Now `runCliDeploy()` is only invoked when the project has harnesses (cloud-dependent resources). Plain agents start the local server immediately. Closes #1189
1 parent 4d7834a commit c3f52fd

3 files changed

Lines changed: 18 additions & 3 deletions

File tree

src/cli/commands/dev/browser-mode.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ export async function launchBrowserDev(): Promise<void> {
129129
process.exit(1);
130130
}
131131

132-
await runCliDeploy();
132+
if (hasHarnesses) {
133+
await runCliDeploy();
134+
}
133135

134136
const configRoot = findConfigRoot(workingDir);
135137
const persistTracesDir = path.join(configRoot ?? workingDir, '.cli', 'traces');

src/cli/commands/dev/command.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,8 @@ export const registerDev = (program: Command) => {
389389
// Get provider info from agent config
390390
const providerInfo = '(see agent code)';
391391

392-
// Deploy resources before starting dev server
393-
if (!opts.skipDeploy) {
392+
// Deploy resources before starting dev server (only when harnesses need it)
393+
if (!opts.skipDeploy && hasHarnesses) {
394394
await runCliDeploy();
395395
}
396396

src/cli/tui/hooks/useDevDeploy.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,19 @@ export function useDevDeploy({ skip, ready = true }: UseDevDeployOptions = {}):
4949
try {
5050
const configIO = new ConfigIO();
5151

52+
// Only deploy if the project has harnesses (cloud-dependent resources).
53+
// Plain agents (Strands, LangGraph, etc.) run locally and don't need deployment.
54+
try {
55+
const projectSpec = await configIO.readProjectSpec();
56+
const hasHarnesses = (projectSpec.harnesses ?? []).length > 0;
57+
if (!hasHarnesses) {
58+
onProgress('Local agent — no deploy needed', 'success');
59+
return;
60+
}
61+
} catch {
62+
// If we can't read project spec, proceed with deploy as a safe default
63+
}
64+
5265
// Auto-populate aws-targets.json if empty
5366
try {
5467
const targets = await configIO.readAWSDeploymentTargets();

0 commit comments

Comments
 (0)