From 2cde5ae5b342717aaffe39a10b25ea39a5b77467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hanu=C5=A1?= Date: Sun, 5 Jul 2026 00:53:13 +0200 Subject: [PATCH] fix(run): clarify purge info + hint --input/--input-file on stored-input validation failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two small wording tweaks in `apify run` so users (and agents driving the CLI) don't waste time re-running with different flags to figure out what happened. 1. The `Info: All default local stores were purged.` message previously suggested that INPUT.json was also wiped. It isn't — `purgeDefaultKeyValueStore` preserves the resolved input key. The updated message says so explicitly and points at `--no-purge` for full preservation. 2. When there is no `--input` / `--input-file` override and the stored INPUT fails schema validation, the error only said "The input in your storage is invalid" with the field-required list. Users who wanted to supply the missing field on-the-fly had no idea `--input` / `--input-file` existed. The error now includes those flags in the header. No behavior change — messaging only. Surfaced during an evaluation of Apify surfaces for agent-driven Actor development. Co-Authored-By: Claude Opus 4.7 --- src/commands/run.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/commands/run.ts b/src/commands/run.ts index 3548472e4..ccf90cbdf 100644 --- a/src/commands/run.ts +++ b/src/commands/run.ts @@ -271,7 +271,9 @@ export class RunCommand extends ApifyCommand { if (crawleeVersion.isNone()) { await Promise.all([purgeDefaultQueue(), purgeDefaultKeyValueStore(resolvedInputKey), purgeDefaultDataset()]); - info({ message: 'All default local stores were purged.' }); + info({ + message: `All default local stores were purged (the "${resolvedInputKey}" key-value store entry was preserved; pass --no-purge to keep everything).`, + }); } } @@ -546,7 +548,9 @@ export class RunCommand extends ApifyCommand { if (inputOverride) { errorHeader = `The input provided through the ${inputOverride.source} file is invalid. Please fix the following errors:\n`; } else { - errorHeader = 'The input in your storage is invalid. Please fix the following errors:\n'; + errorHeader = + 'The input in your storage is invalid. Please fix the following errors' + + ' (or override the stored input for this run with `--input \'{"...":"..."}\'` or `--input-file ./input.json`):\n'; } break; }