Sync Sakura AI Engine models automatically - #108
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:e7b2ae35ef
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Consolidated review from two automated passes (pr-review-toolkit: code/comments/tests/errors/types, run in parallel, plus Claude Code's security-review with adversarial false-positive filtering). All findings below were independently verified against the current PR diff and surrounding code (including cross-checking .github/workflows/opencode-bot.yml and run-opencode.sh). No high-confidence security vulnerabilities survived the adversarial filtering pass — two candidates (an awk brace-depth desync from crafted model IDs, and unsanitized model IDs in log output) were both excluded as speculative / not concrete security issues (the latter also falls under standard "log spoofing is not a vulnerability" guidance), though the underlying brace-depth fragility is noted below as a correctness issue. Remaining items are correctness/robustness and test-coverage gaps, left as inline comments. Nice to see the fail-closed design intent (empty-listing guard, set -euo pipefail, pinned action SHAs, scoped workflow permissions, no pull_request trigger) — the comments below are refinements on top of that, not blockers to the overall approach.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The trusted-context validation gate has failed: Per the pr-review skill's fail-closed rules ("Once Review status: aborted — no findings published.
|
dceoy
left a comment
There was a problem hiding this comment.
Reviewed the current head (cdb79441a1b96f1b0b40f832aa34de7d16622898). The earlier provider-scoping, partial-extraction, default-model, and failure-path coverage issues are addressed. One correctness issue remains in the probe classification below.
Uh oh!
There was an error while loading. Please reload this page.
dceoy
left a comment
There was a problem hiding this comment.
Found one merge-blocking functional issue in the production model-classification path. CI is green, but the normal mock does not reproduce Sakura's mixed model listing.
Uh oh!
There was an error while loading. Please reload this page.
dceoy
left a comment
There was a problem hiding this comment.
Reviewed current head 52cc515aee909b7e6457fefc9e6d88159bd5ccd6. The previously reported provider-scoping, partial-extraction, default-model, ambiguous-4xx, and mixed non-chat-model issues are addressed, and CI is green. I found one remaining operational correctness issue: the documented minimal configuration can create sync PRs whose CI does not run automatically.
Uh oh!
There was an error while loading. Please reload this page.
dceoy
left a comment
There was a problem hiding this comment.
Found one configuration issue that should be fixed before relying on the scheduled sync. CI is currently green, and the previously reported model-filtering/default-model issues are addressed in the current head.
Uh oh!
There was an error while loading. Please reload this page.
dceoy
left a comment
There was a problem hiding this comment.
Reviewed current head 145d1164a0be5ccb4087d6676d00ca1d3c026620. CI is green and the previously reported functional issues are addressed. I found one remaining least-privilege issue in the scheduled workflow.
Uh oh!
There was an error while loading. Please reload this page.
dceoy
left a comment
There was a problem hiding this comment.
Reviewed current head ceb40d809d8e74cbf513d97dd8266bed6826e01a. The previously reported provider scoping, partial extraction, default-model consistency, ambiguous probe handling, mixed non-chat model handling, dedicated-token configuration, and least-privilege issues are addressed. CI is green, including Bats, shell lint, and GitHub Actions lint/scan. I found no additional high-confidence merge blockers in the current diff.
3a8a135 to
26edfaaCompareUh oh!
There was an error while loading. Please reload this page.

Summary
/v1/chat/completionsto keep only OpenCode-usable chat modelsGITHUB_TOKENwithcontents: writeandpull-requests: writeto create sync PRsConfiguration
The scheduled workflow requires only the repository secret
SAKURA_AI_ENGINE_API_KEY. It uses the workflowGITHUB_TOKENfor repository writes and pull request creation; noGH_TOKENor personal access token is required.Because GitHub suppresses new workflow runs for events triggered by
GITHUB_TOKEN, sync PRs created by this workflow do not automatically triggerpull_requestworkflows.Validation
bash -n scripts/sync-sakura-models.shmodelsblock and preserves the rest ofopencode.jsonc/v1/modelsresponse exits non-zero without modifying the config