Repository navigation
fix: promote a running step's outputs; answer 400 to a NUL byte in the URL - #770
Merged
Merged
Conversation
A step's outputs become run outputs (WorkflowRunAsset) only when its session ends, so promote_asset called mid-step never found the file the step had just written and failed with "No workflow output asset named …". promote_asset now reads the file from the running container first and falls back to an earlier step's run output. A name that leaves the outputs directory, an empty file and a file the runtime could not read whole are refused. share_asset points at promote_asset for the same case. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
Postgres rejects NUL in a text bind, so a lookup by such a path param (/webhooks/in/%00) raised ArgumentError and answered 500. A middleware at the top of the stack now refuses the request before any route sees it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
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.
Two unrelated production fixes found while triaging errors.
1.
promote_assetfinds a file the running step wroteA step's files in
/workspace/outputsbecome run outputs (WorkflowRunAsset) only inWorkflowStepStrategy#before_cleanup, after the session ends.promote_assetlooked onlyat run outputs, so a step whose instructions say "write report.md and promote it" always
failed with
No workflow output asset named … found in this run. Agents in productionhave started to note that the call "failed as expected".
promote_assetreads/workspace/outputs/<name>from the running container first(
ContainerRuntime#read_file_result), and falls back to an earlier step's run outputof that name. The step's own file wins: it is newer.
../x), an empty file, and a filethe runtime could not read whole (a runner without S3-compatible storage), with the
reason in the error.
AssetExportServicetakes either aWorkflowRunAssetor the newLiveOutput(name +bytes); versioning by name and folder is unchanged.
share_assetexplains in its description and its not-found error that a runningsession's outputs are shared by promoting them first.
/workspace/outputswas spelled out in four places; it is nowAsset::OUTPUT_DIR.2. A NUL byte in the URL answers 400, not 500
POST /webhooks/in/%00raisedArgumentError: string contains null bytefrom the sluglookup (Postgres rejects NUL in a text bind) and answered 500.
Middleware::NullByteGuardsits first in the stack and answers 400 to any request with a NUL byte (raw or
%00) inits path or query string, which covers every route that looks a record up by a path
param, not only the ingress one.
%2500(an encoded%00literal) still passes.Verification
output, fallback to an earlier step's output,
../refused, empty file refused, cutread refused; middleware unit test; ingress
/webhooks/in/%00→ 400.rubocopon the changed files andbrakemanare clean. The full suite is left to CI.Changelog: Assets entry under Fixed for the promote fix; the NUL-byte guard is
internal and has none.
🤖 Generated with Claude Code