mirror of
https://github.com/headroomlabs-ai/headroom.git
synced 2026-08-27 14:17:10 -04:00
When users hit an init regression it's opaque why: no visible state about which agents were probed, which paths were written, which subprocesses ran. Add a top-level flag to ``headroom init`` that routes debug-level logging from the ``headroom.cli.init`` logger to stderr. Instrumented decision points: * detect_init_targets / _probe_init_targets — scope + per-target shutil.which result * _write_json, _ensure_claude_hooks, _ensure_copilot_hooks, _ensure_codex_hooks, _ensure_codex_provider — file paths being written * _apply_user_env — chosen scope (windows vs unix) and env-var keys * _run_checked — each subprocess command + exit code + truncated stdout/stderr (useful when ``claude plugin install`` fails) * _run_init_targets — target dispatch order and resolved profile * top-level init callback — all flag values and invoked_subcommand Log output goes to stderr so stdout stays clean for pipes. The handler attached by ``_enable_verbose_logging`` is idempotent - nested subcommand invocations don't duplicate output. The logger does not propagate to the root logger, so enabling ``headroom init -v`` does not affect the rest of the process. The flag is declared on the parent Click group. Subcommands (claude, codex, copilot, openclaw) inherit the enabled logger automatically because the group callback runs before dispatch. Added tests cover: * ``init -v`` emits the expected markers to stderr, including ``detect_init_targets``, ``global_scope=True``, and each agent name * ``_enable_verbose_logging`` is safe to call repeatedly (handler remains singular) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| test_init_cli.py | ||
| test_install_cli.py | ||
| test_main_help_version.py | ||
| test_mcp.py | ||
| test_wrap_aider.py | ||
| test_wrap_bridge.py | ||
| test_wrap_codex.py | ||
| test_wrap_copilot.py | ||
| test_wrap_openclaw.py | ||
| test_wrap_persistent.py | ||