Repository navigation
core, idtui: readable errors from entrypoint SDK modules - #15249
Merged
Merged
Conversation
Add fixture modules built with the external, entrypoint-style SDKs (go, python, typescript, php, java, and dang), each with the same functions: one that logs and succeeds, one that logs and fails natively, one that exits with a code, a failing withExec left unhandled and caught-and-wrapped, and a call into a go-sdk dependency whose withExec fails. A copy of each fixture with a syntax error appended, made by the test, covers an SDK's own build or load failing before any function runs. The goldens pin today's output, warts and all, to plan fixes against; the fixture comments in golden_sdks_test.go name what is wrong per SDK. Each failing case also has a collapsed, quiet variant, as a user sees it. The fixtures are generated from viztest/sdks/dagger.toml, a workspace of their own so that regenerating them never touches the repository's config. Two SDKs are pinned to forks with fixes the fixtures need to run at all: php-sdk's sdk-helpers no longer compiles under current Dang (dagger/php-sdk#48), and typescript-sdk's Dang entrypoint misspells cache policies (dagger/typescript-sdk#143). Expanded reports elide what a module entrypoint evaluates: the Dang entrypoint runs it concurrently, so its order varies run to run. The suite's cleanup now removes the dagger.lock the fixtures' image pulls write. Signed-off-by: Alex Suraci <[email protected]>
Generated with engine-dev's testTelemetry, update: true, for TestTelemetry/TestGolden/sdks-. Signed-off-by: Alex Suraci <[email protected]>
Scrub HTTP dates, which a TypeScript client's logged GraphQL error carries, so its golden holds on another day. Keep every indented line of an entrypoint's error when eliding its internals, not just the first level, and remove broken fixture copies an interrupted run leaves behind. The Dang fixture now rescues exactly the GraphQL error an exec raises; it caught it before too, and its golden still shows no wrapping message, because the report renders only the origin. Signed-off-by: Alex Suraci <[email protected]>
Its HTTP date is scrubbed now. Signed-off-by: Alex Suraci <[email protected]>
Each SDK fixture gets a function that logs a line of its own, then calls the dependency whose withExec fails, so the goldens pin where a bubbling function's own logs land. Its goldens record today's output; fixture line shifts move a few stack-trace line numbers in the existing ones. Signed-off-by: Alex Suraci <[email protected]>
Hand-edit the sdks/<lang> goldens to the output we want, so this diff reads current -> desired. They fail until it is implemented; the fail-exec-wrapped goldens keep today's output, since wrapping is deprioritized. The target, per the review guidance: - no module plumbing on screen: no "call module entrypoint" rows or message prefixes, no dispatcher withExec rows, no ::dagger-function-error:: lines, no traceparents; - a bubbled error's origin is the original failure, and intermediate rows show no error of their own, only what the function itself printed; - fail-native and fail-exit-code: the function's logs, then its language error or "exit code: 3", on the function's row; - broken: the compiler's or interpreter's own error output. Test changes that the target implies: TypeScript's log-success now succeeds, so it uses the loose log-success checks like the other SDKs, and its goldens go. Flaky stays only on TypeScript's fail-exec-wrapped, the one racing output left; PHP's fail-exec no longer races. Guesses to confirm: - The SDKs' own stack traces for an unhandled error are dropped from the function's logs; the error message alone is the "!" line, as the built-in runtimes render it (fail-log-native). That includes Python's "ERROR [dagger.mod]" lines. - Collapsed, an origin that is the function row itself shows its logs unindented below it, then "!", the way other collapsed origins do; this also drops Dang's duplicate fail-native rendering. - Collapsed, a bubbling function's own logs are not shown (call-failing-dep-logged-default), as for the built-in Dang runtime today; only the expanded view shows them. - PHP's withExec and Container.from render without the default arguments the PHP client sends, to match the other SDKs. - broken-default: the breadcrumb to a build step is "┇ build ›" (placeholder). Go keeps dagger/go's build.sh withExec row, as the built-in Go runtime's broken-default does; Java's maven build is labelled "build viztest-java [label TBD]" (placeholder) and shows only the javac error line, as if maven ran quietly. Python, TypeScript and PHP fail on the function's own row with the language's error output, trimmed to the user's frame: a Python traceback of the module's line, esbuild's error line, and PHP's standard "PHP Parse error" line (wording guessed). Dang's parse error lands on the "load extra module" row, with a workspace-relative path instead of the engine's /tmp copy. - PHP's log-success stays cached with no logs: the PHP SDK has no cache policy, which isn't a TUI matter. Signed-off-by: Alex Suraci <[email protected]>
Every exec an entrypoint call evaluated was taken for its module process: build steps with API access (the default nesting) got the module, and all of them reported their telemetry and logs to the function call. A failed Java build so showed maven's output on the function row (trace 150bc33a). DAGGER_MODULE_CALL_DIGEST, which every generated entrypoint sets to its callDigest on the exec that runs the function and on no other, is now the engine's contract for that exec (core.ModuleCallDigestEnv): only it serves the module and reports to the function call. The other execs keep their own span and logs, and, not keyed on the module, are shared across modules. An entrypoint that declares no callDigest can't mark its process, so every exec it starts is still taken for it. Entrypoint members such as prebuild key their execs as the entrypoint's calls key their build execs, so a prebuilt file stays the one the calls build. Signed-off-by: Alex Suraci <[email protected]>
The epcaller entrypoint of the serveModule tests declares callDigest but passed it to its process on stdin, so with the module process now marked by DAGGER_MODULE_CALL_DIGEST, its process lost the module. Set the variable, as generated entrypoints do. Signed-off-by: Alex Suraci <[email protected]>
An entrypoint's module process has no current function call to return its
error to, so a failed function failed the call with the process's exec error
("exit code: 2"), or with whatever error its SDK printed for the entrypoint
to parse back out of stderr in Dang.
The engine now gives the module process (core.ModuleCallDigestEnv) a file
for the error, named in DAGGER_FUNCTION_ERROR_PATH: a directory of the exec's
meta mount, bound into the container, so the engine reads the file from the
failed exec's meta snapshot as it reads its stdout and exit code. The path is
injected at run time and never enters the exec's recipe or cache key, the
mount leaves nothing in the process's filesystem, and the file is only read
when the exec fails, so a failed call is still never cached and a success
ignores what the process wrote. The engine reads the first 64 KiB of a
regular file there, and nothing else, such as a named pipe.
The exec error marks the module process's failure for the entrypoint's call
(the moduleProcess and functionError extensions), which fails with it as the
function's own:
- with the error the process wrote: one whose message names an origin, such
as an API error the function returned, keeps it; any other comes from the
function call;
- or, when the process wrote none, as when it died, with its exec error,
exit code and all, but from the function call, not from the exec.
Either way the "call module entrypoint" span is no longer failed by its
function's error, and the call's error no longer reads "call module
entrypoint: ...".
An SDK that finds the variable unset runs on an engine without the file, and
reports its error as before.
Signed-off-by: Alex Suraci <[email protected]>
When a top-level call failed with an error of its own, the collapsed final
report printed its row with a bare error, then repeated the whole call below
the tree, title and error again, only to show its logs:
✘ .failNative: Void ERROR
! failed natively
✘ Viztest.failNative: Void ERROR
function stdout
! failed natively
The row now shows the logs above its error, as the root-cause block did, and
the block has nothing left to add. The built-in Dang runtime's fail-native
renders so too.
Signed-off-by: Alex Suraci <[email protected]>
Pin the Python fixture's SDK to a fork of dagger/python-sdk#93, rebased on main, whose dispatcher writes the function's error to the engine's DAGGER_FUNCTION_ERROR_PATH, and regenerate it. Every sdks-python golden now renders as its hand-edited target, with these differences: - Stack traces are deferred, like wrapping: the function's logs keep the traceback Python prints, "ERROR [dagger.mod]" header included, in fail-native, fail-exec, call-failing-dep and broken-default. The error origins and the error echoed after the traceback are gone. - call-failing-dep keeps the go-sdk dependency's rows as they render today: its ::dagger-function-error:: echo and its failed "call module entrypoint" row are the Go SDK's to fix. - fail-exec-wrapped is still today's output, which these fixes change: no entrypoint row or error origins, and collapsed, the inner withExec with its logs instead of the dispatcher's "exit code: 2". The wrapping message is still lost. The fixture notes drop the failures the engine no longer has. Signed-off-by: Alex Suraci <[email protected]>
The function error file carried only a plain-text message, so an error a
module process reported lost its values: a calling module saw a plain error
where a runtime's process returned an ExecError, exit code and output
included.
The file now holds {"message": ..., "values": {...}}: the error's message in
full, any origin it names ([traceparent:...]) included, and its values, such
as an API error's extensions; or {"id": ...}, an Error the process built;
any other text is the message, as before. The call returns the reported
Error as a runtime's process returns one with returnError, and gives it its
origin the same way (functionCallErrorWithOrigin, shared by both): a
traceparent value, else the origin its message names, else the runtime's
failure's, else the function call. Naming the message's origin ahead of the
runtime's is new for returnError too, which put the runtime's in the values
of an error whose message named another.
The file's raw content never reaches the caller: the exec error carries the
parsed report to the entrypoint's call only. The engine reads a file of up
to 1 MiB; a larger one is no report, and the call fails with the process's
exec error, as when it wrote none.
Signed-off-by: Alex Suraci <[email protected]>
Repin the python-sdk fork to af35286, which writes the error file as JSON with the message and the exception's values. The goldens are unchanged. Signed-off-by: Alex Suraci <[email protected]>
A plain-text error that happens to be a JSON object, such as an HTTP API's
{"id": "not_found", "message": "..."} body, was read as a structured report:
its other fields were dropped, or the call failed decoding a bogus Error ID.
Now only an object that is exactly {"message", "values"} or a lone {"id"}
holding an Error ID is structured; anything else is the message. A report
the call still can't return (an ID that doesn't load) leaves the call the
exec's error instead of a decode failure, without the raw report.
Signed-off-by: Alex Suraci <[email protected]>
The fork now trims an error report to fit the engine's 1 MiB limit, takes an API error's values only from the exception it was raised from, and keeps a FunctionError's extra values. The goldens are unchanged. Signed-off-by: Alex Suraci <[email protected]>
Also say in moduleProcessFunctionError that an Error ID which doesn't load fails the call as returnError's does, rather than falling back. Signed-off-by: Alex Suraci <[email protected]>
dagger/python-sdk's entrypoint-function-error branch now holds the same commits, so pin it by the same SHA. Signed-off-by: Alex Suraci <[email protected]>
Only the README changed, so the fixture and goldens are unchanged. Signed-off-by: Alex Suraci <[email protected]>
Not every failure is an exec's. fail-api prints a line, then reads a file that doesn't exist with a plain core API (directory().file(...).contents()), the error unhandled. Add it to all six SDK fixtures, regenerate them, and record today's output, expanded and -default, as the baseline the target edit diffs against. Signed-off-by: Alex Suraci <[email protected]>
Hand-edit the go, java, php and typescript fail-api goldens to the output we
want, following the earlier SDK targets: the failed API call is the origin,
with its own message; the function's row keeps only what the function
printed; no "call module entrypoint" row, ::dagger-function-error:: line,
stack trace, dispatcher reply or traceparent.
Judgment calls:
- The origin is Directory.file(path: "doesnt-exist.txt"), not .contents:
the stat fails resolving file(), so no .contents row ever renders. Its row
is the "!" message alone, with no logs, since an API call has none; that
is how the dang reference and every SDK's collapsed golden render it today.
- The go, java and php -default goldens already render the target, so they
stay as recorded; only typescript's changes, from its dispatcher's
"exit code: 2" with the whole client error dump to the origin row.
- python and dang are unchanged. Dang is the reference. Python renders the
target except for its traceback ("ERROR [dagger.mod]" through
"dagger.QueryError: ...") on the function's row, which stays as in its
other goldens: stack traces are deferred, and its goldens record what it
renders.
Signed-off-by: Alex Suraci <[email protected]>
Pin go-sdk to dagger/go-sdk#113 (5ed109c), whose dispatcher writes a function's error to the engine's DAGGER_FUNCTION_ERROR_PATH and whose entrypoint raises the exec error that carries it as it is, and regenerate the go fixture and the shared dep, a go-sdk module. Every sdks-go golden now renders as its target, fail-api included, except broken-default: its "┇ build ›" breadcrumb is still a placeholder, and the real one lists the entrypoint's dagger/go calls. Its compiler error moved to ./main.go:93:9 when fail-api grew the fixture. The dep's rows are now clean in every SDK's call-failing-dep goldens, as the targets have them, so the Python ones drop the rows relaxed for it: the ::dagger-function-error:: echo and the failed "call module entrypoint". The dep's failure also reaches Python as an ExecError, values and all, so its traceback ends in dagger.ExecError rather than dagger.QueryError. Go's fail-exec-wrapped, which records today's output since wrapping isn't targeted, loses the same entrypoint row, marker and traceparent, and with the echo the wrapping message: it is now nowhere, even expanded, as for dang. The fixture notes say so. Signed-off-by: Alex Suraci <[email protected]>
Calling the viztest go-sdk dep's failing function gets an ExecError with the inner exec's exit code, output and command, and no entrypoint plumbing: the go-sdk counterpart of the function error file's value tests. Signed-off-by: Alex Suraci <[email protected]>
Repin python-sdk#93 to e711bad: when the engine gives a call's process the function error file, an API error that escapes a function is no longer logged with its traceback. The failing call already renders as the origin, with its logs, and the caller still gets the typed ExecError and its values from the file. The call-failing-dep, call-failing-dep-logged, fail-api and fail-exec goldens lose the "API error while executing function" traceback. A function's own exceptions (fail-native, fail-exec-wrapped) still log theirs. Signed-off-by: Alex Suraci <[email protected]>
The Python fixture's comment still read as if every unhandled error left a traceback in the function's logs; only the function's own exceptions do now. Signed-off-by: Alex Suraci <[email protected]>
Repin python-sdk#93 to a67b7a2: with the function error file, a function's own exception, and an error importing its code, are shown as Python shows an uncaught one, through the user's frames only, without the "Unhandled exception" and "Error while importing" log lines. The vendored dispatcher files are copied from it. fail-native, fail-native-default, fail-exec-wrapped and broken-default lose the SDK, generated client and importlib frames. fail-exec-wrapped keeps the chain: the inner ExecError with the user's line that got it, then "The above exception was the direct cause". Signed-off-by: Alex Suraci <[email protected]>
The Python fixture's comment still called the function's traceback not targeted yet; the short traceback through the user's frames is now the target these goldens pin. Signed-off-by: Alex Suraci <[email protected]>
python-sdk#93 now keeps the frames of the user's own libraries, which the runtime installs from the module's workspace, not editable, in a short traceback, and leaves the API errors whose origin the engine shows out of a task group's error. The vendored dispatcher files are copied from it; the goldens are unchanged. Signed-off-by: Alex Suraci <[email protected]>
fsutil.Stat clears a socket's type bit, so a socket at the function error path passed as a regular file, and its open failed the call. LstatFile now returns os.Lstat's info, whose mode has every type bit, so a socket is no report, as any other file that isn't regular. Signed-off-by: Alex Suraci <[email protected]>
"loading type definitions" never stood for its work, even with no "load module" row beneath it to name the failure, as when the CLI loads a served module's type definitions under its own load. It now stops standing for its work only once the breadcrumb has passed a load row, and the load's plumbing is left out only beneath that row. Signed-off-by: Alex Suraci <[email protected]>
The spans of a module SDK's work on a module read "module SDK: load runtime", "module SDK: build runtime", "module SDK: load typedefs object" and "module SDK: run codegen": what the SDK does, not to which module. They now read "build <module>", "introspect <module>" and "generate <module>", as an entrypoint's build already reads "build <module>", so a breadcrumb through one names the module. Signed-off-by: Alex Suraci <[email protected]>
The engine's "load module: <ref>" span showed its steps beneath it, and the CLI's "loading type definitions" encapsulated every module's load instead, so it was the row a load's failure was told under, and the TUI had to know its name to look past it. The load span now encapsulates its own steps. The CLI's "load workspace: ." and "load module: <ref>" encapsulate theirs, and "loading type definitions" is internal: still encapsulating, so the type definition queries of a caller with no span of its own, such as initializeCore, don't show. Signed-off-by: Alex Suraci <[email protected]>
The breadcrumb to an error's origin knew the CLI's "loading type definitions", the engine's "load module: " spans and a load's plumbing by name. Now the spans carry what it needs (the load encapsulates its steps, the CLI's type definition load is internal), and it reads only the encapsulation: every shown ancestor that encapsulates its work is named, a landmark for the work beneath it, and the steps between landmarks, and between the innermost one and the origin, fold away. The ancestors above the outermost landmark are named as before. Goldens: - a module's failed load reads "load module: <ref> › build <module> ›"; a broken dependency's, its dependent's load and its own build; - a Dang module's, "load module: <ref> ›" above its typecheck; - the expanded goldens lose the "loading type definitions" row, and a failed load shows its build beneath it, without the engine's internal calls between them; - broken-dep-sdk-use-invalid-default is new, the default view of a module whose dependency's SDK doesn't load. Signed-off-by: Alex Suraci <[email protected]>
"loading type definitions" was internal, so beneath a caller that doesn't encapsulate its work, such as the shell's start and `.refresh`, a failure's breadcrumb named the queries' calls instead. loadTypeDefs now starts no span: "load workspace: ." and "load module: <ref>" stand for it, and the two callers with no span of their own start an encapsulating "loading type definitions" one. `dagger listen`'s "load module: <ref>" encapsulates its steps too, as initializeModule's does. Also: say in passesOnFailure's doc which of the engine's steps a load's encapsulation now passes through, and drop the "loading type definitions" row from module-type-return-fail, a fuzzy golden no update rewrites. Signed-off-by: Alex Suraci <[email protected]>
TestInternalFailureGivesPlaceToItsCause traced a module load that didn't encapsulate its steps, under the CLI's "loading type definitions": a shape no trace has since the load encapsulates them. With the real one, the engine's internal load of a dependency gives its place to the dependency's failed build, which the test now asserts, rather than that it shows. Signed-off-by: Alex Suraci <[email protected]>
A dependency whose SDK failed to load showed only as "load SDK: unknown"
beneath its dependent's load, so nothing said which dependency it was. The
span now reads "load SDK for <module>: <sdk>", as a module SDK's steps name
the module ("build <module>"), and "load SDK: <sdk>" without one.
broken-dep-sdk/use-invalid and its -default show "load SDK for invalid:
unknown".
Signed-off-by: Alex Suraci <[email protected]>
With the module load's fixture now encapsulating, nothing tested that a failed internal span beneath a shown step that doesn't encapsulate keeps its row, though a failure is beneath it: removing that rule from inFailedEncapsulation passed every test. Signed-off-by: Alex Suraci <[email protected]>
vito
marked this pull request as ready for review
November 22, 2026 20:26
The breadcrumb of an error origin beneath the row it bubbled up to moves from idtui into dagui, so that Dagger Cloud's web UI names the same ancestors the TUI does: TraceTree.ErrorCauseBreadcrumb walks a tree's parents, Span.ErrorCauseBreadcrumb its parent spans, by the same rules. Passthrough ancestors are left out too, as no frontend shows them as a row of their own; the TUI's trees never held one outside debug mode. For an origin the view doesn't place, idtui now walks its parent spans. The synthetic tree it built instead linked its parents in reverse, the row first, so that breadcrumb was always empty. Signed-off-by: Alex Suraci <[email protected]>
Add viztest/sdks/ruby, a module of the external Ruby SDK (dagger/ruby-sdk at 754e000, its current main) with the functions every SDK fixture has, generated from viztest/sdks/dagger.toml, and record its goldens as today's output. Its entrypoint declares callDigest but marks no exec with DAGGER_MODULE_CALL_DIGEST, so no exec is the module process: every failure renders on the dispatcher's withExec, with its stdin and full stack trace, and log-success's logs never reach the function's row (logsOnExec). The broken-default baseline names the request's moduleSource ID, which varies between runs; the target drops that row. Signed-off-by: Alex Suraci <[email protected]>
Hand-edit the Ruby SDK's goldens to the output we want, the shapes the other SDKs' approved goldens have: no dispatcher withExec on screen, the function's logs on its row, a short trace in Ruby's own form through the module's own frames only, nothing for an API error whose origin the engine shows, the original failure as the origin, and Ruby's SyntaxError for a module that doesn't parse, its first line as the error. log-success checks the function's logs on its row again. Signed-off-by: Alex Suraci <[email protected]>
Pin ruby-sdk to dagger/ruby-sdk#11 (6ba32f1) and regenerate the fixture: its entrypoint marks the dispatcher's exec as the module process and declares prebuild, and the dispatcher reports a function's error in the engine's file, with a short trace of the module's own frames in Ruby's own form. Every sdks-ruby golden now matches its target, unchanged. Signed-off-by: Alex Suraci <[email protected]>
Pin ruby-sdk to c363132, whose dispatcher logs a SyntaxError exactly as ruby prints it, syntax_suggest's section included, per the native-output rule. Only sdks/ruby/broken-default changes: that section now precedes Ruby's error. Signed-off-by: Alex Suraci <[email protected]>
The function error file holds exactly {"message", "values"} or {"id"}. Plain
text, malformed JSON, and anything else that isn't one of those objects, is
an SDK's bug, no longer the error's message: the call fails with an error
that names the invalid report and why, and the module process's own
failure, from the function call, with its ExecError's values, so its exit
code and output aren't lost. An empty or missing file still reports
nothing.
Signed-off-by: Alex Suraci <[email protected]>
vito
added a commit
to dagger/java-sdk
that referenced
this pull request
Nov 23, 2026
The engine no longer takes a report with an empty message for plain text: it reads only a JSON report with a message or an Error ID, and rejects any other as invalid (dagger/dagger#15249). Comments only. Signed-off-by: Alex Suraci <[email protected]>
vito
added a commit
to dagger/ruby-sdk
that referenced
this pull request
Nov 23, 2026
The engine no longer takes a report with an empty message for plain text: it reads only a JSON report with a message or an Error ID, and rejects any other as invalid (dagger/dagger#15249). Comments only. Signed-off-by: Alex Suraci <[email protected]>
vito
added a commit
to dagger/php-sdk
that referenced
this pull request
Nov 23, 2026
The engine no longer takes a report with an empty message for plain text: it reads only a JSON report with a message or an Error ID, and rejects any other as invalid (dagger/dagger#15249). Comments only. Signed-off-by: Alex Suraci <[email protected]>
Pin java-sdk to 96d3510, php-sdk to 5771a9b and ruby-sdk to 49d17cb, whose comments now say the engine reads only a JSON function error report and rejects one with an empty message. The vendored ModuleDispatcher.java (and its checksum), FunctionError.php and error_report.rb follow them; comments only, so the sdks-java, sdks-php and sdks-ruby goldens are unchanged. Signed-off-by: Alex Suraci <[email protected]>
sipsma
approved these changes
Nov 24, 2026
Use %w for the JSON syntax error so errorlint passes and callers can unwrap it. Signed-off-by: Alex Suraci <[email protected]>
eunomie
pushed a commit
to eunomie/go-sdk
that referenced
this pull request
Nov 24, 2026
An engine that names a file for the function's error (DAGGER_FUNCTION_ERROR_PATH, dagger/dagger#15249) now gets it there from every dispatcher, whatever the module targets: {"message", "values"}, the message in full with the origin it names, and the extensions of the GraphQL error it wraps as they are, so a caller gets a typed ExecError with its exit code and output. The dispatcher then prints nothing of its own; the report is shortened only past the engine's 1 MiB limit. Without the variable, or a file it can write, it falls back to the stderr markers older engines read. The generated entrypoint raises a module process's exec error as it is, so the engine's handling of it is never preempted by the marker parsing or the Dagger Error rebuilt from the values marker. Signed-off-by: Alex Suraci <[email protected]>
eunomie
pushed a commit
to eunomie/typescript-sdk
that referenced
this pull request
Nov 24, 2026
A dispatcher under a module entrypoint replied on stdout, which the function's own console.log shares: a function that logged and returned failed with "JSON.decode: invalid JSON", and one that logged and threw lost its message to "exit code: 2". A module that didn't compile failed the process before the dispatcher ran, as "exit code: 1". - The result goes to /dagger/result.json, named on the command line, which call() reads back once the exec succeeded. - A failed call's error goes to the function error file the engine names in DAGGER_FUNCTION_ERROR_PATH (dagger/dagger#15249): the full message, origins kept, and the extensions of the API error it is or wraps, followed by exit code 2. call() raises the exec error unchanged when it carries the engine's functionError. An engine without the file gets a `::dagger-function-error::` marker on stderr, as go-sdk prints it. - In error-file mode the call's logs get a short stack trace of the module's own frames only, causes included and traceparents stripped, and nothing for an API error whose origin the engine shows. A TransformError, the module failing to compile, is esbuild's own error lines, with its summary as the call's message. - The module's code is imported for its types only and loaded with import() by loadModule, so a load or compile error is reported like any other. There is no prebuild: tsx compiles at run time, so there is no build step to show under `build <module>`. Signed-off-by: Alex Suraci <[email protected]>
Pin the external SDKs to their releases, which merged the error-file PRs: go-sdk v1.7.0, python-sdk v1.9.0, typescript-sdk v1.2.0, php-sdk v1.2.0, java-sdk v1.3.0 and ruby-sdk v1.3.0. Regenerated with them: go-sdk no longer generates a module's bindings to itself (viztest-go.gen.go, sdk-dep.gen.go) and its entrypoints say they need beta.26; python-sdk's build takes uv 0.13.9; typescript-sdk's entrypoint keys its install by content and runs its setup execs without nesting. The java, php and ruby tags match their old pins. The sdks-* goldens are unchanged. Signed-off-by: Alex Suraci <[email protected]>
vito
force-pushed
the
viztest-external-sdks
branch
from
November 24, 2026 16:35
d73fd8d to
4ab628f
Compare
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.
Make the errors and logs of modules built with the external, entrypoint-style SDKs (
github.com/dagger/{go,python,typescript,java,php,ruby}-sdk) and of Dang modules readable in the TUI. A failed function now shows its own error as the call's error, the original failure is the origin, no module plumbing is on screen, and the logs of what failed are shown. A module that fails to load says which module, and which step of it.It comes with golden tests for every SDK (
TestTelemetry/TestGolden/sdks-<lang>-<case>), which measure all of this. The SDK side landed in one PR per SDK, listed below, all merged and released; the fixtures pin those releases.Full before/after report of every changed golden: https://gistpreview.github.io/?cfe7c9bc20afecc5f999af46c3b05cea
Engine
DAGGER_MODULE_CALL_DIGEST(core.ModuleCallDigestEnv) is now engine contract. An entrypoint that declares thecallDigestargument ofcallsets it on the one exec that runs the function, and the engine takes only that exec for the module process: it alone gets the module, reports to the function call's span, and gets the function error file. Its other execs, such as the module's build, keep their own span and logs, and aren't keyed on the module. Without acallDigest, every exec is the process, as before.DAGGER_FUNCTION_ERROR_PATH, a file in the exec's meta mount, outside its filesystem and its cache key. A process whose function fails writes the function's error there and exits non-zero, and the call fails with that error as the function's own: its message and values, or anErrorby ID, with the origin the error names, else the function call. That replaces the::dagger-function-error::stderr marker, thecall module entrypoint:prefix, and the plumbing span failing alongside. Without a report, the call fails with the process's exec error, exit code included, from the function call.load module: <ref>span fails with the load's error (it ended OK before) and encapsulates its steps. The SDK steps beneath it name the module:module SDK: load runtime/build runtime→build <module>,load typedefs object→introspect <module>,run codegen→generate <module>, andload SDK: <sdk>→load SDK for <module>: <sdk>.typecheck <module>, which is where a source error is reported and originates, for every load that shares the pass, a broken dependency's own included. The report drops Dang'sfailed to parse file <path>:wrapper and names files by their path in the module, not the engine's/tmpcopy. An entrypoint'sprebuildmember is built, and synced, underbuild <module>beforecall(cached after the first), and a nested client request made under a span of its own keeps it, so a module's build is one span over its calls.TUI
┇ load module: ./viztest/broken-dep/broken › build broken ›. The rule lives in dagui (TraceTree.ErrorCauseBreadcrumb,Span.ErrorCauseBreadcrumb), so other frontends, such as Dagger Cloud's, share it.loading type definitionsis no longer a row of the workspace's or a module's load: the CLI'sload workspace: .andload module: <ref>spans encapsulate it (anddagger listen's too). A load of the core API's alone (initializeCore:dagger callanddagger functionswithout a module, the shell's start) and the shell's.refresh, which have no span of their own, still start one.SDK implementor contract
What an entrypoint SDK must and may do now. ★ marks what this PR adds; the rest existed, and is now load-bearing.
callDigestargument of the entrypoint'scall(nullable)DAGGER_MODULE_CALL_DIGEST(core.ModuleCallDigestEnv)callDigestis declared: set it to thecallDigestreceived, non-empty, on that exec and no other. The last setting in the exec's env wins. A build exec that sets it is taken for the module process.DAGGER_FUNCTION_ERROR_PATH(engineutil.FunctionErrorPathEnv)prebuildentrypoint memberbuild <module>span beforecall(cached after the first), aftercallDigestis set, so its execs are build execs, not the module process.::dagger-function-error::stderr lineDAGGER_FUNCTION_ERROR_PATHis unset, on older engines.The function error file (
core.ParseFunctionErrorReport) holds exactly one of these JSON objects:{"message": "<the full error text>", "values": {"<name>": <any JSON>, …}}: the message whole, any[traceparent:…]origin it names kept in-band; the values as the error's GraphQL extensions, e.g. an API error's verbatim (_type,cmd,exitCode,stdout,stderrfor anExecError), plus the SDK's own.{"id": "<Error ID>"}: a DaggerErrorthe process built.message, anidbeside amessageorvalues, anidthat is noErrorID, or content after the object. The call then fails from the function call withinvalid function error report: <why>; the module process failed with: <the exec's error>, carrying the exec'sExecErrorvalues (exitCode,stdout,stderr,cmd), so the process's own failure and exit code aren't lost.Read rules (
engineutil.ReadSnapshotSmallFile), only when the exec fails:MaxFunctionErrorBytes), or an empty one.The generated Dang entrypoint raises the exec's error unchanged (not rescued, or rescued and raised as it was), so the engine sees that it is the module process's. The engine's
moduleProcessandfunctionErrorextensions never reach callers.Logs, as the goldens pin them for every SDK:
[traceparent:…]from what the process logs.PHP Parse error, a Python traceback, Maven's quiet errors). No custom renderings.SDK PRs
All merged and released; each pin is the tag
dagql/idtui/viztest/sdks/dagger.tomlnames.v1.7.0(fedaced)v1.9.0(e816d08)v1.2.0(73806b6)console.logno longer corrupts it; short stack traces; loads the module's code itself, so a compile error is esbuild's. On top of #143.v1.2.0vito/typescript-sdkcache: "session"fails to load.v1.3.0(1c1ae27)prebuild, and Maven builds the jar quietly in an exec of its own, so a build failure shows the compiler's errors.v1.2.0(bb1fd91)prebuild, the Composer install. On top of #48.v1.2.0vito/php-sdkv1.3.0(b09b640)prebuild, thebundle install.dang-sdk@14ba9d3=mainBefore → after
The default, collapsed view a user sees, generated from the goldens. "Before" is
mainfor a goldenmainhas, and otherwise the output the PR first recorded as a baseline, before hand-editing targets; the report linked above has every changed golden, expanded ones included, by the same rule.go
sdks/go/broken-default(before: the PR's baseline, 640d056)sdks/go/fail-native-default(before: the PR's baseline, 640d056)python
sdks/python/broken-default(before: the PR's baseline, 640d056)sdks/python/fail-native-default(before: the PR's baseline, 640d056)sdks/python/fail-exec-default(before: the PR's baseline, 640d056)sdks/python/call-failing-dep-default(before: the PR's baseline, 640d056)typescript
sdks/typescript/broken-default(before: the PR's baseline, 640d056)sdks/typescript/fail-native-default(before: the PR's baseline, 640d056)java
sdks/java/broken-default(before: the PR's baseline, 640d056)sdks/java/fail-native-default(before: the PR's baseline, 640d056)php
sdks/php/broken-default(before: the PR's baseline, 640d056)sdks/php/fail-native-default(before: the PR's baseline, 640d056)ruby
sdks/ruby/broken-default(before: the PR's baseline, bc1cf30)sdks/ruby/fail-native-default(before: the PR's baseline, bc1cf30)sdks/ruby/fail-exec-default(before: the PR's baseline, bc1cf30)sdks/ruby/call-failing-dep-default(before: the PR's baseline, bc1cf30)dang
sdks/dang/broken-default(before: the PR's baseline, 640d056)sdks/dang/fail-native-default(before: the PR's baseline, 640d056)Module loads
broken-default(before: main)broken-dep-use-broken-default(before: main)broken-dep-sdk-use-invalid-default(new)Already as wanted at the PR's baseline, so not shown:
sdks/go/fail-exec-default,sdks/go/call-failing-dep-default,sdks/typescript/fail-exec-default,sdks/typescript/call-failing-dep-default,sdks/java/fail-exec-default,sdks/java/call-failing-dep-default,sdks/php/fail-exec-default,sdks/php/call-failing-dep-default,sdks/dang/fail-exec-default,sdks/dang/call-failing-dep-default.The goldens
dagql/idtui/viztest/sdks/<lang>/, one per SDK, with the same functions, so the goldens line up across SDKs;viztest/sdks/depis a shared go-sdk dependency. They are generated fromviztest/sdks/dagger.toml, a workspace of its own, so regenerating them never touches the repo'sdagger.toml. Most of the diff is generated SDK code, markedlinguist-generated.log-success,fail-native,fail-exit-code(not for dang, which has no process),fail-exec,fail-exec-wrapped,fail-api(a core API call that fails),call-failing-dep,call-failing-dep-logged, andbroken(a copy of the fixture with a syntax error appended).-v) and a-defaultone, collapsed and quiet;brokenonly-default. New:broken-dep-sdk-use-invalid-default.idtui: target output for external SDK goldens(and…for the fail-api goldens) hand-edits them to the wanted output; each SDK's pass then makes its goldens pass. Expanded goldens elsewhere lose theloading type definitionsrow."linux/ARCH",GOARCH=ARCH), Dang temp-path digests, HTTP dates and the⋯ waitedsuffix. Expanded goldens elide the children of a nestedcall module entrypointspan, which the Dang entrypoint evaluates concurrently, so their order varies.log-successis checked loosely: the result renders as a log line that races the function's own logs.Deferred
withExec(fail-exec-wrapped*). Expanded, Python, TypeScript, PHP, Java and Ruby show the cause chain in their trace; Go and Dang show no wrapping message at all.withExec,Container.from), until php-sdk's codegen omits them.log-successis cached and its logs aren't seen again.exit code: N; the exec's logs, on its row, tell the rest.