Repository navigation
ci: configure Pullfrog for Z.AI Coding Plan - #8
Conversation
|
Warning Review limit reached
Next review available in: 19 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by QodoCI: add Pullfrog workflow and OpenCode provider config for Z.AI Coding Plan
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review SummaryThe review did not run because the selected model is no longer available. Choose another model in Kilo Code review settings: https://app.kilo.ai/code-reviews |
There was a problem hiding this comment.
Code Review
This pull request adds a new configuration file "opencode.json" to enable the "zai-coding-plan" provider with the "glm-5.2" model. The reviewer recommends explicitly defining the "model" and "small_model" keys at the root of the configuration to ensure OpenCode can correctly resolve the default models and avoid potential errors.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| { | ||
| "$schema": "https://opencode.ai/config.json", | ||
| "enabled_providers": ["zai-coding-plan"], | ||
| "provider": { |
There was a problem hiding this comment.
To ensure OpenCode automatically selects the newly configured zai-coding-plan/glm-5.2 model as the default model for both primary and lightweight tasks, you should explicitly define the model and small_model keys in the root of the configuration. Without these, OpenCode may fail to resolve a default model or attempt to use an unavailable provider.
{
"$schema": "https://opencode.ai/config.json",
"enabled_providers": ["zai-coding-plan"],
"model": "zai-coding-plan/glm-5.2",
"small_model": "zai-coding-plan/glm-5.2",
"provider": {
Code Review by Qodo
Context used✅ Compliance rules (platform):
8 rules 1. Unpinned third-party action
|
| env: | ||
| PULLFROG_MODEL: zai-coding-plan/glm-5.2 | ||
| OPENCODE_CONFIG: ${{ github.workspace }}/opencode.json | ||
| ZAI_API_KEY: ${{ secrets.ZAI_API_KEY }} | ||
|
|
||
| # add at least one provider API key | ||
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | ||
| CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | ||
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| GOOGLE_GENERATIVE_AI_API_KEY: | ||
| ${{ secrets.GOOGLE_GENERATIVE_AI_API_KEY }} | ||
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | ||
| XAI_API_KEY: ${{ secrets.XAI_API_KEY }} | ||
| DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }} | ||
| MOONSHOT_API_KEY: ${{ secrets.MOONSHOT_API_KEY }} | ||
| OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} | ||
| OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} |
There was a problem hiding this comment.
1. Unnecessary secrets exposed 🐞 Bug ⛨ Security
The Pullfrog step exports many provider API keys into the environment even though opencode.json only enables zai-coding-plan and only references ZAI_API_KEY, increasing the blast radius if the action (or anything it runs) is compromised. This also makes it easier to accidentally depend on unrelated credentials later without noticing.
Agent Prompt
### Issue description
`.github/workflows/pullfrog.yml` injects many unrelated provider secrets (Anthropic/OpenAI/etc.) into the Pullfrog job environment, but `opencode.json` enables only the `zai-coding-plan` provider and reads only `ZAI_API_KEY`. This unnecessarily exposes additional secrets to a third-party action and any subprocesses it executes.
### Issue Context
- `opencode.json` selects `zai-coding-plan` as the only enabled provider and pulls its key from `{env:ZAI_API_KEY}`.
- The workflow still passes a large set of other API keys as environment variables.
### Fix Focus Areas
- .github/workflows/pullfrog.yml[33-49]
- opencode.json[3-11]
### Suggested fix
Keep only the secrets required for the configured provider (likely `ZAI_API_KEY`, and any strictly required Pullfrog/OpenCode non-provider tokens if applicable). If you want optional multi-provider support, consider documenting an explicit switch and only exporting the relevant provider key(s) when that provider is selected.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| permissions: | ||
| id-token: write | ||
| contents: read |
There was a problem hiding this comment.
2. Overbroad oidc token permission 🐞 Bug ⛨ Security
The job grants id-token: write even though the workflow doesn’t use OIDC anywhere, which allows any step in the job to mint an OIDC token. This is avoidable privilege that can be abused if a workflow dependency is compromised or later modified.
Agent Prompt
### Issue description
The Pullfrog job requests `permissions: id-token: write` but does not perform any OIDC-based auth in the shown steps. This is broader privilege than necessary.
### Issue Context
OIDC tokens can be exchanged for cloud credentials when org/repo trust policies exist. Keeping `id-token: write` only when needed reduces the impact of any compromised or misbehaving action.
### Fix Focus Areas
- .github/workflows/pullfrog.yml[20-22]
### Suggested fix
Remove `id-token: write` (or set it to `none`) unless you add a concrete OIDC consumer step that requires it.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| - name: Run agent | ||
| uses: pullfrog/pullfrog@v0 | ||
| with: | ||
| prompt: ${{ inputs.prompt }} | ||
| model: zai-coding-plan/glm-5.2 |
There was a problem hiding this comment.
3. Unpinned third-party action 🐞 Bug ⛨ Security
The workflow uses pullfrog/pullfrog@v0, which is not pinned to an immutable commit SHA; the code executed by this workflow can change if the tag moves. Because this job passes secrets via environment variables, tag movement or compromise can escalate to secret exfiltration.
Agent Prompt
### Issue description
The workflow references a third-party GitHub Action using a mutable tag (`pullfrog/pullfrog@v0`). Mutable tags can be retargeted, causing the workflow to execute different code than what was reviewed.
### Issue Context
This job also provides secrets in `env`, increasing the potential impact of a supply-chain issue.
### Fix Focus Areas
- .github/workflows/pullfrog.yml[28-36]
### Suggested fix
Pin `pullfrog/pullfrog` to a specific commit SHA (and optionally add a comment noting the upstream release/version). Consider enabling Dependabot updates for GitHub Actions so you still get automated upgrades while keeping immutability.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| uses: pullfrog/pullfrog@v0 | ||
| with: | ||
| prompt: ${{ inputs.prompt }} | ||
| model: zai-coding-plan/glm-5.2 | ||
| env: | ||
| PULLFROG_MODEL: zai-coding-plan/glm-5.2 | ||
| OPENCODE_CONFIG: ${{ github.workspace }}/opencode.json | ||
| ZAI_API_KEY: ${{ secrets.ZAI_API_KEY }} | ||
|
|
||
| # add at least one provider API key | ||
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | ||
| CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | ||
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| GOOGLE_GENERATIVE_AI_API_KEY: | ||
| ${{ secrets.GOOGLE_GENERATIVE_AI_API_KEY }} | ||
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | ||
| XAI_API_KEY: ${{ secrets.XAI_API_KEY }} | ||
| DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }} | ||
| MOONSHOT_API_KEY: ${{ secrets.MOONSHOT_API_KEY }} | ||
| OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} | ||
| OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} |
There was a problem hiding this comment.
Broad secret exposure to unverified third-party action
The pullfrog/pullfrog@v0 action (a third-party action pinned only to a mutable floating tag) receives ten high-value API secrets in the same env block — including ANTHROPIC_API_KEY, CLAUDE_CODE_OAUTH_TOKEN, OPENAI_API_KEY, GEMINI_API_KEY, and others. If this action is compromised or updated maliciously, all those secrets are exfiltrated in one step. Only ZAI_API_KEY and OPENCODE_CONFIG are actually required to run the Z.AI provider; every other key should be removed from this job's environment.
| with: | ||
| fetch-depth: 1 | ||
| - name: Run agent | ||
| uses: pullfrog/pullfrog@v0 |
There was a problem hiding this comment.
Third-party action pinned to a mutable floating tag
pullfrog/pullfrog@v0 uses a mutable version tag. Any update pushed to that tag — including a malicious one — is silently picked up on the next run. Pin to a full commit SHA to protect against this supply-chain vector.
| uses: pullfrog/pullfrog@v0 | |
| uses: pullfrog/pullfrog@<COMMIT-SHA> # pin to a specific commit SHA |
| with: | ||
| prompt: ${{ inputs.prompt }} | ||
| model: zai-coding-plan/glm-5.2 | ||
| env: | ||
| PULLFROG_MODEL: zai-coding-plan/glm-5.2 |
There was a problem hiding this comment.
The model is specified twice: once in with: model: (which the Pullfrog action reads directly) and again in env: PULLFROG_MODEL:. If these two values ever diverge during maintenance, the effective model may differ from what is documented in the workflow. Pick one authoritative source.
| with: | |
| prompt: ${{ inputs.prompt }} | |
| model: zai-coding-plan/glm-5.2 | |
| env: | |
| PULLFROG_MODEL: zai-coding-plan/glm-5.2 | |
| with: | |
| prompt: ${{ inputs.prompt }} | |
| model: zai-coding-plan/glm-5.2 | |
| env: | |
| # PULLFROG_MODEL: zai-coding-plan/glm-5.2 # redundant if with: model: is the canonical source |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| permissions: | ||
| id-token: write | ||
| contents: read |
There was a problem hiding this comment.
id-token: write granted to a job running a third-party action
The id-token: write permission allows the job to mint OIDC tokens that can be used to authenticate against cloud providers. Since pullfrog/pullfrog@v0 is a third-party action running with access to the same environment, a compromised version of that action could use this token. Drop this permission if OIDC authentication isn't explicitly required by the Pullfrog action for the Z.AI provider.
| "options": { | ||
| "aisdk": { | ||
| "request": { | ||
| "reasoningEffort": "xhigh" |
There was a problem hiding this comment.
Non-standard
reasoningEffort value
"xhigh" is not a recognized value in the OpenAI-compatible API spec — the valid options are "low", "medium", and "high". When @ai-sdk/openai-compatible forwards this to the Z.AI endpoint, the API will either reject every agent request with a 400-series error or silently drop the field and run without any reasoning constraint. If Z.AI does support a custom "xhigh" tier, a comment citing their docs would clarify the intent; otherwise "high" is the correct value to use here.
455de25 to
a4b057e
Compare
Summary
zai-coding-plan/glm-5.2model.opencode.jsonprovider config for the Z.AI Coding Plan endpoint.PULLFROG_MODEL,OPENCODE_CONFIG, andZAI_API_KEYwithout committing secrets.Validation
jq empty opencode.jsonyq e . .github/workflows/pullfrog.yml >/dev/nullNotes
This mirrors the working setup validated in
rabesss/impartus-cli#81, where Pullfrog loaded inherited secrets and ran aszai-coding-plan/glm-5.2.