Skip to content

fix(bg): stop passing redundant --silent to bg child (#196)#199

Merged
jrob5756 merged 1 commit into
mainfrom
fix/196-bg-runner-redundant-silent
May 18, 2026
Merged

fix(bg): stop passing redundant --silent to bg child (#196)#199
jrob5756 merged 1 commit into
mainfrom
fix/196-bg-runner-redundant-silent

Conversation

@jrob5756
Copy link
Copy Markdown
Collaborator

Fixes #196.

Problem

bg_runner.launch_background() and launch_background_resume() already redirect the child's stdout/stderr/stdin to subprocess.DEVNULL, so silence is enforced at the OS level. Passing --silent in addition to that adds nothing visible to the user — but it does flip verbose_mode=False in the child, and that gates real behavior, not just console prints:

  • copilot.py:867-868_log_event_verbose() is skipped for SDK events
  • copilot.py:701-706_log_parse_recovery() is skipped
  • copilot.py:1619-1620_log_recovery_attempt() is skipped

Critically, _log_event_verbose() writes to both a stderr Console and _file_console. So when --silent is set, those events are dropped from the log file too. That means conductor run --web-bg --log-file auto today produces a log file with no provider-side trace — exactly when you most want one for debugging a detached process.

By contrast, the verbose_log_* helpers in cli/run.py write to the file unconditionally, so the engine-level trace already survives --silent. Only the provider-side SDK events are the casualty, which makes the impact specifically about debugging stuck/looping agent sessions in bg mode.

Fix

Drop --silent from both synthesized commands. Console output still goes to DEVNULL via the Popen kwargs (no visible change for users). The startup update hint is also gated on console.is_terminal, which is False when stderr=DEVNULL, so that doesn't reappear either.

Side benefit: the synthesized command is now reproducible by hand — useful when diagnosing related issues like #195.

Changes

  • src/conductor/cli/bg_runner.py: remove --silent from both `cmd` lists; replace the inline comment with a longer block explaining why it's absent and pointing at this issue.
  • tests/test_cli/test_resume_command.py: flip the existing `--silent` assertion in `test_builds_resume_subcommand_with_workflow` from "in cmd" to "not in cmd" so the contract is locked in.
  • tests/test_cli/test_web_flags.py: add `TestLaunchBackgroundSilentFlag::test_launch_background_does_not_pass_silent` — the run-side parity test that didn't exist before.

Validation

  • `uv run pytest tests/test_cli tests/test_config` → 832 passed, 2 skipped
  • `make lint` → clean
  • `make typecheck` → clean (one pre-existing unrelated warning in `dialog_evaluator.py`)

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

`bg_runner.launch_background()` and `launch_background_resume()` already
redirect the child's `stdout`/`stderr`/`stdin` to `subprocess.DEVNULL`, so
silence is enforced at the OS level. Passing `--silent` in addition to
that adds nothing visible to the user — but it does flip
`verbose_mode=False` in the child, which gates more than just console
prints:

  * `copilot.py` skips `_log_event_verbose()` for SDK events
  * `_log_parse_recovery()` and `_log_recovery_attempt()` are no-ops

`_log_event_verbose()` writes to both stderr and `_file_console`, so
when `--silent` is set those events are dropped from the log file too.
That means `conductor run --web-bg --log-file auto` produces a log file
with no provider-side trace — exactly when you most want one.

Drop `--silent` from both synthesized commands. Console output still
goes to DEVNULL via the Popen kwargs, and `--log-file` now captures a
real trace of the child's behavior.

Side benefit: the synthesized command is now reproducible by hand
without learning that `--silent` was being injected behind the scenes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jrob5756 jrob5756 force-pushed the fix/196-bg-runner-redundant-silent branch from 02e4870 to 4728779 Compare May 18, 2026 20:47
@jrob5756 jrob5756 merged commit af8e981 into main May 18, 2026
9 checks passed
@jrob5756 jrob5756 deleted the fix/196-bg-runner-redundant-silent branch May 18, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bg_runner.py passes redundant --silent to bg child whose streams are already DEVNULL'd

1 participant