[PR #1301] feat(cli): add substring matching to command history navigation #1294

Open
opened 2026-02-16 09:18:39 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagents/pull/1301
Author: @peterkolcza
Created: 2/12/2026
Status: 🔄 Open

Base: mainHead: feat/cli-history-substring-search


📝 Commits (1)

  • c611c9e feat(cli): add substring matching to command history navigation

📊 Changes

3 files changed (+157 additions, -14 deletions)

View changed files

📝 libs/cli/deepagents_cli/widgets/chat_input.py (+1 -1)
📝 libs/cli/deepagents_cli/widgets/history.py (+21 -13)
libs/cli/tests/unit_tests/test_history.py (+135 -0)

📄 Description

Replace prefix-based startswith() matching with case-insensitive substring search in HistoryManager, giving users zsh-style history navigation. Typing text and pressing up arrow now jumps to the most recent entry containing that text.

Fixes #1092

Changes:

  • history.py: Rename prefix to keyword-only query, switch from startswith() to in operator for case-insensitive substring matching, capture query once per navigation session, normalize to lowercase at capture time
  • chat_input.py: Pass query=event.current_text to get_previous()
  • test_history.py: 10 new unit tests covering substring matching, case insensitivity, empty/whitespace queries, forward navigation, reset, and captured-once semantics

Verification: make format, make lint, and make test pass (972 tests).

Note

This contribution was developed with the assistance of AI coding agents (Claude Code).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/deepagents/pull/1301 **Author:** [@peterkolcza](https://github.com/peterkolcza) **Created:** 2/12/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/cli-history-substring-search` --- ### 📝 Commits (1) - [`c611c9e`](https://github.com/langchain-ai/deepagents/commit/c611c9ef2241bc20d3c2ea4b335ab6a70c6b9588) feat(cli): add substring matching to command history navigation ### 📊 Changes **3 files changed** (+157 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `libs/cli/deepagents_cli/widgets/chat_input.py` (+1 -1) 📝 `libs/cli/deepagents_cli/widgets/history.py` (+21 -13) ➕ `libs/cli/tests/unit_tests/test_history.py` (+135 -0) </details> ### 📄 Description Replace prefix-based `startswith()` matching with case-insensitive substring search in `HistoryManager`, giving users zsh-style history navigation. Typing text and pressing up arrow now jumps to the most recent entry *containing* that text. Fixes #1092 **Changes:** - `history.py`: Rename `prefix` to keyword-only `query`, switch from `startswith()` to `in` operator for case-insensitive substring matching, capture query once per navigation session, normalize to lowercase at capture time - `chat_input.py`: Pass `query=event.current_text` to `get_previous()` - `test_history.py`: 10 new unit tests covering substring matching, case insensitivity, empty/whitespace queries, forward navigation, reset, and captured-once semantics **Verification:** `make format`, `make lint`, and `make test` pass (972 tests). > [!NOTE] > This contribution was developed with the assistance of AI coding agents (Claude Code). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 09:18:39 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/deepagents#1294