fix: opencode marimo-pair skill discovery#9225
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR fixes marimo-pair skill discovery for the opencode agent by updating how candidate skill directories are computed and ensuring they’re evaluated using the current working directory at runtime.
Changes:
- Add
_opencode_skill_dirs()to search.opencode/skillsplus Claude/agents-compatible layouts. - Replace the module-level
AGENTSdict withpair_agents()soPath.cwd()/Path.home()are evaluated at call time. - Add a unit test asserting the expected opencode skill directory search order.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
marimo/_cli/pair/commands.py |
Adds opencode skill directory discovery and switches agent config construction to runtime via pair_agents(). |
tests/_cli/test_cli_pair.py |
Adds coverage for _opencode_skill_dirs() output ordering/paths. |
| cwd = Path.cwd() | ||
| home = Path.home() | ||
| assert _opencode_skill_dirs() == [ | ||
| cwd / ".opencode" / "skills", | ||
| home / ".config" / "opencode" / "skills", | ||
| cwd / ".claude" / "skills", | ||
| home / ".claude" / "skills", | ||
| cwd / ".agents" / "skills", | ||
| home / ".agents" / "skills", | ||
| ] |
There was a problem hiding this comment.
This test hard-codes the global opencode directory as Path.home() / ".config" / "opencode" / "skills". If $XDG_CONFIG_HOME is set (or if the implementation is updated to respect XDG, consistent with marimo/_utils/xdg.py), this expectation will be wrong. Patch XDG_CONFIG_HOME in the test and/or build the expected path via xdg_config_home() to keep the test robust across environments.
| cwd = Path.cwd() | ||
| home = Path.home() | ||
| return [ | ||
| cwd / ".opencode" / "skills", | ||
| home / ".config" / "opencode" / "skills", | ||
| cwd / ".claude" / "skills", | ||
| home / ".claude" / "skills", | ||
| cwd / ".agents" / "skills", | ||
| home / ".agents" / "skills", |
There was a problem hiding this comment.
The global opencode search path is hard-coded to Path.home() / ".config" / "opencode" / "skills", which ignores $XDG_CONFIG_HOME. The repo already has XDG helpers (marimo/_utils/xdg.py) used for config locations; using xdg_config_home() / "opencode" / "skills" (and ideally home_path() to avoid Path.home() RuntimeError) would make skill discovery work in XDG-customized environments and keep the docstring accurate.
There was a problem hiding this comment.
Sorry, I think it would be worth to support XDG_CONFIG_HOME, esp if we have helper for it.
There was a problem hiding this comment.
im just following the docs
| cwd = Path.cwd() | ||
| home = Path.home() | ||
| return [ | ||
| cwd / ".opencode" / "skills", | ||
| home / ".config" / "opencode" / "skills", | ||
| cwd / ".claude" / "skills", | ||
| home / ".claude" / "skills", | ||
| cwd / ".agents" / "skills", | ||
| home / ".agents" / "skills", |
Include more dirs in the discovery for open code skills, per their docs. https://opencode.ai/docs/skills/