Skip to content

[Feature]: Add --no-status without suppressing diagnostics or recorded events #1734

Closed

Description

@skevetter

Source baseline: devsy-org/devsy main at e82ef4a344ad1ce0d5e761a96c90baeecc41d10c, inspected 30 October 2026. This is a read-only source review, not a provider execution test. All changes below are proposals.

Problem and intended outcome

Discussion #1702 and the linked diagnosis shows devsy ci -q --log-level=warn still printing Devsy progress markers. The current implementation confirms that status presentation is independent of logger filtering, and CI invokes a nested workspace command with a second reporter.

Add one explicit progress-visibility control shared by CLI presenters, while keeping warnings/errors, program output, result envelopes, task records and Desktop progress usable. This feature is independently deliverable from the retained setup-history feature #1735 for discussion #1724; neither feature should disable the other's data capture.

Area: CLI, Desktop protocol compatibility, Documentation.

Recommendation

Add a global --no-status boolean, default false, to suppress the presentation of live command progress. Preserve --quiet, --log-level, result envelopes, final error rendering, child stdout/stderr, exit status, task state, journal recording, and Desktop protocol behavior. Do not introduce another --status=auto|plain|json|none axis: --result-format already selects presentation format, and the missing capability is a boolean visibility choice.

The existing logger policy is deliberate. Merged PR #1267 explicitly kept status, results, tasks and lifecycle behavior independent of diagnostic severity. Current --quiet help says it suppresses log output except errors. Making quiet implicitly discard progress or protocol would be an additional compatibility change. An additive flag solves the customer's problem within those contracts.

Examples after implementation:

# Hide progress while retaining warnings, errors and the child's own streams.
devsy ci --no-status --result-format=plain --log-level=warn . -- bash .tools/test.sh

# Hide progress and retain only error diagnostics from Devsy.
devsy ci --no-status --result-format=plain --quiet . -- bash .tools/test.sh

--quiet wins over --log-level=warn, so combining them does not retain warnings. --result-format=plain in these examples avoids the nested exec command's success JSON on stderr when stdout is redirected. It is optional if the caller wants machine results.

Confirmed root cause

  1. cmd/flags/flags.go registers --result-format, diagnostic format, verbose, quiet and debug. There is no status suppression flag.
  2. pkg/log/logger.go:156-169 resolves diagnostic severity with quiet > debug > explicit verbose > log-level > persisted default. This logger does not own semantic progress rendering.
  3. cmd/ci/ci.go:212 constructs the CI reporter with stderr and a verbose boolean. Quiet and log level are not inputs.
  4. cmd/ci/status.go:9-31 explicitly selects Format: "plain". Its verbose option controls short duration display, not whether progress appears. cmd/ci/status_test.go:11-36 explicitly expects [RUN] and [OK] with verbose false.
  5. pkg/status/render.go:179-195 prints progress directly with fmt.Fprintf; it does not pass through the logger.
  6. There is a second source of the reported messages: cmd/ci/ci.go:317-323 creates workspace.ExecCmd with the same GlobalFlags. cmd/workspace/exec.go:106-114 creates an independent workspace reporter. Fixing only the CI reporter leaves workspace: container command status visible.

The discussion diagnosis is confirmed by the current implementation. It does not establish a new execution failure. The customer's flags do exactly what their current help promises but lack the extra control the customer needs.

Existing output contracts

Surface Current behavior Required preservation
CI outer progress Plain ASCII on stderr Default unchanged; optional suppression
Nested workspace exec progress Uses result format; stderr Honor the same new flag
Executed program stdout/stderr Direct streams supplied to runtime, no log severity filtering Preserve stream contents and separation
Exec success JSON Written on stderr when result mode is JSON Retain under --no-status
Failure result Root command owns rendering and child-exit passthrough Preserve existing rendering, streams and exit codes
Workspace journal Tee receives structured events Keep recording even if presentation is disabled
Detached task state Task.Reporter records latest state and error Keep updates and terminal ownership semantics
Detached worker stream Captured stdout/stderr supplies historical nested status to follower Treat as recording, not a user presentation sink
Desktop DEVSY_UI=true forces JSON envelopes Preserve status/result/error protocol
Explicit history/query output workspace events/status, task get/logs return requested data Return data as before; no content filtering

Actual format flag: --result-format, not --output. --output is a distinct named flag used elsewhere. Do not add an alias merely for this feature.

Sources: pkg/output/mode.go; cmd/workspace/exec.go:220-243, 337-354; cmd/root.go:245-335.

