GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Use the built-in build agent instead of a custom agent · llamauser/solidworks-mcp-python@93e2d6b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .opencode
    • solidworks-prompt.md
  • README.md
  • docs
    • model-test-prompts.md
  • install.ps1
  • opencode.json
  • prompt.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.opencode/agents/solidworks.md‎ ‎.opencode/solidworks-prompt.md‎.opencode/agents/solidworks.md renamed to .opencode/solidworks-prompt.md

Copy file name to clipboardExpand all lines: .opencode/solidworks-prompt.md
-14Lines changed: 0 additions & 14 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
---
2-
description: Inspect and edit the model open in SolidWorks, using only the solidworks tools
3-
mode: primary
4-
temperature: 0.1
5-
steps: 25
6-
permission:
7-
bash: deny
8-
edit: deny
9-
webfetch: deny
10-
websearch: deny
11-
task: deny
12-
solidworks_*: allow
13-
---
14-
151
You help the user inspect and change the model that is open in SolidWorks.
162

173
Rules:
Collapse file

‎README.md‎

Copy file name to clipboardExpand all lines: README.md
+11-3Lines changed: 11 additions & 3 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ installs.
2828
## Using it from OpenCode
2929

3030
Run `opencode` in this folder. It reads `opencode.json` and starts the server itself over stdio.
31-
Press **Tab** to switch to the **solidworks** agent (`.opencode/agents/solidworks.md`). That agent
32-
can only use the SolidWorks tools: shell and file editing are denied, so the model cannot drift
33-
into writing its own COM scripts. Then pick a model and ask, for example:
31+
In this folder, the default **build** agent is reconfigured by `opencode.json`: it uses the
32+
instructions in `.opencode/solidworks-prompt.md` and may only use the SolidWorks tools. Shell and
33+
file editing are denied, so the model cannot drift into writing its own COM scripts. Pick a model
34+
and ask, for example:
3435

3536
> What is open in SolidWorks? … *(click a face)* … make this 5 mm thicker and export a STEP to C:\Temp\part.step
3637
@@ -84,6 +85,13 @@ OpenCode `"type": "remote"` entry with `"url": "http://127.0.0.1:8765/mcp"`.
8485

8586
## Troubleshooting
8687

88+
- **"OpenCode's free tier can only be used from within OpenCode".** This is an OpenCode bug
89+
([anomalyco/opencode#50806](https://github.com/anomalyco/opencode/issues/50806),
90+
[#49592](https://github.com/anomalyco/opencode/issues/49592)): free models only accept requests
91+
from the built-in `build` agent. That is why this project reconfigures `build` instead of
92+
adding a custom agent. Session titles and auto-compaction can hit the same error on free
93+
models; start a new session when a long one stops.
94+
8795
- **`SW_STARTING` never ends.** SolidWorks is running but not visible to COM. Close any
8896
dialog box in SolidWorks. Then check that SolidWorks and OpenCode run as the same Windows
8997
user, and either both or neither with "Run as administrator".
Collapse file

‎docs/model-test-prompts.md‎

Copy file name to clipboardExpand all lines: docs/model-test-prompts.md
+3-2Lines changed: 3 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Comparing the free OpenCode models
22

3-
Run these five prompts with each model, using the **solidworks** agent (press Tab in OpenCode).
3+
Run these five prompts with each model, using the default **build** agent in this folder.
4+
`opencode.json` locks that agent to the SolidWorks tools.
45
Start each model from the same state: SolidWorks open, the smoke-test block (or any simple part)
56
open, and nothing selected. Mark a prompt as a pass only if the model called the expected tools
67
and reported the numbers the tools actually returned.
@@ -16,7 +17,7 @@ and reported the numbers the tools actually returned.
1617
Watch for these failure patterns:
1718
- **Wrong units:** it passes meters (0.015) instead of millimeters (15). The server flags suspicious jumps in a `warning` field.
1819
- **Invented names:** it guesses `D1@Extrude1` instead of copying the name from `dims`.
19-
- **Code instead of tools:** it tries to write a script. The agent blocks bash and edit, but note it anyway.
20+
- **Code instead of tools:** it tries to write a script. The config blocks bash and edit, but note it anyway.
2021
- **Retry loops:** it repeats the same failing call instead of following `fix`.
2122

2223
## Scorecard
Collapse file

‎install.ps1‎

Copy file name to clipboardExpand all lines: install.ps1
+15-1Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,20 @@ $json = @"
2929
"enabled": true,
3030
"timeout": 10000
3131
}
32+
},
33+
"agent": {
34+
"build": {
35+
"prompt": "{file:./.opencode/solidworks-prompt.md}",
36+
"temperature": 0.1,
37+
"permission": {
38+
"bash": "deny",
39+
"edit": "deny",
40+
"webfetch": "deny",
41+
"websearch": "deny",
42+
"task": "deny",
43+
"solidworks_*": "allow"
44+
}
45+
}
3246
}
3347
}
3448
"@
@@ -44,5 +58,5 @@ Write-Host " 1. Open SolidWorks (or let the smoke test start it)."
4458
Write-Host " 2. Run the end-to-end check: .venv\Scripts\python scripts\smoke_test.py"
4559
Write-Host " and send back smoke_test_report.txt"
4660
Write-Host " 3. Start OpenCode in this folder: opencode"
47-
Write-Host " Press Tab to switch to the 'solidworks' agent, pick a model, and ask:"
61+
Write-Host " Use the default 'build' agent (in this folder it is locked to the SolidWorks tools), pick a model, and ask:"
4862
Write-Host " 'What version of SolidWorks is running?'"
Collapse file

