From 0611a66756da17b17572421d2155178de432098e Mon Sep 17 00:00:00 2001 From: notgitika Date: Tue, 2 Jun 2026 20:47:57 -0400 Subject: [PATCH] fix(dev): exit 1 when `dev --logs` is run on harness-only project MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, running `agentcore dev --logs` on a harness-only project printed guidance text and exited with code 0. This is incorrect since harness projects don't support local dev — the command should fail. Now throws a ValidationError with actionable guidance, exiting with code 1 consistent with other validation failures in the dev command. Fixes #1406 --- src/cli/commands/dev/command.tsx | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/cli/commands/dev/command.tsx b/src/cli/commands/dev/command.tsx index f588f3996..adccac274 100644 --- a/src/cli/commands/dev/command.tsx +++ b/src/cli/commands/dev/command.tsx @@ -336,20 +336,9 @@ export const registerDev = (program: Command) => { // If --logs provided, run non-interactive mode if (opts.logs) { if (supportedAgents.length === 0 && hasHarnesses) { - // Harnesses run in the cloud — no local server to tail. - // Deploy if needed, then print the config change warning and invoke instructions. - if (!opts.skipDeploy) { - await runCliDeploy(); - } - const harnessNames = (project.harnesses ?? []).map(h => h.name); - console.log('Harness dev runs against the deployed service (no local server).'); - console.log(`If you changed the harness config, redeploy to pick up changes: agentcore deploy`); - console.log(`\nInvoke your harness:`); - for (const name of harnessNames) { - console.log(` agentcore invoke --harness ${name} "your prompt"`); - } - console.log(`\nOr use the interactive TUI: agentcore dev`); - process.exit(0); + throw new ValidationError( + 'Harness projects do not support local dev. Use `agentcore invoke --harness ` instead.' + ); } // Require --agent if multiple agents