Exact proposed behavior

  • With NoStatus=false, preserve existing presentation byte-for-byte apart from inherently variable durations.
  • With NoStatus=true in a direct CLI invocation, suppress live status.Reporter presentation in both plain mode and public JSON mode. Do not emit replacement progress lines.
  • Public --result-format=json --no-status preserves existing final result and task-submission output. Preserve existing final error rendering, streams and exact child-exit behavior too. --result-format does not choose root error mode: cmd/root.go:isMachineConsumer uses internal-command/UI context, explicit diagnostic format or stderr TTY detection. JSON result mode can still have a plain error or bare child exit; plain result mode with redirected stderr can still have a JSON error. Do not change that policy in this feature.
  • DEVSY_UI=true overrides status suppression: existing status envelopes remain available to Desktop even if the global flag was forwarded accidentally. Preserve existing callbacks, including the outer CI reporter's current no-op envelope callback; this feature does not add a new CI protocol. It must not suppress or corrupt Desktop timelines.
  • A verified detached worker also bypasses suppression for its captured stream. That stream is the recording used by later followers. The submitting foreground command still returns its task handle normally.
  • Keep explicit history/query commands unchanged. workspace events, workspace status, workspace task get, and workspace task logs return the requested records/state, including their existing structured forms. This is a command presentation flag, not a generic text filter applied to every output.
  • --quiet, -v, --debug, --log-level, persisted defaults and diagnostic formats keep their existing precedence and behavior. Debug can remain enabled while progress is hidden.
  • --no-status=false explicitly restores the default behavior. Do not add environment binding or a persisted setting in this change.
  • Status suppression must not hide a format-validation error that the same command would report without suppression.
  • Do not forward the suppression policy into status.Run, remote event producers, tunnel senders, or journal/task reporters. Apply it at the presentation sink.

File-by-file implementation work

Deliver this in signed commits and a Draft PR. Keep changes confined to presentation and flag plumbing; retain required CI and review gates. The numbered sections are implementation tasks, and the acceptance matrix defines completion.

1. Flag definition

In pkg/flags/names/names.go, add NoStatus = "no-status" beside output/logging names. Include it in pkg/flags/names/names_test.go's canonical name map.

In cmd/flags/flags.go, add NoStatus bool to GlobalFlags and register it in registerOutputFlags with no shorthand and default false. Proposed help: Suppress live CLI progress messages; preserve results, errors, and recorded events. Preserve existing quiet help because its semantics do not change. Do not bind DEVSY_NO_STATUS implicitly; the repository uses selective environment binding.

2. Shared presenter support

In pkg/status/render.go, add NoStatus bool to both ReporterOptions and CLIOptions, and pass the field through NewCLIReporter.

NewReporter must first resolve and validate/create the ordinary reporter using the existing paths. If creation returns an error, return it. If NoStatus is true and the invocation is not the Desktop transport (DEVSY_UI != "true"), return status.Nop() instead of the presentation reporter. Otherwise return the ordinary reporter. This preserves validation and confines the behavior to presentation. Do not add none to output.ResolveMode, alter status.Run, or change Tee.

3. Pass the flag through all six command presenter factories

Add a final noStatus bool argument to the existing helpers, replacing their optional verbose vararg where necessary so each signature remains at four or fewer arguments. Set the new option in the constructor. Update every call site and its tests:

Factory Call sites
cmd/ci/status.go:newStatusReporter cmd/ci/ci.go:execute
cmd/workspace/up/status.go:newStatusReporter cmd/workspace/up/up.go:configureRun
cmd/workspace/status_reporter.go:newWorkspaceStatusReporter cmd/workspace/exec.go, build.go, stop.go, delete.go, import.go
cmd/provider/status.go:newStatusReporter cmd/provider/add.go, init.go, set_source.go
cmd/config/apply.go:newStatusReporter ApplyCmd.Run in the same file
cmd/internal/runusercommands.go:newLifecycleStatusReporter RunUserCommandsCmd.Run

Use cmd.NoStatus at these call sites. The CI ExecCmd already shares GlobalFlags, so it automatically receives the same policy once the workspace presenter factory consumes it. Do not add a second local CI flag or a separate global variable.

4. Preserve detached recording and event storage

In UpCmd.configureRun, use a local suppression expression cmd.NoStatus && cmd.workerTask == nil when constructing the presentation reporter. workerTask is established by the existing ownership-verified openTask path before configureRun; do not decide this exception from unverified user-supplied --task-id text alone. Do not mutate the shared GlobalFlags pointer to clear the flag.

Keep withJournal outside the presentation constructor and keep setUpTask teeing into Task.Reporter. A disabled user presentation must remain one child of the tee, not replace the tee itself.

This matters because detachedArgs strips only --detach, so the new flag will reach the worker. Task.Reporter stores current state, not a full historical event stream. cmd/workspace/task_tail.go obtains nested history from the worker's captured stream. Merely saying 'task state still updates' is insufficient protection for later Desktop replay.

Sources: cmd/workspace/up/up.go:267-331,350-363; cmd/workspace/up/journal.go; cmd/workspace/up/detach.go:84-118; pkg/task/task.go:577-613; cmd/workspace/task_tail.go:84-95.

5. Documentation

Update sites/docs-devsy-sh/content/docs/developing-in-workspaces/continuous-integration.mdx with the two examples above, a concise table separating progress from diagnostics and child output, and the result-format explanation for redirected CI output.

