feat(cli): add step-into mode for subagents#1372
feat(cli): add step-into mode for subagents#1372Juan Wisznia (juanwisz) wants to merge 12 commits intolangchain-ai:mainfrom
Conversation
Adds step-into subagent data model: ConversationContext dataclass for tracking nested conversations, and extends SessionState with context stack management (push/pop/reset).
Shows a 4th "Step into" option when approving task tool invocations. Adds 's' quick key and dynamic option count.
Adds ExecuteTaskResult return type, _create_branch_context helper, and step_into decision handling in execute_task_textual.
Integrates step-into subagents into the Textual app: - Adds slash commands for context navigation - Handles step-into result in _run_agent_task - Updates /clear to reset context stack - Adds key bindings and autocomplete entries
Adds STEP_INTO.md with full design rationale and usage guide. Updates README to link to the new doc.
Remove unused imports (field, Path), fix line lengths, add missing docstring return, suppress magic number warning, and preserve 8-char hex thread IDs in TextualSessionState.
|
cool, thank you Juan Wisznia (@juanwisz) for re-opening on top of the recent changes. would you mind attaching a screen recording of the functionality to the PR description? you should be able to drag and drop a video file and it will upload inline |
step-into-demo.mp4 |
|
Interesting, thank you Juan Wisznia (@juanwisz) for the recording 2 things that stand out immediately
|
|
Mason Daugherty (@mdrxy) I will work on the changes for this. Regarding point 1, you’re right. As for point 2, if you watch the video closely (at 0:08), you’ll see that we indicate when we step into a specific subagent. However, we could make this much clearer by always displaying the current node and the depth level. I think this feature is very strong. Today, it really comes down to two things: good context management and avoiding unnecessary interface changes, even something as small as opening another CLI. This feature lets you micro-manage context very efficiently by only injecting what is actually necessary, and it allows you to do everything from the same terminal. |
# Conflicts: # README.md # libs/cli/deepagents_cli/app.py # libs/cli/deepagents_cli/textual_adapter.py # libs/cli/deepagents_cli/widgets/autocomplete.py
|
scratchpad
|
Adds interactive step-into mode for subagent invocations in the CLI. Instead of fire-and-forget delegation, users can enter an interactive session with a subagent while maintaining context isolation.
tasktool call, a new "Step into" option lets users enter the subagent conversation interactively/return(exit subagent, send summary to parent),/summary(view/edit summary file),/context(show conversation stack)This is a re-port of #829 against the current Textual-based CLI architecture (the original PR targeted the old Rich+prompt_toolkit code in
libs/deepagents-cli/which has since been replaced bylibs/cli/).