chore: make functions public, remove callable paths#180
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
Confidence Score: 4/5Safe to merge for the typical CLI workflow; the only noteworthy change is that opencode's config-format selection is now fixed at module import time rather than at install time. The refactor is clean and the rename changes are purely mechanical. The one substantive shift — _opencode_mcp_path() being called eagerly — matters only when the module is imported before the opencode config directory exists and the installer is invoked later in the same process. In the standard CLI flow (fresh process per invocation) the pre-computed path and the previously-lazy path are identical, so no regression is expected there. src/semble/installer/agents.py — the AGENTS list construction now bakes in the opencode and VS Code paths at import time; worth a second look if the module is ever imported in a long-running process or test harness without monkeypatching the paths. Reviews (1): Last reviewed commit: "chore: make functions public, remove cal..." | Re-trigger Greptile |
| @@ -201,7 +196,7 @@ def _vscode_mcp_path() -> Path: | |||
| display_name="VS Code", | |||
| binary="code", | |||
| config_dir=None, | |||
| mcp=McpConfig(_vscode_mcp_path, "servers", _STDIO_SERVER_CONFIG), | |||
| mcp=McpConfig(_vscode_mcp_path(), "servers", _STDIO_SERVER_CONFIG), | |||
There was a problem hiding this comment.
Eager path resolution freezes filesystem-dependent result at import time
_opencode_mcp_path() picks between opencode.jsonc, opencode.json, and a fallback based on which files exist on disk. Calling it eagerly here means the choice is locked in at module import time. Previously it was deferred to install time (via the PathResolver callable), so it would see the actual filesystem state when the user's action is performed. In a programmatic context where the module is imported before the opencode config directory exists, the path will always default to .jsonc even if the user later has an opencode.json — the same path is used for every subsequent call within that process.
This PR makes some functions that were private public again (they were imported as private), and removes the union over Path and Pathresolver. Instead, we just resolve all paths. This simplifies the code.