Skip to content

feat(provider): add Qoder CN PAT provider - #3350

Draft
Flowershangfromthebranches wants to merge 5 commits into
lidge-jun:devfrom
Flowershangfromthebranches:feat/qoder-cn-pat-provider
Draft

feat(provider): add Qoder CN PAT provider#3350
Flowershangfromthebranches wants to merge 5 commits into
lidge-jun:devfrom
Flowershangfromthebranches:feat/qoder-cn-pat-provider

Conversation

@Flowershangfromthebranches

@Flowershangfromthebranches Flowershangfromthebranches commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Qoder CN as a separate official PAT-backed CLI provider.

This is PR 3 of 3. It is intentionally stacked on #3349, which is stacked on #3340, until the preceding shared-runtime PRs merge. The CN-only commit is a4e805084. The branch will be rebased after its predecessors merge so this PR's final diff remains CN-only.

Contract and isolation

  • Provider id: qoder-cn
  • Canonical destination: https://qoder.cn
  • Credential: QODERCN_PERSONAL_ACCESS_TOKEN
  • Executable: official qodercn with legacy vendor binary name qoderclicn accepted
  • Official install: npm install -g @qodercn-ai/qoderclicn
  • Tools, MCP configuration, settings sources, and session persistence disabled
  • Text/verified reasoning only; image input fails explicitly
  • Live --list-models discovery is account-authoritative; static CN roster is degraded fallback
  • Global and CN have separate destinations, PAT variables, executable resolution, provider ids, cache authority, connection health, and model rosters
  • No regional fallback or credential exchange

No desktop session, browser cookie, OpenCodex OAuth token, ambient ~/.qoder-cn credential, private endpoint, or embedded signing binary is read or used.

Prior work: #3010

Credit to Liang Xu (Liang-Psych) for the Qoder CN exploration in #3010, especially identifying the official CLI, headless stream-json direction, and tools-disabled execution.

This PR does not copy #3010's implementation. It deliberately replaces its OAuth/private-protocol and ambient-session designs with the now-documented QODERCN_PERSONAL_ACCESS_TOKEN contract and the shared coding-agent CLI adapter. It also avoids model slug guessing, embedded WASM, prompt-in-argv, inherited full process environments, fabricated usage, and success-on-truncated-stream behavior called out during #3010 review.

Primary evidence reviewed (2026-09-03)

Verification

  • Focused provider/registry/cache/conformance suite: 116 passed, 0 failed
  • bun run typecheck: passed
  • bun run privacy:scan: passed
  • git diff --check: passed
  • Predecessor full suite snapshot: 17,481 passed, 25 failed, 14 skipped; known parallel timing/management environment failures remain disclosed in feat(provider): add Qoder Global PAT provider #3349. This Draft does not claim a green full suite.

Live evidence and boundary

The installed CN CLI is qoderclicn 1.1.34. Its authenticated local session returned this roster on 2026-09-03:

  • Qwen3.8-Max
  • Qwen3.8-Flash
  • Qwen3.7-Max
  • Qwen3.7-Plus
  • Qwen3.7-Flash

A tools/settings-disabled headless turn reached the CN service and returned vendor code 118 with zero available credits. This is evidence for the local CLI transport/model route, not for the new PAT injection path.

LIVE_PAT_E2E_NOT_VERIFIED: no separate Qoder CN PAT was available in the test environment, and no successful inference is claimed.

Maintainer decisions requested

  1. Confirm that official PAT-backed CLI automation is acceptable under Qoder CN's current terms/AUP.
  2. Confirm whether the measured static fallback roster and conservative reasoning ladder should remain.
  3. Confirm long-term ownership. Proposed maintainer: Flowershangfromthebranches, independent and unaffiliated with Qoder.

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • All CI tests are green on my local testing.

  • I pushed my PR to the latest dev commit.

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

❤️ Share

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

@github-actions github-actions Bot added the enhancement New feature or request label Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • review readiness checklist open (0/4 boxes ticked).

What to do

  • Tick all four boxes in the PR description once you're done (currently 0/4).

Review readiness checklist

  • ⬜ All CI tests are green on my local testing.
  • ⬜ I pushed my PR to the latest dev commit.
  • ⬜ I resolved all correct Codex and CodeRabbit findings.
  • ⬜ My PR is ready for review.

0/4 boxes ticked.

This PR stays in draft until every box above is ticked.

@lidge-jun

Copy link
Copy Markdown
Owner

리뷰 · 우선순위 47 / 80

이 PR은 Qoder CN을 Global과 분리된 공식 PAT + 공식 CLI 프로바이더로 넣는 작업이다. 프로바이더 id는 qoder-cn, 목적지는 https://qoder.cn, 환경 변수는 QODERCN_PERSONAL_ACCESS_TOKEN, 실행 파일은 qodercn / 레거시 qoderclicn 이다. GitHub diff는 #3340(CodeBuddy) + #3349(Qoder Global) 위에 CN 전용 커밋 a4e805084 을 쌓은 상태다. 지금 dev HEAD는 1f00ff52b(패키지 2.41.0) 이고, 이 가지의 머지 베이스는 여전히 81a1fc1cc 이라 HTML 주석·CVE·ReDoS 세 커밋이 뒤다. 기여자는 선행 PR이 머지된 뒤 리베이스해서 CN diff만 남기겠다고 적었다.

CN 전용 커밋 자체는 작다. 새 어댑터 파일을 만들지 않고 src/adapters/qoder/profiles.tsQODER_CN_PROFILE 을 더한다. 발견·연결 검사·턴 실행은 이미 Global이 넣은 adapter === "qoder" 경로가 resolveQoderProfile(baseUrl) 로 프로필을 고른다. 레지스트리 시드는 별도 모델 목록 QODER_CN_MODELS(2026-09-03 라이브 CLI에서 관측한 Qwen3.8/3.7 Max·Plus·Flash)를 쓰고, preserveCustomDestination: true 도 Global과 같다. 테스트는 Global/CN PAT 변수가 섞이지 않는지, 실행 파일이 다른지, 연결 검사가 CN 프로필을 쓰는지 본다. 이 분리는 읽기 쉽고 #3349 의 설계와 맞다.

선행 작업 #3010(Liang Xu / Liang-Psych, Qoder CN OAuth·프라이빗 프로토콜, 아직 열린 draft)과 주제가 겹친다. 이 PR은 그걸 복사하지 않는다고 명시한다. 디바이스 OAuth, 로컬 ~/.qoder-cn 세션, 임베디드 서명, 모델 슬러그 추측, prompt-in-argv 전체 환경 상속 같은 #3010 리뷰에서 지적된 길을 다시 열지 않고, 문서화된 PAT 환경 변수와 공통 coding-agent CLI 어댑터로 바꾼다. 크레딧 표기는 맞다. 다만 두 PR을 같이 머지하면 같은 벤더 CN 표면에 인증 경로가 두 개가 된다. 이 PR을 #3010 의 중복으로 지금 닫으면 안 되고, 반대로 #3010 을 이 PR 머지 전에 자동 닫지도 마라. AUP와 설계를 고른 뒤에 하나만 남겨라.

라이브 증거는 Global보다 조금 더 있다. 설치된 CN CLI는 qoderclicn 1.1.34 이고, 인증된 로컬 세션이 모델 다섯 개를 돌려주었으며, 도구/설정 끈 headless 턴이 벤더 코드 118(크레딧 없음)까지 도달했다고 한다. 그건 로컬 CLI 전송·모델 경로의 증거이지, 새 PAT 주입 경로의 성공 추론이 아니다. 본문도 LIVE_PAT_E2E_NOT_VERIFIED 라고 적었다. 선행 스위트 스냅샷 25 실패는 #3349 와 같고 전체 초록을 주장하지 않는다. PR은 여전히 draft 이고 체크리스트 0/4 다.

정책·릴리즈 위치는 #3340(48/80) · #3349(이 봇이 같은 턴에 49/80으로 리뷰)와 같다. 새 PAT CLI 프로바이더이고, AUP가 열렸고, v2.41.0 기차에 넣으면 안 된다. types.ts/config.ts 는 없고 close-don't-rebase 대상이 아니다. docs-site 가이드는 쌓인 CodeBuddy 절만 있고 Qoder CN 절은 없다. gui/src/provider-icons.ts 에도 qoder-cn 마크가 없다. 무료 디렉터리에는 새 id qoder-cnsignup-credit 그룹으로 들어가며 CONNECTABLE 에서 supported/official 로 표시된다. CN 상품이 가입 크레딧인지 유료인지는 메인테이너가 분류를 확인해야 한다.

