fix(providers): mkdir opencode's config home before the render write (#1110) - #1112
Merged
Merged
Conversation
…1110) The agent image never pre-creates ~/.config/opencode, and main() wrote opencode.json without mkdir-ing its parent, so every OpenRouter-routed spawn exited 1 on FileNotFoundError before the CLI ever started (same crash on fe-dev-1, fe-pm, the auditor). The bash-guard plugin write already mkdir'd its parents; the config write now does the same. Regression test mirrors the plugin-write parents test with a missing .config/opencode prefix.
|
Thanks for opening your first pull request on RoboCo! Quick checklist before review (most of these are enforced by CI, but worth a glance):
See CONTRIBUTING.md for the full workflow and the Code of Conduct for the community standards we follow. Welcome aboard — a maintainer will review shortly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked onto #1109 (merges into the devops PR, then rides it to slave).
Bug
Every OpenRouter-routed agent spawn exited 1 immediately:
openrouter_cli_config.main()wroteopencode.jsonwithout creating~/.config/opencodefirst, and the agent image never pre-creates that directory. Same crash on fe-dev-1, fe-pm, and the auditor. Fixes #1110.Fix
main()nowmkdir(parents=True, exist_ok=True)s the config parent before the write, mirroring what the bash-guard plugin write already did. Regression test renders into a nonexistent.config/opencode/prefix.Verification
test_main_creates_missing_config_dir+ the fulltest_openrouter_cli_config.pysuite pass locallyuv run ruff check+format --checkclean