fix(code): show Auto first-enable notice as pre-confirmation - #5686
Conversation
Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
The modal previously appeared after Auto was already active, asking the user to confirm something that had already happened. Enter "kept" Auto and Esc reverted to Manual — confusing semantics for a state transition that already occurred. Now the modal gates the switch: it appears before Auto activates. Enter confirms the switch and saves the notice; Esc cancels and stays in the current mode. This matches the existing YOLO acknowledgement pattern and makes the key labels accurate for the first time. The change applies to both entry points: Shift+Tab toggle and inline "approve all" escalation. Startup restore no longer needs the notice since an unsaved notice means Auto was never entered.
| if not has_auto_mode_notice() and not getattr( | ||
| self, "_auto_mode_notice_pending", False | ||
| ): |
There was a problem hiding this comment.
🟡 Pending modal lets Auto bypass confirmation
_auto_mode_notice_pending means another entry point is still waiting for the user's answer, not that confirmation has happened. For example, an inline “approve all” decision can resume just after Shift+Tab or /auto opens this modal; this condition then skips the await future block and proceeds directly to _write_live_approval_mode(AUTO). Auto can therefore activate while the confirmation is still visible, and remains active even if the user presses Esc. A pending confirmation needs to be awaited or treated as False, rather than as permission to fall through.
(Refers to lines 9527-9529)
Your feedback helps Open SWE learn. React with 👍 or 👎 to tell us if this review comment was useful.
When two entry points race (e.g. Shift+Tab opens the confirmation modal while an inline "approve all" decision resumes), the second caller now awaits the shared future rather than falling through and activating Auto without the user's answer.
The test exercises the write-failure path inside _set_approval_mode, so it needs to bypass the new pre-confirmation modal.
> [!CAUTION] > Merging this PR will automatically publish to **PyPI** and create a **GitHub release**. For the full release process, see [`.github/RELEASING.md`](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md). --- _Release notes preview: keep this section in sync with the package `CHANGELOG.md`. Publish reads the merged CHANGELOG via `release.yml`, not this PR description — keep them aligned anyway so the PR stays an accurate historical record for reviewers and anyone returning later._ --- ## [0.1.59](deepagents-code==0.1.58...deepagents-code==0.1.59) (2026-08-20) ### Features - Added support for `managed_config.toml` configuration ([#5604](#5604)) - Multi-select `ask_user` answers are now encoded as JSON arrays ([#5660](#5660)) - Made teardown usage stats configurable ([#5696](#5696)) - Footer pickers now open on click ([#5674](#5674)) - Replaced Gemini 3.6 Flash with Gemini 3.7 Flash ([#5681](#5681)) ### Bug fixes - Made tool argument validation errors recoverable ([#5659](#5659)) - Improved streaming performance for tool-call arguments to run in linear time ([#5712](#5712)) - Fixed durable-mask config resolution with ranked resolver behavior ([#5672](#5672)) - Skipped background sync in Apple Terminal ([#5666](#5666)) - Hid thread IDs when tracing is disabled ([#5692](#5692)) - Kept installed providers visible in `/auth` ([#5689](#5689)) - Preloaded the auth UI before notification handoff ([#5697](#5697)) - Updated and clarified UI copy across Auto mode, YOLO hints, classifier notices, `/tokens`, line-number toggles, review failures, onboarding Tavily cancellation, and OpenAI subscription login labels ([#5685](#5685), [#5694](#5694), [#5684](#5684), [#5687](#5687), [#5680](#5680), [#5688](#5688), [#5686](#5686), [#5691](#5691), [#5693](#5693)) - Removed the `Muse Spark 1.1` recommendation ([#5683](#5683)) _End release notes preview._ --- > [!NOTE] > A **community contributors** list and a **Special thanks** section (crediting the users who filed the issues this release's PRs closed) are appended to the GitHub release notes automatically at publish time (see [Release Pipeline](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md#release-pipeline), step 3). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: langchain-oss-automated-triage[bot] <248757908+langchain-oss-automated-triage[bot]@users.noreply.github.com>
The Auto first-enable notice is now a pre-confirmation dialog that appears before Auto activates, instead of a post-hoc acknowledgment shown after the switch already happened.
The previous flow activated Auto first, then showed a modal saying "You switched to Auto" with Enter to keep it and Esc to revert. This was confusing — the user was asked to confirm a transition that had already occurred, and the key labels described states rather than actions.
The modal now gates the switch itself. It appears before Auto activates with clear labels: Enter confirms the switch to Auto, Esc cancels and stays in the current mode. This matches the existing YOLO acknowledgement pattern.
Both entry points are covered:
Falseso the approval loop continues asking.The startup restore path no longer shows the notice — if Auto was persisted from a prior session, the notice was already confirmed when the user first switched.
Made by Open SWE