Update sites/docs-devsy-sh/content/docs/troubleshooting/troubleshooting.mdx with the same separation, linked to the proposed lifecycle transcript feature. Hiding progress must not imply that capture/history is disabled. State that the new flag cannot recover old lifecycle output that was never retained.

Acceptance tests

Use existing testify suite style for new Go unit coverage and Ginkgo for real CLI integration. Runtime E2E belongs in GitHub Actions, consistent with the owner's requirements.

Unit and contract coverage

  1. pkg/status/reporter_test.go: default plain unchanged; disabled plain emits zero bytes; disabled public JSON does not call status envelope callback; enabled public JSON still does; invalid format behaves exactly as without NoStatus; DEVSY_UI=true plus NoStatus=true calls the JSON callback even if plain requested.
  2. Test status.Tee(disabledPresentation, memoryReporter) through status.Run: memory reporter gets start and terminal events and the callback runs exactly once, returns the same error and preserves operation/parent IDs.
  3. cmd/ci/status_test.go: preserve existing deterministic ASCII test with noStatus=false, add disabled output and debug/verbose variants. Do not change the original expectation to make default CI silent.
  4. Command parsing: global option recognized before or after ci, defaults false, explicit false works, and public help describes it. Reuse root construction and canonical flag tests.
  5. Update presenter tests for provider/config/workspace/internal factory signature changes and demonstrate each honors the new option.
  6. cmd/workspace/up test: disabled foreground presentation still journals events. A verified workerTask retains its recording, including nested completion events, despite forwarded NoStatus=true.
  7. cmd/workspace/task_tail_test.go: existing completion-before-result, trailing partial line and no-duplicate replay assertions remain green for a worker submitted with the new flag.
  8. Preserve pkg/log/logger_test.go precedence tests without changing expected results. No status flag should enter logger configuration.

End-to-end cases

Extend e2e/tests/ci/ci.go with separately captured stdout/stderr through Framework.ExecCommandCapture:

Scenario Required assertion
Default CI Normal progress remains
--no-status --result-format=plain No Devsy CI/workspace progress; exact child's stdout/stderr preserved
--no-status --quiet Error diagnostics and child stderr survive; no progress
--no-status --log-level=warn Warnings/errors survive; no progress
--no-status --debug Debug diagnostics remain; no progress
--no-status=false Default progress restored
Child exits 7 CLI exits 7, child stderr retained, cleanup still occurs
Build/lifecycle error Nonzero result and useful failure diagnostic remain even though [FAIL] is hidden
--keep Workspace preserved exactly as before
Public JSON results No intermediate kind:status; existing result/task output retained on its existing stream
Machine-mode failure With redirected stderr or explicit --log-output=json, preserve existing error envelope and exit policy; --result-format alone is not this mode selector
Child prints a literal [RUN] or a JSON kind:status string Child bytes remain; implementation is not content filtering
Cancellation Cancellation and cleanup/exit behavior unchanged

Add a direct workspace operation integration case showing that workspace events still contains status history after a --no-status run. Add a detached launch/follow case establishing nested status history remains available. Retain the existing Desktop desktop/e2e/log-level-protocol.e2e.ts test, which checks status and result protocols at info/warn/error capture levels, and add coverage proving an accidentally forwarded --no-status cannot stall the timeline.

Do not claim exact empty stderr in public JSON/auto mode; result/error data remains by contract. Use --result-format=plain for successful child-stream assertions, and explicitly select or account for root error mode in failure assertions. Preserve the current bare-child-exit behavior where applicable; do not require an added diagnostic for every nonzero child exit. See cmd/root.go:132-143 for machine-mode selection.

Related work and duplication check

GitHub searches for quiet, no-status, status and lifecycle logs returned no existing quiet feature issue matching this request. Quoted hyphenated search terms can match unrelated words, so this is search evidence rather than an exhaustive proof of absence. Issue #1517, 'Improve workspace details and creation experience', is closed and explicitly excluded CLI/runtime changes; it does not supply this missing control.

Related merged PRs verified via GitHub metadata:

  • #1221, logging/status migration.
  • #1267, diagnostic default levels and protocol independence.
  • #1248, bounded operation journal.
  • #1324, Desktop activity timeline.
  • #1345, nested task status replay and completion ordering.

Current source still lacks suppression despite those foundations. These are integration constraints and building blocks, not duplicates that already solve discussion #1702.

Interface with lifecycle transcripts

The new flag should affect visibility only. Transcripts from discussion #1724 must be captured independently of both this flag and diagnostic severity. Reuse existing status identity and storage conventions, but never solve #1724 by promoting successful hook output to info/debug logs: changing diagnostic severity should not decide whether a transcript exists.

A related source fact for the lifecycle design: ci calls up.RunHeadless, which installs the supplied reporter directly (cmd/workspace/up/up.go:158) and bypasses configureRun/withJournal. If CI transcripts/event journaling are promised, the lifecycle feature must explicitly attach capture for this path; it cannot assume ordinary workspace up initialization covers CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions