`adk run` does not support arrow keys or input history

Đang mở Phù hợp với người mới
#8,022 2 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

@llalitkumarrr đang làm issue này rồi.

Từ ngày 9/11/2026.

  • #8023 của @Stephnn0 — đang mở

Đánh giá

Độ khó
1/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
84/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
cli

Hướng nghiên cứu

Bắt đầu tại src/google/adk/cli/cli.py, ở run_interactively, nơi lời nhắc [user]: sử dụng input() tích hợp sẵn của Python. Kiểm tra cách CLI xử lý các nền tảng không có readline, sau đó chạy adk run và xác minh rằng các phím mũi tên chỉnh sửa được nội dung nhập, phím mũi tên lên gọi lại tin nhắn trước đó mà không gửi các chuỗi thoát đến tác tử.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

cli

🔴 Required Information

Describe the Bug:
In adk run, the arrow keys don't work at the [user]: prompt. Pressing arrow up prints ^[[A instead of recalling the previous message, and left/right arrows can't move the cursor to edit a line.

Steps to Reproduce:

  1. pip install google-adk
  2. Create any agent folder and run adk run my_agent
  3. Send a message, e.g. hello
  4. At the next [user]: prompt, press arrow up

Expected Behavior:
Arrow up recalls hello, like in most terminal programs (and the Python REPL).

Observed Behavior:
^[[A is printed. If you press Enter, the raw escape sequence '\x1b[A' is sent to the agent as the message.

Environment Details:

  • ADK Library Version (pip show google-adk): 2.14.0
  • Desktop OS: macOS
  • Python Version (python -V): 3.12

Model Information:

  • Are you using LiteLLM: No
  • Which model is being used: gemini-3.5-flash (not model-specific)

🟡 Optional Information

Additional Context:
run_interactively in src/google/adk/cli/cli.py reads input with the built-in input(). input() only provides line editing and history after the readline module has been imported, and the CLI never imports it. Importing readline (when available; it is not on Windows) fixes it. I'm happy to send a PR.

How often has this issue occurred?:

  • Always (100%)
Ngôn ngữ chính
Python
Star
22.3k
Fork
4.4k
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
6

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của google/adk-python

Tất cả issue của google/adk-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.