From c3a383447cbe96f04d10c2483e1566d7ba318485 Mon Sep 17 00:00:00 2001 From: Patrick Wozniak Date: Tue, 25 Aug 2026 15:08:29 +0200 Subject: [PATCH] ci(models): open PRs for Command Code catalog updates --- .github/workflows/model-metadata.yml | 69 ++++++++++++++++++++++++---- CHANGELOG.md | 2 +- README.md | 2 +- 3 files changed, 62 insertions(+), 11 deletions(-) diff --git a/.github/workflows/model-metadata.yml b/.github/workflows/model-metadata.yml index 809eef8..196b7b5 100644 --- a/.github/workflows/model-metadata.yml +++ b/.github/workflows/model-metadata.yml @@ -1,4 +1,4 @@ -name: Command Code model metadata +name: Command Code catalog sync on: pull_request: @@ -6,6 +6,7 @@ on: paths: - ".github/scripts/check-commandcode-model-metadata.ts" - ".github/workflows/model-metadata.yml" + - "src/commandcode-catalog.ts" - "src/core.ts" - "src/models.ts" - "tests/test-model-metadata-check.ts" @@ -13,17 +14,17 @@ on: - cron: "17 6 * * *" workflow_dispatch: -permissions: - contents: read - concurrency: - group: commandcode-model-metadata + group: commandcode-catalog-${{ github.event_name == 'pull_request' && github.event.pull_request.number || 'sync' }} cancel-in-progress: true jobs: check: + if: github.event_name == 'pull_request' runs-on: ubuntu-latest timeout-minutes: 10 + permissions: + contents: read steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -32,8 +33,58 @@ jobs: cache: npm registry-url: https://registry.npmjs.org - run: npm ci - - name: Compare static metadata with the latest Command Code CLI - run: npm run check:model-metadata | tee model-metadata-report.md - - name: Publish metadata report + - name: Compare with the latest Command Code CLI + run: npm run check:commandcode-catalog | tee commandcode-catalog-report.md + - name: Publish catalog report if: always() - run: cat model-metadata-report.md >> "$GITHUB_STEP_SUMMARY" + run: cat commandcode-catalog-report.md >> "$GITHUB_STEP_SUMMARY" + + sync: + if: github.event_name != 'pull_request' + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + registry-url: https://registry.npmjs.org + - run: npm ci + - name: Synchronize with the latest Command Code CLI + run: npm run sync:commandcode-catalog | tee commandcode-catalog-report.md + - name: Format and verify synchronized files + run: | + npm run format -- src/commandcode-catalog.ts README.md CHANGELOG.md + npm run typecheck + npm run test:models + npm run format:check + git diff --check + - name: Publish catalog report + if: always() + run: cat commandcode-catalog-report.md >> "$GITHUB_STEP_SUMMARY" + - name: Create or update synchronization PR + uses: peter-evans/create-pull-request@v8 + with: + branch: automation/commandcode-catalog + delete-branch: true + commit-message: "chore(models): sync Command Code catalog" + title: "chore(models): sync Command Code catalog" + body: | + Automated synchronization with the latest published `command-code` CLI package. + + This updates only machine-readable compatibility metadata: + - CLI version used in the `x-command-code-version` header + - image-input capabilities + - supported reasoning efforts + - documented catalog snapshot version + + Pricing remains review-only because CLI documentation does not represent every pricing tier and temporary promotion used by the provider. + assignees: patlux + add-paths: | + src/commandcode-catalog.ts + README.md + CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md index c4e2930..5730962 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Unreleased -- Add a daily GitHub Actions check that compares static image and reasoning metadata with the latest published Command Code CLI catalog. +- Add a daily GitHub Actions synchronization job that opens or updates a pull request for CLI version, image capability, and reasoning-effort changes in the latest published Command Code catalog. - Refresh static model capabilities from `command-code@1.32.2`, including new image and reasoning metadata. - Add `/commandcode-quota` with live credits, plan, usage totals, and rolling-limit diagnostics from Command Code's alpha usage endpoints. - Add `zai-org/GLM-5.3` with its verified reasoning efforts and display pricing. diff --git a/README.md b/README.md index 7657981..83c8295 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,7 @@ The following environment variables are intended for tests, local mocks, and com ## Image input -The provider advertises image input only for models marked with the `image` input modality in the official Command Code CLI model catalog. The capability snapshot currently follows `command-code@1.32.2`; unknown models default to text-only until their upstream metadata is reviewed. A daily GitHub Actions check compares the static image and reasoning metadata with the latest published CLI package and reports any drift. +The provider advertises image input only for models marked with the `image` input modality in the official Command Code CLI model catalog. The capability snapshot currently follows `command-code@1.32.2`; unknown models default to text-only until their upstream metadata is reviewed. A daily GitHub Actions job synchronizes the CLI version, image capabilities, and reasoning efforts with the latest published CLI package and opens or updates a reviewable pull request when they change. Pricing remains manually reviewed because the CLI catalog does not expose every pricing tier and temporary promotion used by the provider. For vision-capable models, Pi's native provider adapters forward image blocks from user messages and tool results using the documented OpenAI or Anthropic message schema. Unknown and text-only models remain marked text-only in Pi.