Skip to content

feat(providers): discover capabilities and validate generation inputs - #266

Draft
bread-lxy wants to merge 24 commits into
ThinkFlowLab:mainfrom
bread-lxy:codex/v2-capabilities
Draft

bread-lxy wants to merge 24 commits into
ThinkFlowLab:mainfrom
bread-lxy:codex/v2-capabilities

Conversation

@bread-lxy

@bread-lxy bread-lxy commented Nov 10, 2026 •

Copy link
Copy Markdown

Summary

Discover optional model capabilities before submitting work, and explain incompatible requests without discarding the user's configuration, inputs or selections.

  • Share capability lookup and request checks across connection settings, generation, the assistant, API, CLI and Agent tools. Match the exact model, route, inputs, parameters and required output.
  • Reject new work only on fresh, applicable negative evidence. Preserve existing validation for older services and failed or unknown discovery. Keep accepted-task recovery and replay unchanged.
  • Check image counts without truncation. Region-editing tools use native masks when both the declared route and local adapter support them, preserving requested dimensions and final compositing.
  • Check the exact parameters sent by image adapters, including upstream MiniMax's fixed output/response formats and adjusted tool dimensions. Unsupported mask transport cannot silently discard an input.
  • Keep Chinese and English states current, including generation history after a language change. Explain busy services and blocked result downloads without weakening download security.

Linked issue

Refs #224 (V2). The companion Omni S2 PR supplies the discovery endpoint.

Labels

type:feat, area:provider, area:canvas, area:agent.

Test plan

Windows, Python 3.12.7 and Node 24.22.1. Integrated upstream 4d15b4e; final code a0fbd18.

  • 244 passed across image adapters, request parameters, capability decisions, creation acceptance, native-mask tools, image edits and saved-task behavior. MiniMax checks compare checked parameters with serialized requests, reject incompatible formats through service/HTTP/Agent with zero jobs and zero generation requests, and preserve upstream ordered-image, download-recovery and no-resubmission behavior.
  • 24 passed for the subsequently integrated GLM chat mappings and assistant conversations; 50 passed in the related frontend checks.
  • Contract generation, import boundaries, bilingual catalogs, browser manifest and production build passed.
  • The final capability browser workflow passed in both languages: save/refresh, unchanged drafts, exact-input rejection, successful UI submission and saved media, pause expiry, stale-response handling and preserved history. Earlier voice-library and history-language browser checks also passed.

Focused test entry points: tests/test_minimax_image.py, tests/test_model_availability.py, tests/test_request_capability_acceptance.py, tests/test_tool_native_mask.py and tests/browser/capability_discovery.mjs. Setup and commands are in the validation guide.

Upstream Z-Image sampling defaults apply only to text-to-image jobs. Capability validation checks the saved sampling values; editing and accepted-task recovery retain their applicable parameters. MiniMax retains its existing routes, image ordering, 16-image limit and result-download checks.

Evidence that it works

Example capability cards from the controlled UI regression:

English capability card

中文能力卡

Provider verification

The normal application completed real GLM chat and MOSS speech requests. The saved speech file played successfully; its transcription matched the submitted text. A failed capability lookup against a legacy service was followed by a successful real chat request without changing configuration or existing tasks.

Capability-state and image-edit regressions use controlled services and fixture media. Real-model mask adherence remains unverified.

Bilingual UI

Both zh-CN and en-US were checked in the browser, including live language switching, rejection messages and retained voice selections.

AI assistance

This contribution was made with assistance from Codex.

## summary

- Apply declared string enum normalization only while comparing values,
  retaining original input and treating unknown rules as unknown.
- Count content references without treating metadata or cached video
  continuations as uploaded media; retain endpoint pause enforcement.
- Share specific constraint errors across admission and execution, keep
  nested receipt codes, and present image geometry failures bilingually.
- Document accepted image request policies and cover actual speech
  payloads, continuation job IDs, and rejection before task creation.

## validation

- Targeted capability, Agent and cache checks: 106 passed, 1 skipped.
- Actual request projection and H3 checks: 61 passed, model doubles.
- Frontend unit tests: 763 passed with PYTHONUTF8=1 on Windows.
- TypeScript/build, i18n, browser manifests, generated contracts and
  import-layer checks passed. Full Python suite is still running.
## summary

Honor a globally disabled exact HTTP endpoint when a continuation
profile is undeclared, without borrowing another profile's inputs.
Keep route_disabled as the rejection reason during a fresh pause.
Verify the public command API creates no continuation job or request
on the disabled endpoint and preserves the original remote job ID
when the endpoint is available.

## validation

The projection and public HTTP regressions both failed before the fix.
The three affected test modules now pass all 110 cases with model
doubles and real temporary media; no real model inference was run.
## summary

Apply the exact global HTTP endpoint closure after profile matching so
both a missing profile and missing profile-route details still reject
new work. Preserve already explicit operation and profile rejections.

## validation

The missing-profile-route regression failed before the fix. All 111
capability projection, availability and H3 tests pass afterward,
including public command rejection without a new model request.
@FayeSpica FayeSpica added type:feat New capability or behaviour area:provider Model providers and generation protocols area:canvas Canvas, nodes and direct manipulation area:agent Agent runtime, assistant chat and tools labels Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent Agent runtime, assistant chat and tools 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