Repository navigation
Conversation
Tangle applies an input's default for a container component and for a
run's root graph, never for a graph nested inside another graph. A
subpipeline(child)(...) call that omitted a defaulted child input left it
unset inside the child, and a required consumer failed the submit with
HTTP 422 ("Task has a required input ..., but no upstream artifact and no
default value").
The compiler now writes each omitted defaulted child input into the
parent task's arguments as a constant, from the compiled child body,
right after subpipeline input validation. An argument the caller passes
always wins, inputs without a default stay unset, and every nesting level
applies its own child's defaults. Hydration is unchanged: graphs nested
via ref(...), published graphs or saved pipelines are not rewritten.
This branch has not been deployed
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.
Problem
Tangle's backend applies an input's
defaultonly for a container component and for a run's root graph. It never applies it for a graph component nested inside another graph. So when a parent task calls a nested graph and omits an argument for an input that declares a default, that input is unset inside the child. Any required consumer then fails the whole submit with HTTP 422:An optional consumer quietly falls back to its own default instead of the graph's. This hit discovery's Daily Pulse vLLM saved pipeline, where
Relevancedeclaresverbosewith a default and passes it to a fan-out step whoseverboseinput is required.Fix
In
_process_subpipeline_children, right after_validate_subpipeline_inputs, the compiler now calls_materialize_child_input_defaults(parent_task, child_body). This writes each defaulted child input that the call omits into the parent task'sargumentsas a constant, using the compiled child body as the source of truth. As a result, the backend never has to apply a nested default.default(required ones, or optional ones with no default) stay unset.argumentskey yet, it is inserted right aftercomponentRef, following the canonical task key order.This replaces a tangle-deploy compile hook that wrapped the private
_validate_artifact.Scope decision: hydration is unchanged
Graphs nested by other routes are not rewritten: a
ref(url=...)to a graph YAML, a published graph component, or a saved pipeline. Hydration's contract is to resolvecomponentRefs and leave the rest of the document alone, and downstream tests rely on that byte-for-byte. If those routes need the same treatment, the right place is a pure transform at submit time inPipelineRunner.prepare_pipeline_for_run(after hydration, before validation), as a follow-up PR. The README states the limitation.Tests
tests/test_nested_graph_input_defaults.pyholds behaviour-level tests. Each one compiles and hydrates a pipeline, then works out the effective value each leaf container input receives under Tangle's rules (no nested defaults), rather than checking dict shapes. They cover:graph_input(..., default=...).Full local suite: passed.
uv lockchanges only thetangle-cliversion line.Version: 0.1.35.