plain progress echoes string call arguments unbounded; dot.go already truncates at 256
What happens
--progress=plain echoes string call arguments in full, with no length bound. A module that passes a large string to something like Directory.withNewFile gets the entire value printed back into the container log as a single line:
NNN : ┆ ┆ contents: "…the whole argument, re-escaped…"Measured across six real CI runs of one module, that single line was 28,654 / 28,654 / 31,786 / 31,766 / 149,336 / 149,336 bytes — mean ~70 KB, and between 5% and 28% of each run's entire log.
Why it's awkward downstream
A line that large is not just noisy — it tends not to survive the trip:
- containerd splits a container log line over
max_container_log_line_size(16384) into partial CRI entries, so the value arrives fragmented - log shippers commonly cap line length (Loki's
max_line_sizedefaults to 256KB and is often lowered; ours is 64KB), so the tail is silently truncated
So the echoed value is usually unusable by the time anything reads it, while still costing the full bytes on disk and in transit.
The inconsistency
Dagger already bounds this exact case — but only in one of the two renderers.
dagql/dagui/dot.go:294-296 — bounded:
case *callpbv1.Literal_String_:
if len(val.String_) > 256 {
return "ETOOBIG"
}
return fmt.Sprintf("%q", val.String_)dagql/idtui/frontend.go:563 renderLiteral, line 571 — unbounded, and this is the one --progress=plain and the TUI use:
case *callpbv1.Literal_String_:
fmt.Fprint(out, out.String(fmt.Sprintf("%q", val.String_)).Foreground(termenv.ANSIYellow))Checked at tag v0.21.9 and again on main (frontend.go:908-909) — still unbounded on both.
Reproduction
Any module that passes a large literal:
func (m *M) Big(ctx context.Context) *dagger.File {
big := strings.Repeat("x", 150_000)
return dag.Directory().WithNewFile("out.txt", big).File("out.txt")
}dagger call --progress=plain bigThe whole 150 KB appears on one line as the contents: argument.
Suggested fix
Give renderLiteral the same bound dot.go already applies — truncate with an explicit marker rather than printing the whole value. A digest or a length in the marker would keep it useful for debugging:
case *callpbv1.Literal_String_:
s := val.String_
if len(s) > maxLiteral {
s = fmt.Sprintf("<%d bytes>", len(s))
}
...Happy to send a PR if the approach and the threshold look right — dot.go uses 256, which may be tighter than the TUI wants.
Environment
- Dagger v0.21.9 (behaviour also present on
mainat time of writing) - Linux/amd64, engine in Kubernetes,
dagger call --progress=plainfrom a CI job container
Source: dagger/dagger