Skip to content

feat: add implicit run names with auto_memoize_child_runs - #1249

Open
vdusek wants to merge 3 commits into
feat/child-run-registryfrom
fix/list-unnamed-child-runs
Open

vdusek wants to merge 3 commits into
feat/child-run-registryfrom
fix/list-unnamed-child-runs

Conversation

@vdusek

@vdusek vdusek commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Part 2 of 6 of the final specification of Actor composability: "Implicit run names". Stacked on #1270.

  • New switch Configuration.auto_memoize_child_runs (env var APIFY_AUTO_MEMOIZE_CHILD_RUNS), off by default.
  • With the switch on, a call without a run_name uses the checksum of its request as an implicit run name, recorded under implicit:<checksum>. An identical call (same Actor or task, input, and checked run options) returns the recorded run, also in a later process of the parent.
  • Such a call needs a JSON input, since without the input, calls with different inputs would share a run. Any other input raises a TypeError.
  • A call with a run_name uses that name, whatever the switch.
  • With child run tracking off, the switch makes the Actor start fail with a ValueError.

Closes: #1127

✍️ Drafted by Claude Code

@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Nov 12, 2026
@vdusek vdusek self-assigned this Nov 12, 2026
@codecov

codecov Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.01%. Comparing base (e3a8982) to head (96ccede).

Additional details and impacted files
@@                     Coverage Diff                     @@
##           feat/child-run-registry    #1249      +/-   ##
===========================================================
+ Coverage                    94.00%   94.01%   +0.01%     
===========================================================
  Files                           54       54              
  Lines                         4020     4029       +9     
===========================================================
+ Hits                          3779     3788       +9     
  Misses                         241      241              
Flag Coverage Δ
e2e 31.14% <27.27%> (+<0.01%) ⬆️
integration 50.38% <36.36%> (-0.02%) ⬇️
unit 91.36% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek vdusek changed the title fix: list unnamed child runs in Actor.child_runs feat: track child runs started without a run_name Nov 12, 2026
@vdusek vdusek changed the title feat: track child runs started without a run_name feat: track and reuse child runs started without a run_name Nov 12, 2026
@vdusek
vdusek added this pull request to stack #1252 November 12, 2026 11:46
@vdusek vdusek changed the title feat: track and reuse child runs started without a run_name fix: track and reuse child runs started without a run_name Nov 12, 2026
@vdusek
vdusek removed this pull request from stack #1252 November 20, 2026 16:33
@vdusek
vdusek force-pushed the fix/list-unnamed-child-runs branch from 5ca3e05 to d058548 Compare November 20, 2026 16:34
@vdusek
vdusek changed the base branch from master to feat/child-run-registry November 20, 2026 16:34
@vdusek
vdusek added this pull request to stack #1274 November 20, 2026 16:35
@vdusek vdusek changed the title fix: track and reuse child runs started without a run_name feat: track and reuse child runs started without a run_name Nov 20, 2026
@vdusek
vdusek force-pushed the fix/list-unnamed-child-runs branch from d058548 to 49b3fff Compare November 20, 2026 17:52
@vdusek
vdusek marked this pull request as ready for review November 20, 2026 17:58
@vdusek
vdusek requested review from Pijukatel and barjin November 20, 2026 17:58
@Pijukatel

Pijukatel commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Not sure if this review comment should be here or step 3.

I think that these behaviors should still work even for implicitly named child runs (EXTRA BEHAVIORS):

  • abort_with_parent
  • resurrect_with_parent
  • max_concurrent_child_runs
  • ?did I forget something else?

They should be controlled only by that option, not by the Configuration.persist_unnamed_child_runs. From my point of view that flag should control only the controversial part, which is the automatic memoization. I would probably change the flag to Configuration.cache_unnamed_child_runs or Configuration.memoize_unnamed_child_runs ...

So I would be in favor of always persisting the child runs. The EXTRA BEHAVIORS should be only controlled by the arguments when starting the run, not by the global flag. The runs can be persisted with all these options persisted, so I do not see any implementation obstacle here. If the problem is same hash, then there is a lot of possible workarounds. For example when Configuration.persist_unnamed_child_runs (or whatever the name will be) is set, than we do not need the hash at all and we can just use child run id as the key for this record (which is unique).

@vdusek
vdusek force-pushed the fix/list-unnamed-child-runs branch from 92dc795 to 9eb482b Compare November 27, 2026 14:12
@vdusek
vdusek removed this pull request from stack #1274 November 27, 2026 14:16
@vdusek
vdusek added this pull request to stack #1286 November 27, 2026 14:16
@vdusek vdusek changed the title feat: track and reuse child runs started without a run_name feat: add implicit run names with auto_memoize_child_runs Nov 27, 2026
@vdusek vdusek removed the adhoc Ad-hoc unplanned task added during the sprint. label Nov 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Named child runs that survive migration and resurrection

2 participants