Repository navigation
feat(mcp): implement F-mcp-agent-loop prompt_in_session tool (#196) - #319
Merged
Merged
Conversation
Add the composed agent-loop MCP tool `prompt_in_session` which combines run_in_session, wait_for_status, and read_terminal into a single round trip. - Add `prompt_in_session` tool to `TermherdMcp` in `crates/app/src/mcp/handler.rs`. - Add `McpSettings` with `allow_claude_nesting` (default false) to `Settings` in `crates/app/src/settings.rs`. - Shell sessions are allowed by default; nested Claude sessions require opt-in. - Update roadmap status for F-mcp-agent-loop (#196). Closes #196
…mpt_in_session Extract helper methods (fetch_session_info, wait_for_session_status, read_session_terminal, check_claude_nesting) to keep prompt_in_session under 40 lines and add unit tests targeting check_claude_nesting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements F-mcp-agent-loop (#196): the composed agent-loop MCP tool
prompt_in_session, combiningrun_in_session(text input),wait_for_status(synchronisation), andread_terminal(observation) into a single MCP round trip.Changes
crates/app/src/mcp/handler.rs:prompt_in_sessiontool method andPromptInSessionArgsstruct.CALL_TIMEOUT,wait_timeout,READ_BACK_TIMEOUT).SessionKind::Claude).prompt_in_session_happy_path_for_shell_session,prompt_in_session_rejects_nested_claude_without_opt_in,prompt_in_session_allows_nested_claude_with_per_call_opt_in).sweep_caseintegration test sweep for structured content response verification.crates/app/src/settings.rs:McpSettingswithallow_claude_nesting: bool(defaultfalse).McpSettingsdefault and JSON deserialisation..roadmap/features/f-mcp-agent-loop.mdstatus todoneand regeneratedROADMAP.mdviajust roadmap.Closes #196