Skip to content

fix(agents): pre-dismiss Claude Code auto-mode default nudge - #166

Merged
artempartos merged 1 commit into
developfrom
fix/suppress-auto-default-nudge
Aug 27, 2026
Merged

artempartos merged 1 commit into
developfrom
fix/suppress-auto-default-nudge

Conversation

@artempartos

Copy link
Copy Markdown
Contributor

Problem

Interactive container sessions on recent Claude Code (2.1.2xx) open with a dialog instead of a prompt:

Make auto mode your default permission mode?
  1. Yes, set auto mode as my default permission mode
  2. No, keep bypass permissions

The gate for that nudge, from the shipped CLI bundle:

if (u && !t.hasCompletedOnboarding || t.hasSeenAutoDefaultNudge || !gate("tengu_maple_pier")) return null
let e = userSettings?.permissions?.defaultMode,
    n = ["projectSettings","localSettings","flagSettings","policySettings"].some(s => s?.permissions?.defaultMode)
if (e && e !== "auto" && !n && ...) return e   // <- show nudge

Every session we generate matches it exactly: generate_settings pins
permissions.defaultMode = "bypassPermissions" (a headless sandbox has nobody to
answer a permission prompt, see PERMISSION_DEFAULT_MODE), and we write no
project/local/policy settings that would override it.

Fix

generate_config now writes hasSeenAutoDefaultNudge: true into ~/.claude.json.
That is the flag Claude Code itself writes once the nudge has been answered, and it
is checked before the defaultMode comparison, so bypassPermissions stays and the
dialog never renders. Same shape as the existing effortCalloutV2Dismissed and
hasCompletedOnboarding entries.

Testing

  • bin/rails test test/services/agents/claude_code_adapter_test.rb — 118 runs, 345 assertions, 0 failures
  • make check_all — brakeman / eslint / fe-test / rubocop / system-test / typescript / vite-build all OK.
    rails-test reported 9 errors, all Temporalio::Internal::Bridge::Error: Failed starting server: error sending request for url (https://temporal.download/temporal-test-server/...) in the
    Workflows::*WorkflowTest files — the local container could not reach temporal.download.
    Unrelated to this change; CI has network for that download.

🤖 Generated with Claude Code

Claude Code 2.1.x offers "Make auto mode your default permission mode?"
whenever settings.json pins a defaultMode other than "auto" and no
project/local/policy settings override it — exactly the shape of every
container session we generate (defaultMode is always bypassPermissions,
because a headless sandbox has nobody to answer a permission prompt).
In an interactive session the nudge takes over the first keystrokes.

hasSeenAutoDefaultNudge in ~/.claude.json is the flag Claude Code itself
writes once the nudge has been answered, and it is checked before the
defaultMode comparison, so setting it up front keeps bypassPermissions
without the dialog.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>
@artempartos
artempartos merged commit 2061ca1 into develop Aug 27, 2026
7 checks passed
NOX73 pushed a commit that referenced this pull request Oct 21, 2026
* feat(feature-flags): add registry, ENV source, resolver and Feature facade

First of the seven feature flag tasks (#166, design in #164). The registry ships empty, so nothing changes in behaviour.

Signed-off-by: Aixle-Developer-Agent <[email protected]>

* fix(feature-flags): isolate tests from FEATURE_* ENV, report unknown keys once

- config/settings/test.yml empties feature_flags.env, and the per-test setup
  resets the ENV layer with the store, so a FEATURE_* value in the shell, CI
  or .env never reaches a test; stub_feature_env is the only way to lock one.
- Feature reports an undeclared key to Sentry once per key per process
  instead of on every call; it still reads as off every time.

Signed-off-by: Aixle-Developer-Agent <[email protected]>

* test(feature-flags): check stub_feature_env leaves ENV unchanged, whatever it holds

Signed-off-by: Aixle-Developer-Agent <[email protected]>

---------

Signed-off-by: Aixle-Developer-Agent <[email protected]>
Co-authored-by: Aixle-Developer-Agent <[email protected]>
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.

1 participant