Skip to content

feat: add Volcengine Ark Agent Plan provider - #615

Closed
mrmign wants to merge 4 commits into
lidge-jun:devfrom
mrmign:feat/volcengine-provider
Closed

feat: add Volcengine Ark Agent Plan provider#615
mrmign wants to merge 4 commits into
lidge-jun:devfrom
mrmign:feat/volcengine-provider

Conversation

@mrmign

@mrmign mrmign commented Jul 28, 2026

Copy link
Copy Markdown

Summary

  • Add the Volcengine Ark Agent Plan provider preset using the official Responses endpoint and /responses path.
  • Surface Volcengine Ark model metadata from the documented model table, including context windows, max output token budgets, and text input modalities.
  • Add dashboard/provider catalog plumbing for provider-specific responsesPath propagation and use the official Volcengine favicon URL in the GUI provider icon map.
  • Exclude custom models attached to disabled providers from routed catalog gathering.

Verification

  • bun test ./tests/provider-registry-parity.test.ts ./tests/codex-catalog.test.ts
  • bun run typecheck

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Summary by CodeRabbit

  • New Features

    • Added support for the Volcengine Ark Agent Plan provider, including model metadata, branding, and response routing.
    • Provider configurations can now preserve custom response paths.
    • Disabled providers are excluded from routed custom models.
  • Bug Fixes

    • Improved pull request labeling reliability by granting the workflow required permissions.
  • Chores

    • Expanded repository safeguards for local agent and session artifacts.
    • Removed obsolete planning and process records.
    • Updated the application version to 2.7.42.
  • Tests

    • Added coverage for provider registration, routing behavior, and repository hygiene.

lidge-jun and others added 4 commits July 28, 2026 02:34
* fix(ci): let the PR labeler actually write labels

* test(ci): pin the labeler to the permissions the API demands
The .codexclaw/ goalplans and ledgers are per-machine agent state. They were
committed with 'git add -f' despite the ignore rule, and once tracked the rule
stopped applying, so they rode along into main and preview.

Untrack them (files stay on disk), drop two .DS_Store files that got in the same
way, and add tests/repo-hygiene.test.ts so a forced add fails CI instead of
landing silently. Also drop a registry.ts comment pointing at a .codexclaw
evidence file that was never committed and cannot be resolved by any reader.
@github-actions github-actions Bot added the enhancement New feature or request label Jul 28, 2026
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds Volcengine Ark Agent Plan provider support with custom response-path routing, filters custom models from disabled providers, updates PR-labeler permissions, expands repository hygiene checks, removes tracked agent artifacts, and bumps the package version.

Changes

Provider integration

Layer / File(s) Summary
Provider registry and metadata
src/providers/registry.ts, tests/provider-registry-parity.test.ts
Adds Ark Agent Plan model metadata and registry wiring, including openai-responses, /responses, model limits, modalities, and derived-provider parity coverage.
Response-path propagation
src/providers/derive.ts, src/router.ts, gui/src/components/provider-catalog/provider-presets.ts
Propagates optional responsesPath through provider derivation, enrichment, routing, and catalog DTOs.
Catalog routing and filtering
src/codex/catalog/provider-fetch.ts, tests/codex-catalog.test.ts
Excludes custom models from missing or disabled providers and preserves vision-sidecar handling.
Provider presentation
gui/src/provider-icons.ts
Adds Ark Agent Plan branding and supports absolute HTTP(S) icon aliases.

PR labeler permissions

Layer / File(s) Summary
Label mutation permissions
.github/workflows/pr-labeler.yml, .github/scripts/pr-labeler.test.cjs
Grants pull-requests: write while asserting contents: read and denying contents: write.

Repository maintenance

Layer / File(s) Summary
Hygiene checks and release metadata
.gitignore, tests/repo-hygiene.test.ts, package.json
Adds recursive agent-state ignores, checks tracked files and ignore coverage, and updates the package version to 2.7.42. Goal-plan and ledger artifacts are removed.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ProviderRegistry
  participant ProviderDerivation
  participant Router
  participant Catalog
  participant GUI
  ProviderRegistry->>ProviderDerivation: register Ark Agent Plan and responsesPath
  ProviderDerivation->>Router: propagate provider configuration
  Router->>Catalog: expose routed provider and custom models
  Catalog->>GUI: provide catalog preset and provider identity
  GUI->>GUI: resolve display name and absolute favicon URL
Loading

Possibly related PRs

Suggested labels: enhancement

