Skip to content

fix: use Jimeng request key for task polling - #5294

Open
yzhkali wants to merge 1 commit into
QuantumNous:mainfrom
yzhkali:fix/jimeng-fetch-req-key-5278
Open

fix: use Jimeng request key for task polling#5294
yzhkali wants to merge 1 commit into
QuantumNous:mainfrom
yzhkali:fix/jimeng-fetch-req-key-5278

Conversation

@yzhkali

@yzhkali yzhkali commented Jun 3, 2026

Copy link
Copy Markdown

Summary

Persist the Jimeng request key produced during task submission and pass it through asynchronous polling. This keeps submission and result queries on the same provider key, including v30 model variants and metadata overrides.

Tasks created before this field existed continue to use the existing default or best-effort model/action fallback.

Closes #5278

Tests

  • go test ./relay/channel/task/jimeng -count=1
  • go test ./service -count=1
  • go test ./model -run 'Task|InitTask' -count=1
  • git diff --check

Summary by CodeRabbit

  • Bug Fixes
    • Improved asynchronous task polling by preserving provider-specific request keys.
    • Added model and request context to polling requests for more reliable status and result retrieval.
    • Corrected request-key selection across supported video-generation modes.
    • Preserved custom request keys supplied in task metadata.
    • Added validation for missing task identifiers during result retrieval.

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The change persists provider-specific request keys in task properties, resolves Jimeng request keys from request context, and includes upstream task and model metadata in polling requests.

Changes

Upstream request key persistence and resolution

Layer / File(s) Summary
Task metadata and persistence
model/task.go, relay/common/relay_info.go, model/task_cas_test.go
TaskRelayInfo and task Properties now store UpstreamRequestKey. InitTask persists the key and tests verify the stored metadata.
Jimeng request-key resolution
relay/channel/task/jimeng/adaptor.go
Jimeng request keys are resolved from model, image, action, and metadata context. Resolved keys are stored and reused for task fetching.
Polling payload construction
service/task_polling.go, service/task_polling_test.go
BuildTaskFetchBody includes task, model, and request-key context. updateVideoSingleTask uses the new payload builder.
Jimeng adaptor validation
relay/channel/task/jimeng/adaptor_test.go
Tests cover model variants, payload propagation, persisted keys, fallback resolution, signed requests, missing task IDs, and custom metadata keys.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • QuantumNous/new-api#6648: Both update asynchronous task polling in service/task_polling.go with Volc Native task context.

Poem

A rabbit saw keys hop through the task,
From Jimeng’s request to polling’s ask.
Models and actions now guide the way,
Persisted keys return on fetch day.
“No more fixed paths!” the rabbit sings,
As upstream context grows its wings.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes address issue #5278 by persisting and using the submitted Jimeng request key during task polling, with fallback behavior and tests.
Out of Scope Changes check ✅ Passed All production and test changes support request-key persistence and Jimeng task polling; no unrelated scope is evident.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: using the Jimeng request key during task polling.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@yzhkali

yzhkali commented Jun 17, 2026

Copy link
Copy Markdown
Author

Following up in case this fell through. This PR is focused on #5278: Jimeng task polling now uses the request key returned by task creation, with coverage for the polling path.

Checks are green. Happy to adjust the key-selection behavior if you prefer a different source of truth.

@yzhkali
yzhkali force-pushed the fix/jimeng-fetch-req-key-5278 branch from 984aa23 to 9ec62e4 Compare August 4, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

即梦模型被写死了

1 participant