The sub-agent system lets the main model delegate tasks to a secondary language model running at any OpenAI-compatible endpoint — including models on a remote machine accessed via LM Studio's LM Link feature.
When consult_secondary_agent is called:
{endpoint}/models with a 4-second timeout. If the endpoint is unreachable, the error is returned immediately (no wasted turns).SUB_AGENT_INSTRUCTIONS.md in the workspace (if present)toolbox_info.md project history (if present)subAgentProfiles config)subAgentTimeLimit). On each turn the sub-agent either calls a tool (handled locally by the plugin) or produces final output.~/.lm-studio-toolbox/last_sub_agent_result.json. Call get_sub_agent_result to re-read it without starting a new session.File-writing roles have filesystem access enabled automatically — you don't need to pass allow_tools: true:
| Role | Filesystem | Web | Code |
|---|---|---|---|
coder | ✅ | — | ✅ |
reviewer | ✅ | — | — |
researcher | — | ✅ | — |
debugger | ✅ | — | ✅ |
tester | ✅ | — | ✅ |
documenter | ✅ | — | — |
planner | ✅ | — | — |
data_analyst | ✅ | — | ✅ |
general | ✅ | — | — |
These are still gated by the user's config flags (subAgentAllowFileSystem, subAgentAllowWeb, subAgentAllowCode). If a flag is off, that tool category is unavailable regardless of role.
LM Link lets you expose a remote LM Studio instance over the network. A common setup:
Tool calls always execute on the machine running the plugin (voyager). The remote model (enterprise-e) outputs JSON like {"tool":"save_file","args":{...}}; voyager's plugin intercepts it, runs the tool locally, and sends the result back to the remote model. The remote model never directly touches voyager's file system — it only receives text outputs.
This means:
save_file writes to voyager's disk ✅read_file reads from voyager's disk ✅| Issue | Cause | Fix |
|---|---|---|
| Sub-agent returns empty output | Remote model doesn't support JSON tool-call format | Use a stronger model; enable enableSubAgentDebugLogging to see raw responses |
| Slow turns / timeout | Network latency to remote host multiplied by 8 turns | Increase subAgentTimeLimit; reduce loopLimit for simple tasks |
| ECONNREFUSED error | LM Link not running or wrong endpoint configured | Verify LM Link is active on enterprise-e; check secondaryAgentEndpoint in plugin settings |
| Model uses wrong tool format | Smaller models hallucinate tool-call syntax | Increase model size; tune subAgentProfiles system prompt for the model's native format |
| Files not produced | subAgentAllowFileSystem is off | Enable it in plugin settings |
Enable enableSubAgentDebugLogging in the plugin settings. This prints each raw response from the secondary model to LM Studio's plugin console. If you see the model outputting prose instead of JSON like {"tool":"save_file",...}, the model doesn't reliably support the expected JSON tool-call format.
Models known to work well as sub-agents:
Models that may struggle:
subAgentAllowFileSystem is enabled in plugin settingsenableSubAgentDebugLogging and check the raw responsessave_filesubAgentAutoSave — this auto-extracts code blocks and saves them even without explicit tool callsThe sub-agent tool is synchronous — it runs, returns, and is done. If the main model calls it again:
[GENERATED_FILES] marker, empty response)Fix: call get_sub_agent_result instead of consult_secondary_agent to re-read without re-running.
The main model infers role from the task description. To fix:
agent_role in every consult_secondary_agent callThe sub-agent explicitly could not complete the task. The error is now returned directly to the main model with a clear message. Retry with a more detailed context, a stronger model, or split the task into smaller sub-tasks.
curl http://enterprise-e.local:1234/v1/modelssubAgentTimeLimit to account for network latency on each turnenableSubAgentDebugLogging: true — see raw model responsessubAgentAllowFileSystem: true — required for any file-writing role/v1/models)secondaryModelId matches the model ID shown in LM StudiosubAgentTimeLimit is high enough (default: 600s)// ~/.lm-studio-toolbox/mcp-config.json (for MCP mode)
// or plugin settings for LM Studio plugin mode
{
"secondaryAgentEndpoint": "http://enterprise-e.local:1234/v1",
"secondaryModelId": "your-model-id",
"subAgentAllowFileSystem": true,
"subAgentAllowWeb": false,
"subAgentTimeLimit": 300
}