Suggested reviewers: lidge-jun, wibias, ingwannu

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding the Volcengine Ark Agent Plan provider and related support.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/pr-labeler.yml:
- Around line 20-27: Reduce the workflow’s pull request permission from write to
read while preserving issues: write in .github/workflows/pr-labeler.yml (lines
20-27). Update the corresponding permission assertion in
.github/scripts/pr-labeler.test.cjs (lines 169-177) to expect the read-only
pull-requests scope.

In `@gui/src/provider-icons.ts`:
- Line 81: Replace the hardcoded “Volcengine Ark Agent Plan” value in the
provider display-name map with the dashboard i18n lookup, and add the
corresponding key to the locale files using the existing provider-label
translation pattern. Keep the provider key “volcengine-ark-agent-plan”
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1a87f981-7092-47de-bcba-593b913814ce

📥 Commits

Reviewing files that changed from the base of the PR and between 7710185 and e7d269f.

⛔ Files ignored due to path filters (2)
  • devlog/.DS_Store is excluded by !**/.DS_Store
  • devlog/_plan/.DS_Store is excluded by !**/.DS_Store
📒 Files selected for processing (17)
  • .codexclaw/goalplans/opencodex-4-pabcd-work-phase-wp1-wp2-dev2-go-pr/goalplan.json
  • .codexclaw/goalplans/opencodex-4-pabcd-work-phase-wp1-wp2-dev2-go-pr/ledger.jsonl
  • .codexclaw/goalplans/opencodex-live-unfinished-issues-and-prs-triage/goalplan.json
  • .codexclaw/goalplans/opencodex-live-unfinished-issues-and-prs-triage/ledger.jsonl
  • .github/scripts/pr-labeler.test.cjs
  • .github/workflows/pr-labeler.yml
  • .gitignore
  • gui/src/components/provider-catalog/provider-presets.ts
  • gui/src/provider-icons.ts
  • package.json
  • src/codex/catalog/provider-fetch.ts
  • src/providers/derive.ts
  • src/providers/registry.ts
  • src/router.ts
  • tests/codex-catalog.test.ts
  • tests/provider-registry-parity.test.ts
  • tests/repo-hygiene.test.ts
💤 Files with no reviewable changes (4)
  • .codexclaw/goalplans/opencodex-live-unfinished-issues-and-prs-triage/goalplan.json
  • .codexclaw/goalplans/opencodex-4-pabcd-work-phase-wp1-wp2-dev2-go-pr/ledger.jsonl
  • .codexclaw/goalplans/opencodex-live-unfinished-issues-and-prs-triage/ledger.jsonl
  • .codexclaw/goalplans/opencodex-4-pabcd-work-phase-wp1-wp2-dev2-go-pr/goalplan.json

Comment on lines +20 to +27
# pulls.get only needs read, but the issues label endpoints are shared with
# pull requests: adding or removing a label on a PR number is rejected with
# "Resource not accessible by integration" unless the token also carries
# pull_requests=write (the API reports `issues=write; pull_requests=write`
# in x-accepted-github-permissions). Read-only here silently worked while
# every run happened to be a no-op sync, and failed on the first PR that
# actually needed a label written.
pull-requests: write

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Files =="
git ls-files .github/workflows/pr-labeler.yml .github/scripts/pr-labeler.test.cjs

echo
echo "== Workflow excerpt =="
nl -ba .github/workflows/pr-labeler.yml | sed -n '1,120p'

echo
echo "== Test excerpt =="
nl -ba .github/scripts/pr-labeler.test.cjs | sed -n '140,210p'

echo
echo "== Search for related permission/docs references =="
rg -n "pull-requests: write|pull-requests: read|issues: write|label endpoints|Resource not accessible by integration|x-accepted-github-permissions|pr-labeler" .github -S

Repository: lidge-jun/opencodex

Length of output: 302


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Workflow excerpt =="
sed -n '1,140p' .github/workflows/pr-labeler.yml

echo
echo "== Test excerpt =="
sed -n '140,220p' .github/scripts/pr-labeler.test.cjs

Repository: lidge-jun/opencodex

Length of output: 7064


🌐 Web query:

GitHub Actions permissions issues write pull-requests write labels on pull request number Resource not accessible by integration x-accepted-github-permissions

💡 Result:

