feat(mcp): add create_and_run_session tool#3368
Open
yonch wants to merge 1 commit into
Open
Conversation
* Add create_and_run_session MCP tool Combines create_session + run_session_prompt into a single call, reducing complexity for skills that need to create parallel sessions with different executors and prompts. Returns session_id, execution_id, session summary, and execution details in one response. * Fix orchestrator tool-list test to include create_and_run_session * Return session_id on follow-up failure in create_and_run_session When session creation succeeds but the prompt fails to start, include the session_id in the error response so callers can retry with run_session_prompt instead of accumulating orphaned sessions. --------- Co-authored-by: Jonathan Perry <yonch@yonch.com>
c8c6798 to
1f9ce11
Compare
Aggressive review summary — PR #3368134-line addition to Why the change is correctThe two-step orchestration is exactly what every MCP caller has to write today: The implementation gates correctly:
Findings
NITs
VerdictApprove. — Reviewed by automated single-pass review (MCP convenience tool; full 4-tool battery skipped — implementation mirrors existing tools, error recovery for partial failure is well-designed). |
This was referenced May 2, 2026
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.
Adds a create_and_run_session MCP tool that combines session creation and prompt execution into a single call, simplifying orchestrator workflows.
Note
Medium Risk
Adds a new session/execution entrypoint that changes orchestrator workflows and error handling around session creation vs. prompt execution; failures could leave partially-created sessions or unexpected executor behavior if not well tested.
Overview
Adds a new MCP tool,
create_and_run_session, that creates a session and immediately starts a coding-agent execution in that session, returning both thesession_idandexecution_idplus serialized session/execution details.The tool validates non-empty prompts, resolves/scope-checks
workspace_id, normalizes the requestedexecutor, and includes a fallback error path that still returns the createdsession_idif execution startup fails (to avoid orphaned sessions). Orchestrator-mode tool exposure is updated via tests to includecreate_and_run_session.Reviewed by Cursor Bugbot for commit 1f9ce11. Bugbot is set up for automated code reviews on this repo. Configure here.