Skip to content

fix(code): make reject-with-feedback discoverable in approval menu - #5260

Merged
Mason Daugherty (mdrxy) merged 6 commits into
mainfrom
mdrxy/code/reject-with-feedback-discoverability
Aug 3, 2026
Merged

fix(code): make reject-with-feedback discoverable in approval menu#5260
Mason Daugherty (mdrxy) merged 6 commits into
mainfrom
mdrxy/code/reject-with-feedback-discoverability

Conversation

@mdrxy

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

Copy link
Copy Markdown
Member

Makes the free-text rejection path discoverable, and stops the quick keys resolving an approval while the reason field is open.


Discoverability. The Tab hint only rendered while Reject was highlighted, and Tab was a no-op from every other row — so users deciding with y/n from the default Approve row never saw it. The hint is now unconditional and reads Tab reject with feedback (amend read like git commit --amend), and Tab moves the cursor to Reject before opening the field. Adds a splash tip, and mirrors tab at App level like the other approval keys — with priority=True, since Screen already binds tab -> focus_next and would otherwise win. check_action steps it aside outside an approval so focus traversal is unaffected.

Quick keys. Arrow keys were gated on _reason_input_active; y/a/1/2/3 and Enter were not. Clicking the menu body moves focus off the reason Input without closing it, and there y approved the call being rejected while Enter sent a bare reject that dropped the typed text. Now on_focus hands focus back (with select_on_focus=False, or the next keystroke would replace the reason), _handle_selection refuses to decide while the field is open, and Enter submits what was typed. Esc still cancels without deciding.

Made by Open SWE

References

The approval menu only advertised the free-text rejection path while the
Reject row was highlighted, and `Tab` was a hard no-op anywhere else — so
the users on the `y`/`n` quick-key fast path never saw it. "Amend" also
read like `git commit --amend` rather than feedback sent to the model.

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: S 50-199 LOC labels Aug 3, 2026
…h-feedback-discoverability

# Conflicts:
#	libs/code/deepagents_code/tui/widgets/approval.py
@mdrxy
Mason Daugherty (mdrxy) marked this pull request as ready for review August 3, 2026 18:47

@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: No issues found

Open SWE reviewed this PR and found no potential bugs to report.

Open in WebView Open SWE trace

…open

The approval menu gates its arrow keys on `_reason_input_active`, but not
`y`/`a`/`1`/`2`/`3` or Enter. Clicking the menu body while the reason field
is open moves focus off the `Input` without closing it -- `on_blur`
deliberately stops re-trapping focus during reason mode so the `Input` can
hold it, and nothing handles the reverse direction. In that state the quick
keys read as menu commands, so a single `y` approves the very call the user
is typing a rejection for, and Enter sends a bare reject that discards the
typed text.

Reachable before this branch, but only for users who knew to arrow onto
Reject and press Tab. Advertising Tab on every prompt makes reason mode the
common path, so close it here:

- `on_focus` hands focus back to the reason input, so the field being open
  and the field being focused stop diverging. The `Input` is constructed
  with `select_on_focus=False` -- Textual's default would select the whole
  reason on the way back, making the next keystroke replace it.
- `_handle_selection` refuses to decide while the flag is set. Every quick
  key and Enter path funnels through it, so one guard covers the actions
  that exist and the ones added later.
- Enter submits the typed reason instead of falling through to a reason-less
  reject, honoring the `Enter submit` hint the footer shows at that moment.

Also mirror `tab` at App level alongside the other advertised approval keys.
It needs `priority=True`, unlike its siblings: `Screen.BINDINGS` already
binds `tab -> app.focus_next` and resolves before the app, so a plain mirror
would never fire. `check_action` steps it aside unless an approval is
pending and the chat input is unfocused, keeping focus traversal and
chat-input completion intact everywhere else.
@github-actions github-actions Bot added size: L 500-999 LOC and removed size: S 50-199 LOC labels Aug 3, 2026
Comment thread libs/code/deepagents_code/tui/widgets/startup_tip.py Outdated
Signed-off-by: Mason Daugherty <github@mdrxy.com>

@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/tests/unit_tests/tui/widgets/test_startup_tip.py Outdated
@github-actions github-actions Bot added size: M 200-499 LOC and removed size: L 500-999 LOC labels Aug 3, 2026
@mdrxy
Mason Daugherty (mdrxy) merged commit b1e3240 into main Aug 3, 2026
55 checks passed
@mdrxy
Mason Daugherty (mdrxy) deleted the mdrxy/code/reject-with-feedback-discoverability branch August 3, 2026 20:50
Johannes du Plessis (johannes117) pushed a commit that referenced this pull request Aug 4, 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.52](deepagents-code==0.1.51...deepagents-code==0.1.52)
(2026-08-04)

### Features

- Hooks v2 is now generally available, with support for loading hooks
from installed plugins.
([#5307](#5307),
[#5198](#5198))
- Auto approval classifier configuration now supports selecting the
classifier model and setting a review timeout.
([#5205](#5205),
[#5302](#5302))
- HITL rejection reasons are now framed for the model, and the approval
menu makes reject-with-feedback easier to discover.
([#5259](#5259),
[#5260](#5260))
- Added a tri-state `DEEPAGENTS_CODE_ONBOARDING` environment variable.
([#5301](#5301))
- The `/model` footer Ctrl+N hint now follows the current display mode.
([#5247](#5247))
- The price catalog now refreshes hourly in the background.
([#5264](#5264))
- Updated recommendations to include DeepSeek V4 Flash 0731.
([#5244](#5244))

### Bug Fixes

- Fixed several Hooks v2 lifecycle issues: session-end teardown is now
bounded, hooks refresh after cwd switches, malformed hook resumes are
handled, hook stops surface without agent errors, and unused
`SessionEndCause` members were removed.
([#5248](#5248),
[#5249](#5249),
[#5233](#5233),
[#5276](#5276),
[#5240](#5240))
- `PreCompact` now fires before auto-compaction.
([#5277](#5277))

_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>
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