경로 src/adapters/qoder/profiles.ts QODER_CN_PROFILE - 목적지·바이너리·PAT 변수가 Global과 분리되어 있다. resolveProfileByBaseUrl 은 호스트를 소문자·슬래시 정규화 후 완전 일치만 받는다. qoder.comqoder.cn 이 섞일 여지는 작다. 이 부분은 유지하라.
경로 src/providers/registry.ts qoder-cn - 어댑터 id는 공유 qoder 이고 시드만 따로다. 발견/연결 검사 파일을 CN이 다시 복사하지 않은 것은 맞다. preserveCustomDestination 도 켜져 있어, 나중에 같은 이름으로 커스텀 키를 저장한 사용자 목적지를 지키려 한다.
경로 src/providers/free-directory.ts qoder-cn - Global은 원래 참고 id를 승격한 것이고, CN은 디렉터리에 없던 id를 새로 넣는다. 레지스트리와 디렉터리 baseUrl이 같아야 하는 패리티 규칙은 지켜졌다. signup-credit 분류가 CN 상품과 맞는지는 별도 확인이 필요하다.
경로 docs/qoder-cli-provider.md vs docs-site 가이드 - CN 사용 절차는 레포 문서에만 있다. 공개 가이드(docs-site/src/content/docs/guides/providers.md)에는 Qoder 절이 없다. 리베이스 뒤 Global·CN을 한 절로 넣어야 README 안내와 맞다.
경로 #3010 - OAuth/프라이빗 프로토콜 draft가 아직 열려 있다. 이 PAT 설계가 채택되면 #3010 은 superseded로 닫고, 그 전에 두 구현을 동시에 머지하지 마라. 이 PR을 #3010 중복으로 닫지는 마라.
경로 라이브 PAT / draft 체크리스트 - 코드 118 관측은 전송 증거일 뿐 PAT 주입 E2E가 아니다. 네 칸이 비어 있고 선행 PR 두 개가 먼저다. 지금 머지 후보가 아니다.
경로 gui/src/provider-icons.ts - qoder-cn 마크가 없다. Global과 같이 이니셜 타일 또는 후속 마크 PR로 처리하라.

메인테이너의 판단이 필요한 지점

  • Qoder CN 약관/AUP가 이 headless CLI 프록시 라우팅을 허용하는지. Global과 별도 판단이 필요한지
  • #3010 OAuth 실험을 이 PAT 설계로 대체할지, 아니면 둘 다 draft로 더 둘지 (추천: PAT가 허용되면 #3010 은 이유와 함께 superseded로 닫기)
  • 관측한 정적 CN 로스터와 보수적 reasoning 사다리를 폴백으로 남길지
  • 장기 소유자를 제안대로 Flowershangfromthebranches 로 둘지. Qoder와 무관한 기여자라고 본문이 적었다
  • #3340#3349#3350 스택을 유지한 채 각각 리베이스할지, CN을 Global과 한 PR로 합칠지 (추천: 분리는 유지, 선행 머지 후 리베이스)
  • v2.41.0 이후에나 볼지. 릴리즈 차단 사유는 아니다

너의 추천
draft로 두고 #3340 / #3349 AUP 판단이 끝난 뒤에만 보라. 지금 v2.41.0 기차에 끼우지 마라. 허용이면 선행 두 PR을 머지·리베이스한 뒤 CN 전용 diff만 남기고, docs-site 절·체크리스트·가능하면 PAT E2E를 받은 다음 큐에 올려라. 그 시점에 #3010 에는 superseded 코멘트를 남기고 닫아라. 거부면 #3349 와 같은 정책 이유로 닫아라. 라벨은 바꾸지 않는다. types/config 분할이나 중복을 이유로 이 PR을 지금 닫지 마라.

이 댓글은 grok-bot이 작성했습니다

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.

2 participants