Don't drop shared inputs when switching task versions in the launch form - #7719
Merged
Conversation
EngHabu
previously approved these changes
Jul 28, 2026
ursucarina
enabled auto-merge (squash)
July 28, 2026 17:12
ursucarina
disabled auto-merge
July 28, 2026 18:19
Signed-off-by: Carina Ursu <carina@union.ai>
ursucarina
force-pushed
the
carina/converterfix
branch
from
July 28, 2026 18:22
ad5b7d1 to
dbdb1ba
Compare
ursucarina
enabled auto-merge (squash)
July 28, 2026 18:23
pingsutw
approved these changes
Jul 28, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
dataproxy/converter/literal_json_converter.go:399
logger.Warnfis emitted once per skipped literal. In cases where the target interface drops many fields (or has no inputs at all), this can generate a large number of warnings for a single conversion and add noise/cost in logs. Consider collecting skipped literal names during the loop and logging a single warning after the loop (similar to the aggregated unmapped-field warning inJSONValuesToLiterals).
// inputs the two versions *share* are still preserved. Mirrors the
// unmapped-field handling in JSONValuesToLiterals.
logger.Warnf(ctx, "skipping literal %q with no corresponding variable in the target interface (ignoring)", literal.GetName())
continue
}
| // them (with a warning) instead of failing the whole conversion, so the | ||
| // inputs the two versions *share* are still preserved. Mirrors the | ||
| // unmapped-field handling in JSONValuesToLiterals. | ||
| logger.Warnf(ctx, "skipping literal %q with no corresponding variable in the target interface (ignoring)", literal.GetName()) |
Contributor
There was a problem hiding this comment.
can we make this debug?
3 tasks
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.
Why are the changes needed?
When rerunning a run in the launch form and switching to a different task version, the form re-converts the original run's inputs against the selected version's interface via LiteralsToLaunchFormJson. That function returned an error the moment it hit a literal whose variable didn't exist in the target interface — which failed the entire conversion, so every input got dropped rather than just the one that no longer applies.
This produced an asymmetry when the two versions declare different inputs. For example, v3 has {name, count} and v17 has {name}:
The sibling conversion (JSONValuesToLiterals) already handles the analogous mismatch gracefully by ignoring unmapped fields with a warning. This change makes LiteralsToLaunchFormJson consistent: it skips literals that have no corresponding variable in the target interface (logging a warning) instead of erroring, so inputs shared between the two versions survive the switch in both directions.
What changes were proposed in this pull request?
LiteralsToLaunchFormJson no longer errors when a literal has no corresponding variable in the target VariableMap. Instead of returning CodeInvalidArgument and failing the whole conversion, it now skips that literal (logging a warning) and continues, so the literals that do map are still converted. This mirrors the existing unmapped-field handling in JSONValuesToLiterals.
Added a regression test that converts {name, count} against a {name}-only interface and asserts name is preserved with its value while count is dropped.
How was this patch tested?
Unit test in runs/service/converter/literal_json_converter_test.go — a new TestLiteralsToJsonSchema subtest converts a run's {name, count} literals against a target interface that only declares {name}, and asserts the call succeeds, name is preserved with its value, and the unmapped count is dropped. Ran go test ./runs/service/converter/..., all passing.
Also verified manually in the launch form: rerunning a run and switching from a higher-input version to a lower-input version now keeps the values for the shared inputs instead of clearing everything.
Labels
Please add one or more of the following labels to categorize your PR:
This is important to improve the readability of release notes.
Setup process
Screenshots
Check all the applicable boxes
Related PRs
Stack
If you do use
git townto manage PR Stacks, the stack relevant to this PRwill show below. Otherwise, you can ignore this section.
Docs link