Skip to content

fix: make the Actor context fallback error generic and actionable - #1563

Merged
l2ysho merged 1 commit into
masterfrom
claude/fix-actor-context-fallback-copy-746539
Nov 9, 2026
Merged

l2ysho merged 1 commit into
masterfrom
claude/fix-actor-context-fallback-copy-746539

Conversation

@l2ysho

@l2ysho l2ysho commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Note

apify runs ls outside an Actor project failed with "Unable to detect what Actor to create a build for" — a builds message on a runs command. The shared fallback now names no operation and says what to do.

Before

$ apify runs ls
Error: Unable to detect what Actor to create a build for. Please run this command in an Actor directory, or specify the Actor ID.

After

$ apify runs ls
Error: No Actor specified. Pass an Actor ID or "username/name", or run this command from an Actor project directory.

Changes

  • resolveActorContext is shared by runs ls, builds ls, builds create and actors info, so its generic fallback can't name one operation. Rewritten.
  • The four callers each appended their own hint. It duplicated the new copy, and on the "not found" branches it was wrong advice — the user did pass an ID, so changing directory wouldn't help. Removed.
  • Copy-only. No logic, no flags, no exit codes. update-docs produces no diff.

Notes

  • Pre-existing and out of scope, found while reviewing these lines: all four commands exit 0 on this failure, and three write the error to stdout, which breaks --json. Separate PR.
  • actors info can't reach the fallback — its actorId arg is required. The edit there only affects the "not found" branches.

🤖 Generated with Claude Code

The generic fallback in resolveActorContext said "Unable to detect what
Actor to create a build for" for every caller, so `apify runs ls` and
`apify builds ls` blamed builds. It now names no operation and points at
both ways out.

The four callers appended their own recovery hint, which duplicated the
new copy and gave wrong advice on the "not found" branches, so it is gone.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@l2ysho l2ysho added bug Something isn't working. adhoc Ad-hoc unplanned task added during the sprint. t-builders Issues owned by the Builders team. labels Nov 9, 2026
@pkg-pr-new

pkg-pr-new Bot commented Nov 9, 2026

Copy link
Copy Markdown

Open in StackBlitz

npx https://pkg.pr.new/apify-cli@1563

commit: c4efc81

@l2ysho
l2ysho marked this pull request as ready for review November 9, 2026 13:54
@l2ysho
l2ysho requested a review from DaveHanns as a code owner November 9, 2026 13:54
@l2ysho
l2ysho requested a review from apify-factory November 9, 2026 13:55

@apify-factory apify-factory left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, nothing blocking.

🏭 Apify Factory auto approved ✅ — every gate opened, nobody had to knock

Every gate passed, and neither the reviewer nor a juror found anything a human needs to look at.

Approval locked to c4efc81f1 · workflow run

@l2ysho
l2ysho merged commit 9d3eee5 into master Nov 9, 2026
31 of 35 checks passed
@l2ysho
l2ysho deleted the claude/fix-actor-context-fallback-copy-746539 branch November 9, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. bug Something isn't working. t-builders Issues owned by the Builders team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants