Skip to content

[feat] providers: reuse a BigModel account across model categories - #289

Open
PCcoding666 wants to merge 2 commits into
ThinkFlowLab:mainfrom
PCcoding666:feat/234-shared-bigmodel-connection
Open

PCcoding666 wants to merge 2 commits into
ThinkFlowLab:mainfrom
PCcoding666:feat/234-shared-bigmodel-connection

Conversation

@PCcoding666

@PCcoding666 PCcoding666 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adding a BigModel model in another category currently requires entering the account key again. This change lets users select a saved mainland BigModel account across chat, image, video and audio. Account identifiers distinguish credentials on the same endpoint. Key rotation applies to the selected account, and editing or deleting models applies to the selected category.

Refs #234. The integrated branch includes the current GLM chat, GLM-Image, CogVideoX-3 and GLM-TTS presets. Each category retains its own protocol and proxy settings, including bigmodel_video for CogVideoX-3. Frontend and backend connection checks use the same explicit category allowlist.

Verification

At ed71facf, integrated with upstream 691135f, on Apple Silicon:

  • All 820 Node tests passed in serial. The preset tests exercise all 16 source/destination category pairs with the current upstream presets, two accounts, and incompatible connections.
  • All 70 model configuration and catalog tests passed. The API tests cover all 16 category pairs, persisted reload, destination protocol and proxy preservation, selected-account key rotation, and category-scoped deletion.
  • All 116 existing BigModel image, video and TTS adapter tests passed.
  • Production build, bilingual validation (3,015 keys), generated contracts, import boundaries and the full PR-diff static checks passed.

Settings evidence

Chromium exercised the current integrated app through an isolated local API. With two fixture image accounts, I selected account A in English and account B in Chinese, saving all four categories in each language without reentering a key (eight saves). The original image records stayed intact, saved video models kept the bigmodel_video protocol, and closing/reopening settings showed both distinct video accounts. The page reported no JavaScript errors.

Reusing account A in English Reusing account B in Chinese
English video account reuse Chinese video account reuse

All provider calls in the regression tests use fixtures. Live BigModel generation, media adoption and the complete four-modality workflow in #234 remain to be verified with a real account.

Prepared and tested with Codex assistance.

@Zhangbo-cn

Copy link
Copy Markdown
Contributor

Heads-up on an overlap with #276 (GLM-TTS, same parent RFC #234). Both PRs touch providerPresets.ts, tests/providerPresets.test.ts and the two user guides, and the zhipu preset is the specific collision.

I merged your branch (d08f51ce) against #276 locally to check rather than guess. Two conflicts, both small:

CONFLICT (content): src/canvas/providerPresets.ts
CONFLICT (content): tests/providerPresets.test.ts

The preset one is two lines - #276 widens the same entry to serve GLM-TTS:

<<<<<<< #276
    kinds: ["agent", "audio"],
    url: "https://open.bigmodel.cn/api/paas/v4",
=======
    kinds: ["agent"],
    url: BIGMODEL_URL,
>>>>>>> #289

Resolution is kinds: ["agent", "audio"] plus your BIGMODEL_URL constant - the two changes are complementary, not competing. The test conflict is only textual adjacency: both new cases should be kept as-is, neither needs editing.

I verified the resolved merge: tsc --noEmit clean and 772 Node tests pass with both test cases present. Your matchingConnections case already includes a kind: "audio" record and still passes once the preset carries audio.

Whichever lands second gets this conflict, so no action needed now - just flagging it early since it is a two-line fix if you know about it, and a confusing one if you don't. #276 is currently approved with checks green, so it will likely be first; happy to do the rebase on my side instead if you'd rather land #289 first.

One unrelated observation while reading the diff: isBigModelConnection gates on model.kind !== "vision" while is_bigmodel_connection uses an explicit {agent, image, video, audio} allowlist. Those agree today because ModelKind has exactly those five members, so this is not a defect - but the frontend would silently admit a sixth kind that the backend rejects. An allowlist on both sides would keep them in step.

@PCcoding666
PCcoding666 marked this pull request as ready for review November 16, 2026 07:36
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T07:48:06.811020Z ed71fac Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added area:canvas Canvas, nodes and direct manipulation area:provider Model providers and generation protocols type:feat New capability or behaviour labels Nov 16, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ed71facfc4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +208 to +209
previous = [item for item in models if (item.get('providerId') == provider_id and item['kind'] == kind)
or (item['id'] == config_id and not cross_category)]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include legacy vision peers in the replacement set

When an existing multi-model vision service is managed from the Image or Video category, legacy_segmentation still allows the save, but this filter includes only the anchor because its peers still have kind == 'vision'. Saving a two-model service with both models therefore produces three records: the second old vision record survives and a duplicate is created with a new ID. Deselecting that model also fails to remove it. Include the legacy source-kind peers in previous during this supported conversion so the saved selection and model identities are preserved.

Useful? React with 👍 / 👎.

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

Labels

area:canvas Canvas, nodes and direct manipulation area:provider Model providers and generation protocols type:feat New capability or behaviour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants