You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: address reviewer feedback on working_dir feature
B1: pass resolved CWD to NewGatewayToolset; gateway-based MCPs now
honour working_dir. Remote MCP toolsets reject working_dir at
validation time (no local subprocess).
B2: call path.ExpandPath in resolveToolsetWorkingDir so ~ and
${VAR}/$VAR are expanded before path operations. Use filepath.Abs
when joining a relative path with the agent dir (fixes file://./backend
LSP root URI).
S1: add checkDirExists helper; createMCPTool and createLSPTool now
surface a clear error if working_dir does not exist at tool-creation
time.
S2: doc comment on resolveToolsetWorkingDir explains no-containment-
check posture (working_dir is treated like command/args).
S3: filepath.Abs on relative+non-empty-agentDir path ensures LSP
rootURI is always absolute.
S4: validation rejects working_dir on remote MCP toolsets.
S5: comment in applyMCPDefaults explains empty-string inheritance
semantics.
S6: doc comment covers the empty-agent-dir+relative edge case.
Nits: example model → gpt-5-mini; test name → 'bare relative dir';
schema descriptions aligned; import groups tidied; hard-coded
non-existent path in test → t.TempDir()+'/missing'.
N5: integration tests added:
- TestCreateMCPTool_WorkingDir_ReachesSubprocess
- TestCreateMCPTool_RelativeWorkingDir_ResolvedAgainstAgentDir
- TestCreateMCPTool_NonexistentWorkingDir_ReturnsError
- TestCreateLSPTool_WorkingDir_ReachesHandler
Also add WorkingDir() accessors on *mcp.Toolset and *builtin.LSPTool
to support the above integration tests.
Assisted-By: docker-agent
Copy file name to clipboardExpand all lines: agent-schema.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -904,7 +904,7 @@
904
904
},
905
905
"working_dir": {
906
906
"type": "string",
907
-
"description": "Optional working directory for the MCP server process. Relative paths are resolved relative to the agent's working directory."
907
+
"description": "Optional working directory for the MCP server process. Relative paths are resolved relative to the agent's working directory. Only valid for subprocess-based MCP types (command or ref); not supported for remote MCP toolsets."
908
908
}
909
909
},
910
910
"anyOf": [
@@ -1148,7 +1148,7 @@
1148
1148
},
1149
1149
"working_dir": {
1150
1150
"type": "string",
1151
-
"description": "Optional working directory for MCP/LSP toolset processes. Relative paths are resolved relative to the agent's working directory. Only valid for type 'mcp' or 'lsp'."
1151
+
"description": "Optional working directory for MCP/LSP toolset processes. Relative paths are resolved relative to the agent's working directory. Only valid for type 'mcp' or 'lsp', and not supported for remote MCP toolsets (no local subprocess)."
0 commit comments