fix(run): clarify purge info + hint --input/--input-file on stored-input validation failure#1257
Draft
DaveHanns wants to merge 1 commit into
Draft
fix(run): clarify purge info + hint --input/--input-file on stored-input validation failure#1257DaveHanns wants to merge 1 commit into
DaveHanns wants to merge 1 commit into
Conversation
…put validation failure 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 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two small wording tweaks in
apify runso users (and, in particular, agents driving the CLI) don't waste turns re-running with different flags trying to figure out what happened.Motivation
We repeatedly observed the following confusing flow when driving
apify runin a project whose storedINPUT.jsonis missing a required field:Two things are misleading here:
The purge info message overstates what happened.
purgeDefaultKeyValueStorealready preserves the resolved input key (see thepreserveRegExpsbranch insrc/lib/utils.ts), soINPUT.jsonis NOT wiped by--purge. The current message reads as if it was, which pushes people to try--no-purgenext (which yields the same validation error, because the file was never gone in the first place).The validation error offers no way out. Once the user has established the stored input is invalid, the natural next question is "how do I run it once with the missing field filled in?". The CLI does support this via
--input '{...}'and--input-file ./input.json, andvalidateAndStoreInputwrites the override to a temp key so the on-diskINPUT.jsonis not modified — but nothing in the error message points there.Change
--no-purgefor full preservation.--inputand--input-fileas a way to override the stored input for this run.Behavior is otherwise unchanged — messaging only, no logic edits.
Evidence (before)
Evidence (after)
Test plan
apify runon a project with a validINPUT.json— no message change (both lines only appear on the failing path).apify runon a project with an INPUT missing a required field — updated purge line + updated error header appear; INPUT.json on disk is untouched (already true today, this PR just tells the user that).apify run --input '{"productUrl":"https://example.com"}'on the same project — override path still used; error header (if it were to appear) is the existing--inputvariant, not the storage variant.Surfaced during an evaluation of Apify surfaces for agent-driven Actor development.