The error "Resource not accessible by integration" in GitHub Actions indicates that the GITHUB_TOKEN used by your workflow lacks the necessary permissions to perform the requested API operation [1][2][3]. To resolve this when managing labels or pull requests, ensure your workflow explicitly defines the required permissions in the YAML file [4][5][6]. ### 1. Required Permissions GitHub processes labels via the Issues API [5]. To add or manage labels, you typically need both pull-requests and issues permissions [7][5][8]: yaml permissions: contents: read pull-requests: write issues: write * pull-requests: write: Necessary for actions that modify the pull request itself [7][8]. * issues: write: Necessary specifically for creating new labels or when the action interacts with the labels resource [7][5][8]. ### 2. Common Causes * Forked Repositories: When a workflow is triggered by a pull request from a fork, the GITHUB_TOKEN is granted read-only access by default for security reasons [3][7][8]. * Solution: Switch the event trigger from pull_request to pull_request_target [7][5][8]. This runs the workflow in the context of the base repository, granting it higher permissions [7][8]. Note: Ensure your workflow is secure, as this grants access to repository secrets [8]. * Missing Explicit Permissions: Depending on your repository settings, the default GITHUB_TOKEN might be restricted. Explicitly declaring the permissions block (as shown above) overrides these defaults [4][5]. ### 3. Understanding x-accepted-github-permissions The x-accepted-github-permissions header is a diagnostic tool provided by the GitHub API [9][10]. If you are troubleshooting an API call directly (or through a custom script), this header will be present in the API response [9][11]. It explicitly lists the permissions required to successfully call that specific endpoint [9][12]. You can use this to verify exactly which scope is missing [9]. ### Summary of Best Practices * Grant Least Privilege: Only add the specific permissions needed (e.g., pull-requests: write, issues: write) rather than granting full repository read/write access [6]. * Verify Syntax: Always use the hyphenated form pull-requests in your YAML permissions block; pull_requests (with an underscore) is invalid syntax [13]. * Check Token Source: If using a custom GitHub App or PAT, verify that the token itself has been granted the necessary permissions in its configuration settings [9][10][11].

Citations:


🌐 Web query:

site:docs.github.com REST API add labels to an issue required permissions pull_requests issues GitHub Apps

💡 Result:

To add labels to an issue or pull request via the GitHub REST API (using the POST /repos/{owner}/{repo}/issues/{issue_number}/labels endpoint), a GitHub App requires write-level repository permissions [1][2]. Specifically, the GitHub App must be granted either of the following repository permissions [2]: 1. Issues: Write [2] 2. Pull requests: Write [2] If the GitHub App is granted write access for either "Issues" or "Pull requests," it will have the necessary authorization to add labels to an issue or pull request [2]. If these permissions are not present, any attempt to add labels will be silently dropped or rejected [3][2].

Citations:


🌐 Web query:

docs.github.com add labels to an issue pull request permissions issues write pull requests write

💡 Result:

To add or manage labels on GitHub issues and pull requests, the required permissions depend on the action being performed and the context (UI interaction versus automation via API/GitHub Actions). For manual operations in the GitHub web interface: - Applying or dismissing existing labels requires triage access to the repository [1]. - Creating, editing, or deleting labels requires write access to the repository [1]. For automation using GitHub Actions or the REST API: - GitHub internally treats pull requests as issues [2][3]. Consequently, API endpoints for managing labels are grouped under the Issues API [2]. - To modify labels in a GitHub Actions workflow, the GITHUB_TOKEN must have explicit write permissions [3]. It is recommended to include the following in your workflow file [3]: permissions: issues: write pull-requests: write Note that while pull-requests: write is often sufficient for applying existing labels to pull requests, adding labels that do not already exist in the repository may require issues: write permissions [3]. When defining these permissions in YAML, ensure you use a hyphen (pull-requests) rather than an underscore, as the latter is a common syntax error [4].

Citations:


🌐 Web query:

site:docs.github.com/en/rest/issues/labels "Add labels to an issue" permissions "Issues: write" "Pull requests: write"

💡 Result:

To add labels to a GitHub issue, you must have write access to the repository [1]. While specific permission levels can vary based on repository settings, the write access level generally encompasses the ability to manage issue metadata, such as labels [1]. Users with write access can utilize the GitHub REST API to add labels to an issue using the following endpoint: POST /repos/{owner}/{repo}/issues/{issue_number}/labels When using this endpoint, you can provide the labels as an array in the request body [1]. If you have write permissions, you may also replace existing labels or manage them directly through the GitHub web interface, provided your account and repository settings allow for such modifications [1].

Citations:


🌐 Web query:

site:docs.github.com/en/rest/issues/labels "required permissions" "pull requests" "issues"

💡 Result:

On GitHub, pull requests are treated as a type of issue, meaning that shared actions for both features, such as managing assignees, labels, and milestones, are handled through common endpoints [1]. To perform actions on issues and pull requests, users typically require write access to the repository [1]. Specific API requests for these features require identifying the repository owner, the repository name, and the specific issue or pull request number [1]. Information regarding specific permission levels for GitLab was not retrieved.

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n "`#565`|pull_requests=write|x-accepted-github-permissions|Resource not accessible by integration|issues=write" . -S

Repository: lidge-jun/opencodex

Length of output: 157


🌐 Web query:

"POST /repos/{owner}/{repo}/issues/{issue_number}/labels" "pull-requests: write" issues write GitHub App permissions

💡 Result:

To use the GitHub REST API endpoint POST /repos/{owner}/{repo}/issues/{issue_number}/labels, a GitHub App must be granted the "Issues" repository permission with "write" access [1][2][3]. While this endpoint is used to manage labels on both issues and pull requests, the "Issues: write" permission is the mandatory requirement for this specific API call [4]. In the context of GitHub Apps, pull requests are considered a subset of issues, and the "Issues: write" permission covers label management for both [4]. Even if you are performing this operation on a pull request, "Pull requests: write" alone is insufficient; you must explicitly grant "Issues: write" [4]. Summary of requirements: - Permission name: Issues - Access level: Write - Scope: Repository If your GitHub App lacks the "Issues: write" permission, attempts to add labels via this endpoint will result in a 403 Forbidden error [4].

Citations:


🌐 Web query:

site:docs.github.com/en/rest/issues/labels "GitHub App" "write" "issues" "pull requests"

💡 Result:

To enable a GitHub App to create or manage issues and pull requests, you must configure the appropriate repository permissions in the app settings. For issues, GitHub Apps require the Issues permission, which should be set to Read and write access [1]. This allows the app to perform actions such as creating issues, managing labels, and updating issue details via the REST API [1]. For pull requests, GitHub Apps require the Pull requests permission, also set to Read and write access. Note that GitHub treats pull requests as a type of issue, so shared actions like managing labels, assignees, and milestones for pull requests are handled through the Issues endpoints of the REST API [1]. When performing these actions, you use the REST API endpoints associated with the repository. For example, to add labels to an issue or pull request, you would use the following request [1]: POST /repos/{owner}/{repo}/issues/{issue_number}/labels Ensure your GitHub App has been granted these specific permissions during installation on the target repository.

Citations:


Drop the extra PR write scope

.github/workflows/pr-labeler.yml#L20-L27 only needs pulls.get plus issues.* label calls, so pull-requests: write is broader than necessary here. Keep issues: write, downgrade pull-requests to read, and update .github/scripts/pr-labeler.test.cjs#L169-L177 to assert the read-only scope.

🧰 Tools
🪛 zizmor (1.26.1)

[error] 27-27: overly broad permissions (excessive-permissions): pull-requests: write is overly broad at the workflow level

(excessive-permissions)


[warning] 27-27: permissions without explanatory comments (undocumented-permissions): needs an explanatory comment

(undocumented-permissions)

📍 Affects 2 files
  • .github/workflows/pr-labeler.yml#L20-L27 (this comment)
  • .github/scripts/pr-labeler.test.cjs#L169-L177
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/pr-labeler.yml around lines 20 - 27, Reduce the workflow’s
pull request permission from write to read while preserving issues: write in
.github/workflows/pr-labeler.yml (lines 20-27). Update the corresponding
permission assertion in .github/scripts/pr-labeler.test.cjs (lines 169-177) to
expect the read-only pull-requests scope.

Sources: Path instructions, Linters/SAST tools

Comment thread gui/src/provider-icons.ts
alibaba: "Alibaba Coding Plan",
"alibaba-token-plan": "Alibaba Token Plan",
"alibaba-token-plan-intl": "Alibaba Token Plan (Intl)",
"volcengine-ark-agent-plan": "Volcengine Ark Agent Plan",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Localize the provider display name.

Line 81 adds a user-visible provider label directly to the source map, so it cannot be translated. Add a locale key and resolve the label through the dashboard i18n layer.

As per path instructions, “user-visible strings go through the i18n locale files rather than hardcoded text.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@gui/src/provider-icons.ts` at line 81, Replace the hardcoded “Volcengine Ark
Agent Plan” value in the provider display-name map with the dashboard i18n
lookup, and add the corresponding key to the locale files using the existing
provider-label translation pattern. Keep the provider key
“volcengine-ark-agent-plan” unchanged.

Source: Path instructions

@Wibias

Wibias commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Closing as duplicate.

This PR also deletes a large amount of unrelated files and changes material that should not be modified in this contribution (version bumps, CI, repo hygiene, historical docs/agent artifacts, etc.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants