Implement interactive CLI with prompt-toolkit - #3
Conversation
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Signed-off-by: liujiyuan <lliiuu66@outlook.com>
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
6428ff0 to
bb53af2
Compare
Count unique top-level assistant message IDs instead of text blocks or ResultMessage.num_turns. Keep consuming after finish so final result usage and cost are retained. Signed-off-by: liujiyuan <lliiuu66@outlook.com>
Signed-off-by: Hao Lin <linhaomails@gmail.com>
|
Curious about what “/default” is for, seems the default prompt is already pre-filled and can be submitted by pressing Enter. |
feat: support different cerebrums in dashboard mode
Signed-off-by: Hao Lin <linhaomails@gmail.com>
Co-authored-by: user <user@userdeMacBook-Air.local>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…-t4-s0-recipe fix: update spatial swap task 4 recipe
The Pi0.5 checkpoint URL in the README and docs pointed at huggingface.co/datasets/..., which returns 401 -- the checkpoint is a model repo, not a dataset. broken: https://huggingface.co/datasets/RLinf/rlinf-pi05-libero-130-fullshot-sft correct: https://huggingface.co/RLinf/RLinf-Pi05-LIBERO-130-fullshot-SFT Also switches to the repo's canonical casing. The all-lowercase form 307-redirects correctly, so that part is cosmetic, but it avoids depending on the redirect. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
update readme, add link and fix table
Fix: correct broken HuggingFace checkpoint URL in README and documentation
…nf#38) Signed-off-by: catr1xLiu <75480109+catr1xLiu@users.noreply.github.com>
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
…ed prompt Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
There was a problem hiding this comment.
Pull request overview
This PR adds an interactive mode to the RPent CLI so users can type messages during agent execution to steer subsequent turns, and wires that interactive input into the api, claude_code, and codex planners via a shared TUI helper.
Changes:
- Add
--interactive/-iCLI flag and a prompt-toolkit-based terminal UI that streams user lines into a queue. - Integrate queued user steering into planner loops (pydantic-ai loop injection, Claude session continuation, Codex steer/interrupt thread).
- Document interactive mode in both English and Chinese READMEs and add
prompt-toolkitas a dependency.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| rpent/planner/codex.py | Adds optional interactive input queue handling for Codex via a steering thread and renders userMessage events. |
| rpent/planner/claude_code.py | Adds optional interactive queue loop to continue a stateful Claude SDK client session one user line per turn. |
| rpent/planner/base.py | Extends the Planner protocol with an optional input_queue for interactive steering. |
| rpent/planner/api_loop.py | Adds interactive steering support by draining queued user messages into an active pydantic-ai run and looping between runs. |
| rpent/cli/tui.py | New prompt-toolkit TUI module for interactive input, help/quit tokens, and queue helpers. |
| rpent/cli/main.py | Adds --interactive/-i, starts the interactive reader, and passes the queue to the selected planner. |
| README.md | Documents interactive mode usage and provides an example command. |
| README.zh-CN.md | Documents interactive mode usage in Chinese and provides an example command. |
| pyproject.toml | Adds prompt-toolkit dependency needed for the interactive TUI. |
Comments suppressed due to low confidence (1)
rpent/planner/api_loop.py:264
- The outer interactive loop currently continues after a run ends even if
turnshas reachedmax_turns, allowing another run to start and exceed the intended budget. Add an explicitturns >= max_turnscheck after the run closes to stop the session once the limit is hit.
# finish => end the whole session immediately (chosen behavior).
if finish_result is not None or quit_requested or not interactive:
break
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ed mid-read Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Removed the /default command. |
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
6ca8e0f to
b8d34fa
Compare
…-cli # Conflicts: # README.md # README.zh-CN.md # docs/source-en/rst_source/installation.rst # docs/source-zh/rst_source/installation.rst # pyproject.toml # rpent/cli/main.py # rpent/planner/api_loop.py # rpent/planner/base.py # rpent/planner/claude_code.py # rpent/planner/codex.py
…ls from codex proxy Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>

This pull request introduces an interactive mode to the RPent CLI, allowing users to steer the agent in real-time by typing messages during execution. The implementation adds a new --interactive flag, a terminal UI for user input, and integrates interactive input handling into the agent loop for both the api and claude/codex backends.