Skip to content

fix(code): show Auto first-enable notice as pre-confirmation - #5686

Merged
Mason Daugherty (mdrxy) merged 4 commits into
mainfrom
mdrxy/code/auto-manual-key-hints
Aug 20, 2026
Merged

fix(code): show Auto first-enable notice as pre-confirmation#5686
Mason Daugherty (mdrxy) merged 4 commits into
mainfrom
mdrxy/code/auto-manual-key-hints

Conversation

@mdrxy

@mdrxy Mason Daugherty (mdrxy) commented Aug 20, 2026

Copy link
Copy Markdown
Member

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:

  • Shift+Tab toggle — the modal appears before the mode changes. Enter proceeds with the switch; Esc leaves the mode untouched.
  • Inline "approve all" escalation — the modal appears before Auto commits. Enter activates Auto; Esc returns False so 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

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
@github-actions github-actions Bot added dcode Related to `deepagents-code` fix A bug fix (PATCH) internal User is a member of the `langchain-ai` GitHub organization size: XS < 50 LOC labels Aug 20, 2026
@mdrxy
Mason Daugherty (mdrxy) marked this pull request as ready for review August 20, 2026 15:27
@mdrxy Mason Daugherty (mdrxy) changed the title fix(code): clarify auto mode notice controls style(code): clarify auto mode notice controls Aug 20, 2026
@github-actions github-actions Bot added linting Code style or linting changes and removed fix A bug fix (PATCH) labels Aug 20, 2026
@mdrxy Mason Daugherty (mdrxy) changed the title style(code): clarify auto mode notice controls fix(code): clarify auto mode notice controls Aug 20, 2026
@github-actions github-actions Bot added fix A bug fix (PATCH) and removed linting Code style or linting changes labels Aug 20, 2026

@open-swe open-swe Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open SWE Review found 1 potential issue.

Open in WebView Open SWE trace

Comment thread libs/code/deepagents_code/tui/widgets/auto_mode_notice.py Outdated
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.
@github-actions github-actions Bot added size: M 200-499 LOC and removed size: XS < 50 LOC labels Aug 20, 2026
@mdrxy Mason Daugherty (mdrxy) changed the title fix(code): clarify auto mode notice controls fix(code): show Auto first-enable notice as pre-confirmation Aug 20, 2026

@open-swe open-swe Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open SWE Review found 1 potential issue.

Open in WebView Open SWE trace

Comment thread libs/code/deepagents_code/app.py Outdated
Comment on lines 9527 to 9529
if not has_auto_mode_notice() and not getattr(
self, "_auto_mode_notice_pending", False
):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.
@mdrxy
Mason Daugherty (mdrxy) merged commit 32f565f into main Aug 20, 2026
57 checks passed
@mdrxy
Mason Daugherty (mdrxy) deleted the mdrxy/code/auto-manual-key-hints branch August 20, 2026 16:38
Mason Daugherty (mdrxy) pushed a commit that referenced this pull request Aug 20, 2026
> [!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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dcode Related to `deepagents-code` fix A bug fix (PATCH) internal User is a member of the `langchain-ai` GitHub organization size: M 200-499 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant