Skip to content

feat(cli): add step-into mode for subagents#1372

Open
Juan Wisznia (juanwisz) wants to merge 12 commits intolangchain-ai:mainfrom
juanwisz:feature/step-into-subagents-v2
Open

feat(cli): add step-into mode for subagents#1372
Juan Wisznia (juanwisz) wants to merge 12 commits intolangchain-ai:mainfrom
juanwisz:feature/step-into-subagents-v2

Conversation

@juanwisz
Copy link

@juanwisz Juan Wisznia (juanwisz) commented Feb 17, 2026

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.

  • When the HITL approval prompt appears for a task tool call, a new "Step into" option lets users enter the subagent conversation interactively
  • New slash commands: /return (exit subagent, send summary to parent), /summary (view/edit summary file), /context (show conversation stack)
  • Context stack tracks nested subagent sessions with isolated thread IDs
  • Summary file created per branch for curating what returns to the parent

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 by libs/cli/).

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.
@github-actions github-actions bot added the cli Related to `deepagents-cli` label Feb 17, 2026
@github-actions github-actions bot added external User is not a member of the `langchain-ai` GitHub organization feature New feature/enhancement or request for one and removed feature New feature/enhancement or request for one labels Feb 17, 2026
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.
@mdrxy
Copy link
Member

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

@juanwisz
Copy link
Author

step-into-demo.mp4

Mason Daugherty (@mdrxy) done

@mdrxy
Copy link
Member

Interesting, thank you Juan Wisznia (@juanwisz) for the recording

2 things that stand out immediately

  1. We should probably more clearly indicate that stepping into a conversation = implies approving the action (this is ambiguous right now)
  2. Whilst "stepped in", I'd like to see some visual indicator to inform the user that they are inside of a subagent. Open to ideating on this

@juanwisz
Copy link
Author

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.

Mason Daugherty (mdrxy) and others added 2 commits March 6, 2026 17:36
# Conflicts:
#	README.md
#	libs/cli/deepagents_cli/app.py
#	libs/cli/deepagents_cli/textual_adapter.py
#	libs/cli/deepagents_cli/widgets/autocomplete.py
@mdrxy
Copy link
Member

scratchpad

  • markdown bold formatting on /context not working
  • running... spinner for root invocation not stopping timer after task finishes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Related to `deepagents-cli` external User is not a member of the `langchain-ai` GitHub organization feature New feature/enhancement or request for one

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants