Bind a property's rename callback without a default-argument trick 🟪

partial binds plan eagerly and without introducing a parameter the caller
never passes, so there is no late-binding question to reason about.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Daniel Roth 2026-07-29 10:05:29 +00:00
parent 35a3ebe0e3
commit 3e6464fb15

View file

@ -14,6 +14,7 @@ turn a productive run red. Missing folders likewise do not fail a run.
"""
import os
from functools import partial
from typing import Any
from uuid import UUID
@ -104,7 +105,7 @@ def handler(
continue
subtask = orchestrator.create_child_subtask(task_id, inputs=_plan_json(plan))
orchestrator.run_subtask(
subtask.id, work=lambda p=plan: _record(renamer, p, summary)
subtask.id, work=partial(_record, renamer, plan, summary)
)
return _summary_json(summary)