fix(claude_code): prevent the fullscreen-renderer onboarding upsell via settings - #600
fix(claude_code): prevent the fullscreen-renderer onboarding upsell via settings#600klabulan wants to merge 1 commit into
Conversation
…ia settings (harness-control#225) Claude Code shows a first-run "Try the new fullscreen renderer?" onboarding upsell on a HOME dir whose stored onboarding-version state lags the installed CLI, unless the CLI's own /tui setting is explicitly set. That prompt blocks CAO's screen-scraping status detection (which expects the classic renderer) and can hang initialization. Extend the existing _ensure_skip_bypass_prompt_setting() (renamed _ensure_startup_settings) to ALSO seed tui:"default" in the SAME atomic, locked read-modify-write that already seeds skipDangerousModePermissionPrompt -- prevention instead of runtime detect-and-dismiss. tui is only seeded when ABSENT, so an operator who deliberately chose "fullscreen" is not reset on every launch. Preserves the _SETTINGS_WRITE_LOCK + os.replace atomic-write and mode-preservation (0600) hardening intact. Tests: seeds both keys in one os.replace; preserves an explicit tui; no-op when both present. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #600 +/- ##
=======================================
Coverage ? 91.32%
=======================================
Files ? 182
Lines ? 24415
Branches ? 0
=======================================
Hits ? 22297
Misses ? 2118
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR hardens Claude Code session startup by proactively seeding Claude Code’s ~/.claude/settings.json to suppress first-run/upgrade prompts that can block CAO initialization and disrupt status detection.
Changes:
- Rename and extend the settings seeding helper to
_ensure_startup_settings, seeding bothskipDangerousModePermissionPrompt: trueand (when absent)tui: "default"in a single locked, atomic write. - Update provider initialization to invoke the renamed helper before launching Claude Code.
- Update and expand unit/integration tests to cover the new
tuibehavior and the rename.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/cli_agent_orchestrator/providers/claude_code.py |
Renames and expands the startup settings seeding to include tui: "default" while preserving the atomic, locked write behavior. |
test/providers/test_claude_code_unit.py |
Updates patches for the renamed helper and adds coverage for seeding/preserving tui alongside existing atomic-write tests. |
test/providers/test_provider_init_timeout.py |
Updates initialization wiring tests to patch the renamed helper. |
test/providers/test_container_wrapped.py |
Updates wrapped-provider lifecycle test to patch the renamed helper. |
uv.lock |
Bumps package version and updates lock contents accordingly. |
Suppressed comments (1)
test/providers/test_claude_code_unit.py:1965
- This mock setup is redundant:
mock_path_cls.home.return_valueis reassigned a few lines later, so the__truediv__side_effect configured here is overwritten and never used. Removing it reduces confusion and keeps the chain setup in one place.
mock_path_cls.home.return_value.__truediv__ = MagicMock(
side_effect=lambda _: mock_settings_path
)
# Chain .home() / ".claude" / "settings.json"
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| permissions confirmation dialog on every launch with ``--dangerously-skip-permissions`` | ||
| unless this is persisted. CAO already uses the flag intentionally, so the confirmation | ||
| is redundant and blocks initialization. | ||
| - ``tui: "default"`` (workain/harness-control#225): Claude Code shows a first-run |
Claude Code shows a first-run "Try the new fullscreen renderer?" onboarding upsell on a HOME dir whose stored onboarding-version state lags the installed CLI, unless the CLI's own
/tuisetting is explicitly set. That prompt is structurally indistinguishable, frominitialize()'s point of view, from a hung launch — it sits outside the accept-set and can block/tear down session initialization; it also renders an alternate-screen TUI that CAO's screen-scraping status detection does not expect.Fix: extend the existing hardened settings-seeding function (renamed
_ensure_startup_settings) to also seedtui:"default"in the same atomic, locked read-modify-write that already seedsskipDangerousModePermissionPrompt. Prevention instead of runtime detect-and-dismiss: with the setting seeded before launch the prompt never renders.tuiis only seeded when absent, so an operator who deliberately chose"fullscreen"is not reset on every launch."default"keeps the classic renderer the existing status detection expects. Upstream's_SETTINGS_WRITE_LOCK+ atomicos.replace+ mode-preservation hardening is preserved intact.Tests: both keys are written in one
os.replace(mode 0600); an explicittuiis preserved; no-op when both keys already present. Verified live: a fresh session seedstui:"default"at create and reaches the REPL with no upsell.Surfaced in production (harness-control#225).
🤖 Generated with Claude Code