-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Skip filesystem path detection on single-keystroke text changes #2343
Copy link
Copy link
Open
Labels
cliRelated to `deepagents-cli`Related to `deepagents-cli`internalUser is a member of the `langchain-ai` GitHub organizationUser is a member of the `langchain-ai` GitHub organization
Description
Privileged issue
- I am a Deep Agents maintainer.
Issue Content
Problem
Every keystroke in ChatInput.on_text_area_changed unconditionally calls _is_dropped_path_payload() and _apply_inline_dropped_path_replacement(), both of which perform synchronous stat() syscalls via Path.exists() / Path.is_file() on the event loop thread. At normal typing speed this adds 5-10 blocking kernel calls/sec to the thread that also handles rendering and streaming.
Proposed fix
Track the previous text length and compute a is_bulk_change = abs(text_len - prev_text_len) > 1 heuristic. Gate both filesystem checks behind it. Drag-and-drop / paste always inserts multiple characters; normal typing is single-char. False positives (undo/redo of multi-char selections) are safe — they just run the check unnecessarily.
Files
libs/cli/deepagents_cli/widgets/chat_input.py
Context
Extracted from #1953.
Area (Required)
- cli
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
cliRelated to `deepagents-cli`Related to `deepagents-cli`internalUser is a member of the `langchain-ai` GitHub organizationUser is a member of the `langchain-ai` GitHub organization