Repository navigation
fix(cli): preserve frontend output with bounded backpressure - #14886
Merged
Merged
Conversation
tiborvass
force-pushed
the
codex/lossless-frontend-logs
branch
from
October 27, 2026 17:13
6f316e6 to
b18c057
Compare
This was referenced Oct 27, 2026
tiborvass
force-pushed
the
codex/lossless-frontend-logs
branch
from
October 28, 2026 15:44
868dac9 to
b3d6b7b
Compare
tiborvass
marked this pull request as ready for review
October 28, 2026 18:11
tiborvass
force-pushed
the
codex/lossless-frontend-logs
branch
2 times, most recently
from
October 28, 2026 19:18
03396b9 to
bc6ecb3
Compare
tiborvass
force-pushed
the
codex/lossless-frontend-logs
branch
from
October 28, 2026 20:53
ce9303f to
cfeb253
Compare
tiborvass
force-pushed
the
codex/lossless-frontend-logs
branch
from
October 28, 2026 21:34
cfeb253 to
03915a9
Compare
vito
approved these changes
Oct 28, 2026
tiborvass
force-pushed
the
codex/lossless-frontend-logs
branch
5 times, most recently
from
October 28, 2026 22:33
34bc008 to
f07056d
Compare
tiborvass
force-pushed
the
codex/lossless-frontend-logs
branch
from
October 29, 2026 07:16
f07056d to
277ee58
Compare
Large CLI output can fill the telemetry batch queue and silently lose rows while the command exits successfully. Use BlockingLogProcessor for command stdio and engine logs forwarded to the local frontend across CLI commands. Route default slog diagnostics through a separate SDK batch processor that writes to stderr, so consumer warnings and cleanup logs cannot wait on the command output queue. Keep this routing private to CLI telemetry setup and leave remote exporters best-effort. Give EOF emission and local queue draining one independent shutdown deadline. Stop new batches after cancellation, release queued records, and serialize exporter cleanup after its active export. Return local drain failures as command errors and skip final rendering instead of waiting on a blocked exporter. Preserve pretty frontend cleanup errors and do not wait for EOF after a failed drain. Keep one CLI regression covering full-queue EOF timeout, a failing exit status, and late exporter completion. Tests were not run for this revision. Signed-off-by: Tibor Vass <[email protected]>
tiborvass
force-pushed
the
codex/lossless-frontend-logs
branch
from
October 29, 2026 07:21
277ee58 to
8ec37a8
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.
Large CLI output can fill the telemetry batch queue. The queue replaces older log records, so a listing can lose rows even when the command exits with code 0.
Use the existing
engine/telemetry/BlockingLogProcessorfor command stdout, stderr, and engine logs forwarded to the local frontend across CLI commands. Producers wait for queue space instead of losing records when the queue fills. Listings use the normal output path, without temporary files or deferred rendering.Keep internal diagnostics best-effort. CLI telemetry setup routes ordinary
slog.Warn/Errorcalls through a separate SDK batch processor to stderr. Consumer warnings, telemetry errors, and cleanup logs therefore cannot wait on the command output queue. No new slog API or changes to shared logging call sites are needed. Diagnostic delivery has a bounded shutdown wait and never closes stderr or the frontend.Remote exporters retain their existing batch processors. The otel-go dependency is unchanged.
Give command EOF emission and local queue draining one independent 30-second deadline. Cancellation stops further batches and releases queued records. Exporter cleanup runs once, after its active export finishes. If local output cannot drain, report the failure through diagnostics, return a nonzero exit status, and skip final rendering. Pretty mode preserves cleanup errors and can exit without waiting for exporter EOF.
A slow frontend can delay producers. Internal diagnostics can be dropped under load or at exit. An exporter that never returns can leave background cleanup pending until process exit.
Validation:
go build ./internal/cmd/daggerandgit diff --checkpassed after rebasing onto main. One new CLI regression test covers full-queue EOF timeout, a failing exit status, and late exporter completion. Tests were not run for this revision.