fix(ui): support string-object unions in config form schema#31762
fix(ui): support string-object unions in config form schema#31762liuxiaopai-ai wants to merge 1 commit intoopenclaw:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 64fa2b46f4
ℹ️ 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".
| }; | ||
| } | ||
|
|
||
| if (remaining.length > 0 && literals.length === 0) { |
There was a problem hiding this comment.
Preserve unsupported flag for unions the renderer cannot resolve
This new branch treats every non-literal union as form-editable, but renderNode still only resolves a few union shapes (literals, primitive-only unions, and the new string+object special case). A concrete schema path in this repo, TelegramAccountSchema.capabilities (array | object in src/config/zod-schema.providers-core.ts), now drops out of unsupportedPaths, yet rendering still falls through to Unsupported type: undefined because no variant is selected. That regresses analysis accuracy and hides form-unsafe status for real config sections.
Useful? React with 👍 / 👎.
Greptile SummaryAdded support for Confidence Score: 5/5
Last reviewed commit: 64fa2b4 |
|
Thanks for the contribution here. I’m closing this as a duplicate of #31866 for the same bug scope. Why this is being closed:
What helped from this PR:
If you want, you can still port any unique idea from this branch into #31866 via a focused follow-up commit. Specific triage note: |
Summary
Describe the problem and fix in 2–5 bullets:
models.providersunsupported whenapiKeyusesSecretInputSchema(string | objectunion), causing the whole provider section to collapse to Raw-only.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
models.providersas unsupported due to SecretInputSchema union #31490User-visible / Behavior Changes
models.providersis now editable in Config Form mode when providerapiKeyschema isstring | secret-ref object.Security Impact (required)
No)No)No)No)No)Yes, explain risk + mitigation:Repro + Verification
Environment
apiKeyunionmodels.providers.<id>.apiKeyasstring | {source,name}Steps
models.providers.*.apiKeywithanyOf: [string, object].models.providersunsupported.Expected
models.providersdue to this union pattern.Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
pnpm test src/config/config-form-analyze.union.test.tspnpm exec oxfmt --check ui/src/ui/views/config-form.analyze.ts ui/src/ui/views/config-form.node.ts ui/src/ui/config-form.browser.test.ts src/config/config-form-analyze.union.test.tsstring|objectunions no longer marked unsupportedmodels.providers.*.apiKeyunion no longer escalates unsupported state tomodels.providerspnpm checkcurrently fails on pre-existing unrelatedtsgoerrors insrc/process/exec.windows.test.tsandsrc/slack/monitor/events/messages.tsCompatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
fix(ui): support string-object schema unions in config form.ui/src/ui/views/config-form.analyze.ts,ui/src/ui/views/config-form.node.ts.Risks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write
None.