feat(mcp): expose model_id, agent_id, reasoning_id on start_workspace#3382
feat(mcp): expose model_id, agent_id, reasoning_id on start_workspace#3382OdinHoang03 wants to merge 2 commits into
Conversation
The MCP start_workspace tool already accepts executor + variant but hard-codes model_id, agent_id, reasoning_id to None when building ExecutorConfig, even though these fields exist in ExecutorConfig and are reachable from the web UI and REST API. This prevents MCP clients (orchestrators, meta-agents) from tuning model or reasoning effort per dispatched workspace. Add all three as optional string fields on StartWorkspaceRequest and forward them into ExecutorConfig, trimming empty strings to None. permission_policy is left for a follow-up since it requires threading an enum through the MCP schema. Non-breaking: existing MCP callers that omit the new fields see identical behaviour. Fixes BloopAI#3381
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9f22c62. Configure here.
| } else { | ||
| Some(trimmed.to_string()) | ||
| } | ||
| } |
There was a problem hiding this comment.
New helper duplicates existing inline trim logic
Low Severity
The newly introduced trim_to_option helper performs exactly the same trim-and-collapse-to-None logic that already exists inline for prompt and variant in the same function. Introducing the helper but not applying it to the existing identical closures creates duplicated logic within a single function — if the trimming behavior ever changes, it would need updating in three places instead of one.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 9f22c62. Configure here.
Aggressive review summary — PR #338230-line feature in Why the change is correct
Findings
NITs
VerdictApprove. — Reviewed by automated single-pass review (MCP tool-surface triage; full 4-tool battery skipped — diff is 30 lines, all forwarding, no new validation logic). |


Summary
Add
model_id,agent_id, andreasoning_idas optional string fields on the MCPstart_workspacetool and forward them intoExecutorConfig. Non-breaking.Fixes #3381.
Problem
crates/mcp/src/task_server/tools/task_attempts.rsexposes onlyexecutorandvariant, even thoughExecutorConfig(crates/executors/src/profile.rs) has three more user-selectable override fields —model_id,agent_id,reasoning_id— pluspermission_policy. The web UI and REST API reach those fields; MCP clients cannot.Because the bundled
default_profiles.jsonships only theDEFAULTvariant per executor,variantalone cannot distinguish between e.g. sonnet:medium vs sonnet:high from an MCP caller. That removes a whole axis of cost/quality control for orchestrators.Change
StartWorkspaceRequest:model_id,agent_id,reasoning_id— allOption<String>.ExecutorConfig, trimming empty strings toNonevia a smalltrim_to_optionhelper.Scope notes
permission_policyis intentionally left for a follow-up — it is an enum (PermissionPolicy) rather than a string, so threading it through the MCP schema needs a separate decision on derivingJsonSchemaupstream incrates/executorsvs mirroring it in the MCP crate.list_executor_profilestool) is also out of scope here.Compatibility
Existing MCP callers that omit the new fields see identical behaviour — the three fields collapse to
Noneon the wire, which matches the current hard-codedNonevalues. Only callers that opt in get the new behaviour.Test plan
cargo check -p mcpon the branch — clean compile.cargo fmt -p mcp— no formatting delta.Checklist
Note
Low Risk
Low risk: adds optional parameters to the MCP
start_workspacetool and forwards them into the existingExecutorConfigwithout changing defaults for current callers.Overview
Adds optional
model_id,agent_id, andreasoning_idfields to the MCPstart_workspacerequest schema and threads them through the handler intoExecutorConfigwhen starting a workspace.Empty/whitespace values are normalized to
Nonevia a smalltrim_to_optionhelper, preserving existing behavior when the new fields are omitted.Reviewed by Cursor Bugbot for commit e568c47. Bugbot is set up for automated code reviews on this repo. Configure here.