fix(code): route ctrl+x to focused ask_user input - #4926
Merged
Conversation
When an ask_user 'Other (type your answer)' free-text field (or any ask_user text answer) was focused, ctrl+x opened the external editor against the empty chat input instead of the field's draft, and returned focus to the chat input rather than the originating field. Detect the focused AskUserTextArea and route the editor through it, mirroring the goal-review editor path. Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
ctrl+x to focused ask_user input
Mason Daugherty (mdrxy)
marked this pull request as ready for review
July 22, 2026 00:50
Mason Daugherty (mdrxy)
pushed a commit
that referenced
this pull request
Jul 22, 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`. The published GitHub release body is extracted from the merged `CHANGELOG.md` by `release.yml`, not from this PR description._ --- ## [0.1.45](deepagents-code==0.1.44...deepagents-code==0.1.45) (2026-07-22) ### Features - Added the Hooks v2 execution engine and typed hooks data models ([#4880](#4880), [#4870](#4870)) - Added a filesystem tool allowlist for `dcode` with `--allow-fs-tools` ([#4635](#4635)) - Added a GLM-5.2 harness profile ([#4710](#4710)) - Added a built-in thread inspector skill ([#4769](#4769)) - Replaced Gemini 3.5 Flash with Gemini 3.6 Flash in the model switcher ([#4890](#4890)) - Show experimental mode in the splash screen and debug console ([#4863](#4863)) - Gate debug console click-to-copy behind a checkbox ([#4810](#4810)) ### Bug Fixes - Improved scratch-file handling by allowing cleanup of agent-created scratch files and safe OS-temp scratch artifacts ([#4860](#4860), [#4869](#4869)) - Skip grading during `/goal` proposals ([#4941](#4941)) - Improved MCP approval handling: Esc now aborts project MCP approval, disabled MCP servers are honored for plugins, remembered approvals are preserved with the env allowlist, and approvals are shared across Git worktrees ([#4888](#4888), [#4848](#4848), [#4889](#4889), [#4939](#4939)) - Hardened installer downloads and paths ([#4871](#4871)) - Fixed forced `dcode update` checks to bust the CDN cache ([#4862](#4862)) - Prevented failed exit setup from stranding the app ([#4913](#4913)) - Fixed routing so `ctrl+x` goes to the focused `ask_user` input ([#4926](#4926)) - Show `-m` prompts as queued immediately on startup ([#4861](#4861)) - Kept harness-profile diagnostics out of terminal output ([#4943](#4943)) - Avoid tracking inline restart callers ([#4894](#4894)) - Fixed debug console thread ID copying on click ([#4945](#4945)) ### Performance Improvements - Reduced exit latency by coordinating async shutdown teardown ([#4831](#4831)) - Sped up local context detection ([#4922](#4922)) _End release notes preview._ --- > [!NOTE] > A **New Contributors** section is 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 2). --------- 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>
Marcelo5444
pushed a commit
to Marcelo5444/deepagents
that referenced
this pull request
Jul 30, 2026
) Fix `ctrl+x` in `ask_user` prompts so the external editor opens with the current draft and returns focus to the answer field. --- The `ctrl+x` external-editor action only recognized the goal-review editor and the chat input. When the focused surface was an `ask_user` answer field — either a free-text question or the "Other (type your answer)" input revealed for a multiple-choice question — it fell through to the chat-input branch. That opened the editor against the (usually empty) chat input instead of the field's current draft, and on return it focused the chat input rather than the originating `ask_user` field. This adds a `_focused_ask_user_editor` check that mirrors the existing goal-review path: when a visible, attached, focused `AskUserTextArea` owns focus, the editor round-trips its `submitted_value` (expanding collapsed-paste placeholders), resets paste state afterward, and restores focus to that same field. Made by [Open SWE](https://openswe.vercel.app/agents/949e7490-b2bd-9d30-96ed-14cd763fb545) --------- Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Marcelo5444
pushed a commit
to Marcelo5444/deepagents
that referenced
this pull request
Jul 30, 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`. The published GitHub release body is extracted from the merged `CHANGELOG.md` by `release.yml`, not from this PR description._ --- ## [0.1.45](langchain-ai/deepagents@deepagents-code==0.1.44...deepagents-code==0.1.45) (2026-07-22) ### Features - Added the Hooks v2 execution engine and typed hooks data models ([langchain-ai#4880](langchain-ai#4880), [langchain-ai#4870](langchain-ai#4870)) - Added a filesystem tool allowlist for `dcode` with `--allow-fs-tools` ([langchain-ai#4635](langchain-ai#4635)) - Added a GLM-5.2 harness profile ([langchain-ai#4710](langchain-ai#4710)) - Added a built-in thread inspector skill ([langchain-ai#4769](langchain-ai#4769)) - Replaced Gemini 3.5 Flash with Gemini 3.6 Flash in the model switcher ([langchain-ai#4890](langchain-ai#4890)) - Show experimental mode in the splash screen and debug console ([langchain-ai#4863](langchain-ai#4863)) - Gate debug console click-to-copy behind a checkbox ([langchain-ai#4810](langchain-ai#4810)) ### Bug Fixes - Improved scratch-file handling by allowing cleanup of agent-created scratch files and safe OS-temp scratch artifacts ([langchain-ai#4860](langchain-ai#4860), [langchain-ai#4869](langchain-ai#4869)) - Skip grading during `/goal` proposals ([langchain-ai#4941](langchain-ai#4941)) - Improved MCP approval handling: Esc now aborts project MCP approval, disabled MCP servers are honored for plugins, remembered approvals are preserved with the env allowlist, and approvals are shared across Git worktrees ([langchain-ai#4888](langchain-ai#4888), [langchain-ai#4848](langchain-ai#4848), [langchain-ai#4889](langchain-ai#4889), [langchain-ai#4939](langchain-ai#4939)) - Hardened installer downloads and paths ([langchain-ai#4871](langchain-ai#4871)) - Fixed forced `dcode update` checks to bust the CDN cache ([langchain-ai#4862](langchain-ai#4862)) - Prevented failed exit setup from stranding the app ([langchain-ai#4913](langchain-ai#4913)) - Fixed routing so `ctrl+x` goes to the focused `ask_user` input ([langchain-ai#4926](langchain-ai#4926)) - Show `-m` prompts as queued immediately on startup ([langchain-ai#4861](langchain-ai#4861)) - Kept harness-profile diagnostics out of terminal output ([langchain-ai#4943](langchain-ai#4943)) - Avoid tracking inline restart callers ([langchain-ai#4894](langchain-ai#4894)) - Fixed debug console thread ID copying on click ([langchain-ai#4945](langchain-ai#4945)) ### Performance Improvements - Reduced exit latency by coordinating async shutdown teardown ([langchain-ai#4831](langchain-ai#4831)) - Sped up local context detection ([langchain-ai#4922](langchain-ai#4922)) _End release notes preview._ --- > [!NOTE] > A **New Contributors** section is 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 2). --------- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix
ctrl+xinask_userprompts so the external editor opens with the current draft and returns focus to the answer field.The
ctrl+xexternal-editor action only recognized the goal-review editor and the chat input. When the focused surface was anask_useranswer field — either a free-text question or the "Other (type your answer)" input revealed for a multiple-choice question — it fell through to the chat-input branch. That opened the editor against the (usually empty) chat input instead of the field's current draft, and on return it focused the chat input rather than the originatingask_userfield.This adds a
_focused_ask_user_editorcheck that mirrors the existing goal-review path: when a visible, attached, focusedAskUserTextAreaowns focus, the editor round-trips itssubmitted_value(expanding collapsed-paste placeholders), resets paste state afterward, and restores focus to that same field.Made by Open SWE