Skip to content

fix: API 路由 ALLOWED_PROVIDERS 也加 glm #198

Closed

Description

@akushonkamen

背景

PR #197 把 server action 的 ALLOWED_PROVIDERS 加了 `glm`,但 codex review 指出同名的 POST `/api/settings/api-keys` 路由有自己的 ALLOWED_PROVIDERS 也需要同步加 `glm`,否则程序化客户端(CLI/curl)走 API 路径会被 reject。

修复

  • 文件: `app/src/app/api/settings/api-keys/route.ts`
  • ALLOWED_PROVIDERS 加 `glm`(与 server action 对齐)

Test plan

  • typecheck 通过
  • lint 通过

Activity

  1. github-actions commented on Jul 22, 2026

    @github-actions
    Contributor

    Understood. This is a straightforward synchronization fix: app/src/app/api/settings/api-keys/route.ts has a separate ALLOWED_PROVIDERS that needs glm added to match PR #197's server action change. Single file, clear AC, low risk. Typecheck and lint will be verified before merge.

  2. added
    accepted-by-claudeClaude self-acceptance after clarify loop (Module 4 trigger, distinct from maintainer accepted)
    on Jul 22, 2026
  3. akushonkamen commented on Jul 22, 2026

    @akushonkamen
    OwnerAuthor

    🤖 Claude self-acceptance (M8 workload=trivial). accepted-by-claude applied — Module 4 develop-gate will pick this up. Maintainer may override with rejected.

  4. akushonkamen commented on Jul 22, 2026

    @akushonkamen
    OwnerAuthor

    🚀 Development branch pushed: claude/issue-198-fix-api-allowed-providers-glm @ c74df4915e0c. PR: #199

  5. added
    verifyingModule 5 self-verify active
    verifiedModule 5 self-verify passed
    and removed
    verifyingModule 5 self-verify active
    on Jul 22, 2026
  6. akushonkamen commented on Jul 22, 2026

    @akushonkamen
    OwnerAuthor

    ✅ Verify passed — Module 6 (test) engaged. PR: #199

  7. added
    testingModule 6 test active
    verifyingModule 5 self-verify active
    and removed
    verifyingModule 5 self-verify active
    on Jul 22, 2026
  8. akushonkamen commented on Jul 22, 2026

    @akushonkamen
    OwnerAuthor

    ✅ Verify passed — Module 6 (test) engaged. PR: #200

  9. github-actions commented on Jul 22, 2026

    @github-actions
    Contributor

    ❌ Test: failed

    Field Value
    PR #199
    Workflow run https://github.com/akushonkamen/github-auto-dev-scaffold/actions/runs/29885946352

    Test Suite Results (Module 6 — Independent Test)

    现有测试运行结果

    Test file Result
    src/lib/deploy-pipeline/deploy-pipeline.test.ts ✓ 10/10 passed
    src/lib/quota.test.ts ✓ 6/6 passed
    src/lib/billing/tests/stripe.test.ts ✓ 3/3 passed
    Total ✓ 3 files, 19/19 passed

    验收标准逐项复核

    # 标准 覆盖情况
    1 ALLOWED_PROVIDERS 加 glm(与 server action 对齐) ✗ 无测试覆盖
    2 typecheck 通过 ✓ tsc --noEmit 通过
    3 lint 通过 ✓ next lint 通过

    结论

    • 所有 19 个现有测试通过,0 失败
    • typecheck 和 lint 均 clean
    • 但核心功能变更(ALLOWED_PROVIDERS 新增 glm)无任何测试覆盖 — 没有 test case 验证 POST /api/settings/api-keys 在 provider: "glm" 时返回 201 而非 400,也未验证 "glm" 被正确放入 ALLOWED_PROVIDERS Set 中
    • 根据决策规则:关键验收标准零覆盖 → test_status = failed
  10. added
    test:retry-1Auto-retry 1/3: re-running Module 4 with test feedback
    and removed
    testingModule 6 test active
    verifiedModule 5 self-verify passed
    on Jul 22, 2026
  11. akushonkamen commented on Jul 22, 2026

    @akushonkamen
    OwnerAuthor

    🔄 Auto-retry 1/3

    Field Value
    Retry 1 of 3
    Prior workflow run https://github.com/akushonkamen/github-auto-dev-scaffold/actions/runs/29885946352
    Retry label test:retry-1

    Failure summary (prior Module 6 run)

    Test Suite Results (Module 6 — Independent Test)

    现有测试运行结果

    Test file Result
    src/lib/deploy-pipeline/deploy-pipeline.test.ts ✓ 10/10 passed

    code-generate.yml will auto-trigger on the test:retry-1 label,
    fetch this comment as the prior-test-report, and re-run Module 4 to
    fix the failure.

  12. github-actions commented on Jul 22, 2026

    @github-actions
    Contributor

    🤖 AI Initial Review: posted

    Field Value
    PR #199
    Review comment #199 (comment)
    Workflow run https://github.com/akushonkamen/github-auto-dev-scaffold/actions/runs/29885898294

    The AI has posted an initial review as a PR comment. This is an
    advisory review only — AI does NOT approve. A CODEOWNER must
    perform the final human review and approve (PRD §6).

    Next: Module 9 (merge queue) triggers on approved + green checks.

  13. added
    verifyingModule 5 self-verify active
    verifiedModule 5 self-verify passed
    and removed
    verifyingModule 5 self-verify active
    on Jul 22, 2026
  14. akushonkamen commented on Jul 22, 2026

    @akushonkamen
    OwnerAuthor

    ✅ Verify passed — Module 6 (test) engaged. PR: #199

  15. github-actions commented on Jul 22, 2026

    @github-actions
    Contributor

    ⚠️ Module 4 retry produced no new commits (issue #57).

    Claude analysed the prior test report and concluded the existing branch tip already addresses it — pre-sha == post-sha, so no commit was made. Downstream modules (pr-lifecycle → verify) will NOT fire because there is no new push event for pull_request.synchronize to deliver.

    Maintainer action required:

    • Inspect the existing PR — the fix code may already be correct and the prior test failure spurious
    • OR re-dispatch code-generate.yml with stronger guidance in the issue
    • OR close as not-reproducible

    Workflow run

  16. github-actions commented on Jul 22, 2026

    @github-actions
    Contributor

    ✅ Test: passed

    Field Value
    PR #199
    Workflow run https://github.com/akushonkamen/github-auto-dev-scaffold/actions/runs/29886216571

    Test suite: vitest (3 files, 19 tests)

    • ✓ src/lib/deploy-pipeline/deploy-pipeline.test.ts — 10/10 passed
    • ✓ src/lib/quota.test.ts — 6/6 passed
    • ✓ src/lib/billing/tests/stripe.test.ts — 3/3 passed
    • ✓ typecheck (tsc --noEmit) — passed, no errors
    • ✓ lint (next lint) — passed, no warnings or errors

    Acceptance criteria coverage

    • ✓ [C1] ALLOWED_PROVIDERS includes "glm" in POST /api/settings/api-keys — Verified by source inspection (route.ts:16). Commit b24af19 confirms the change. No automated test asserts this value.
    • ✓ [C2] TypeScript typecheck passes — Verified by tsc --noEmit (clean)
    • ✓ [C3] ESLint passes — Verified by next lint (clean)

    Summary

    All 19 existing tests pass cleanly. Both test-plan items from the issue (typecheck, lint) pass. The ALLOWED_PROVIDERS change is present in the source. However, the validation logic on the POST /api/settings/api-keys route (ALLOWED_PROVIDERS Set, provider rejection, key-length check) has zero test coverage — a future regression could silently re-add or remove a provider without any test catching it.

  17. added
    testedModule 6 test passed
    and removed
    testingModule 6 test active
    on Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepted-by-claudeClaude self-acceptance after clarify loop (Module 4 trigger, distinct from maintainer accepted)stage:failedA module failed; needs maintainer triagetest:retry-1Auto-retry 1/3: re-running Module 4 with test feedbacktestedModule 6 test passedtriageNewly opened; awaiting triage botverifiedModule 5 self-verify passed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions