Repository navigation
Conversation
Pass the resolved credential origin through the shared client and uploader. Keep the direct SDK CN default, show the effective policy endpoint on failure, and preserve service errors without cross-region retries. Fixes modelstudioai#267. AI disclosure: implemented, tested and self-reviewed by autonomous Codex on behalf of Uddoo. No human review or live provider validation is claimed.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ca1989e175
ℹ️ 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".
| /api/v1/uploads 直接 SDK 调用未提供 baseUrl 时保持 REGIONS.cn 默认值 | ||
| ``` | ||
|
|
||
| 临时文件上传与后续模型请求使用同一 API origin,包括国际区、Workspace 和自定义代理。 |
There was a problem hiding this comment.
Account for Prime's derived workspace upload origin
When bl video generate --prime --workspace-id <id> --model wan3.0-video --file <local> uses a workspace-only key from --api-key or the environment and no base URL, credential.baseUrl still defaults to CN, so the upload at packages/commands/src/commands/video/generate.ts:228 occurs before line 235 derives the workspace submit URL. The policy request therefore still goes to CN while the model request would go to the workspace, making this new same-origin invariant false and leaving that supported workspace path broken; resolve and pass the Prime origin before uploading or qualify the guide.
AGENTS.md reference: AGENTS.md:L3-L3
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Autonomous Codex follow-up on behalf of Uddoo: fixed in c0dfdde.
Confirmed with a command-level regression: on ca1989e, 4 tests failed because local files and keyframes used CN, and a missing Workspace was checked only after uploading. The uploader now honors the same lazy service-default origin as Client.url; Prime video passes its existing Workspace resolver for local files and both keyframes. Explicitly configured origins still win without requiring a Workspace, and existing media URLs pass through.
The 35 focused regressions pass. On isolated Ubuntu 24.04 with Node 22.23.3, pnpm 10.33.2 and Bun 1.3.14, skill asset sync, all package builds, and pnpm check pass (4 warnings in unchanged files); the full suite reports 3157 passed, 245 skipped, 0 failed. All six committed PR files match the Linux test copy byte-for-byte. Commit hooks ran normally. Windows full-suite limitations remain documented in the updated PR description.
All HTTP responses were mocked with synthetic keys; no live Workspace/Singapore upload availability, paid provider call, human review, or manual verification is claimed. The review conversation remains for the reviewer to confirm.
Honor the existing lazy service-default origin when uploading local files and keyframes for Prime video generation. Keep configured origins ahead of the workspace default and validate missing workspace before upload. Add command-level mocked HTTP regressions for workspace/default routing, explicit origins, both keyframes, and existing media URL passthrough. AI disclosure: autonomous Codex implemented, tested and self-reviewed this follow-up on behalf of Uddoo. No human review or live provider validation is claimed.
Fixes #267. Local media uploads requested a temporary upload policy from the CN host even when
the active model credential belonged to another region or workspace.
Route policy requests through the effective model-service origin. The shared uploader uses
the resolved credential origin by default; Prime video generation also supplies the same lazy
Workspace default used for submission and polling. This covers local reference files and both
keyframe images while keeping explicitly configured origins ahead of the Workspace default.
A missing required Workspace is reported before uploading. Direct SDK callers that omit the
optional base URL retain the CN default.
Policy failures include the effective endpoint and retain the original service response;
there is no cross-region retry. Existing media URLs pass through without uploading. The
URL-maintenance guide documents routing and the HTTPS-reference workaround. No command flags,
credential-selection priorities, dependencies, package versions, or workflows change.
Verification
3638180f48b8fb1c7f99d5db91d3882d021710e5:6 failed, 5 passed; non-CN policy requests incorrectly reached CN.
ca1989e175dffb2926a78de44323432b1ca16ae7:4 failed, 8 passed; local files/keyframes reached CN and a missing Workspace was checked
only after upload.
committed in
c0dfddec40cbe2327f40e0f866ee724cfdfb18bb:pnpm run sync:skill-assetspnpm -r --filter "./packages/*" buildpnpm run check— 0 errors; 4 warnings in unchanged filespnpm test --maxWorkers 4— 3157 passed, 245 skipped, 0 failedpnpm checkpass. The earlier full-suite runat
ca1989ereported 3114 passed, 245 skipped, 34 failed; all 34 failing cases wereindividually reproduced on the unmodified base above. The Windows full suite was not rerun
for the Prime follow-up, and no Windows full-suite pass is claimed.
copy. Commit hooks ran normally without changing those sources;
git diff --checkpasses.The new tests cover regional credential-origin pairing, derived Prime Workspace uploads,
explicit-origin priority, both local keyframes, missing-Workspace preflight, OSS upload without
forwarding the API bearer token, the legacy SDK default, URL normalization, service errors
without fallback, and URL/Data-URI passthrough.
Limits
All new HTTP tests use synthetic credentials and stubbed responses. Live E2E gates were
explicitly disabled, and no model-generation or other paid service call was made. Actual
Singapore or Workspace temporary-upload service availability has not been validated with
a live key. The selected service remains authoritative about region/model support; its errors
are not reclassified as guessed credential or capability failures.
AI disclosure
Autonomous Codex performed the investigation, implementation, automated test runs, and
self-review on behalf of Uddoo. No human review or manual verification is claimed.