‎opencode.json‎

Copy file name to clipboardExpand all lines: opencode.json
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,19 @@
77
"enabled": true,
88
"timeout": 10000
99
}
10+
},
11+
"agent": {
12+
"build": {
13+
"prompt": "{file:./.opencode/solidworks-prompt.md}",
14+
"temperature": 0.1,
15+
"permission": {
16+
"bash": "deny",
17+
"edit": "deny",
18+
"webfetch": "deny",
19+
"websearch": "deny",
20+
"task": "deny",
21+
"solidworks_*": "allow"
22+
}
23+
}
1024
}
1125
}
Collapse file

‎prompt.md‎

Copy file name to clipboardExpand all lines: prompt.md
+2Lines changed: 2 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ Next batch after these: `new_part`, `create_sketch(plane)`, `sketch_rectangle`,
129129
- [x] Wrote the tests (`tests/fakes/fake_sw.py`, plus test files for com_utils, com_worker, resilience, tools and tool schemas): **59 passing** (`.venv/Scripts/python -m pytest -q`).
130130
- [x] Wrote `scripts/smoke_test.py`. Run here, it starts the real server over stdio in 1.5 s and reports NO_SOLIDWORKS cleanly.
131131
- [x] Wrote `opencode.json`, `.opencode/agents/solidworks.md` (denies bash, edit, webfetch, websearch and task; allows `solidworks_*`), `install.ps1` (tested here: writes opencode.json as valid JSON with no BOM), `docs/model-test-prompts.md`, `README.md` and `.gitignore`.
132+
- [x] Pushed to the private repo https://github.com/llamauser/solidworks-mcp-python (`references/` is excluded).
133+
- [x] **Changed after the user's first OpenCode run:** OpenCode's free tier rejects custom agents with "OpenCode's free tier can only be used from within OpenCode" (anomalyco/opencode#50806, #49592; only `agent=build` is accepted). The custom agent `.opencode/agents/solidworks.md` was **removed**. `opencode.json` (and `install.ps1`) now reconfigure the built-in `build` agent instead: prompt `{file:./.opencode/solidworks-prompt.md}`, temperature 0.1, and the same deny/allow permissions. The notes above about a custom agent file are superseded.
132134
- [ ] **Waiting on the user:** run `install.ps1` and `scripts/smoke_test.py` on the SolidWorks PC, then paste back `smoke_test_report.txt`.
133135

134136
### Not yet verified on real SolidWorks (check these in the smoke report)

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.