Repository navigation
Description
Describe the bug
AI resource submit APIs treat every reviewing version as an active review and return idempotently. If the publish pipeline has already produced a terminal APPROVED or REJECTED result while the resource version still remains reviewing, submitting the version again does not recover the lifecycle state or start a new review.
A reviewed version also cannot be submitted for another review. The console does not expose a resubmit action for either case.
This affects the shared lifecycle semantics used by Skill, Prompt, and AgentSpec.
Expected behavior
The submit behavior should be consistent for all three AI resource types:
draft: submit for review as usual.reviewed: allow a new review submission.reviewingwith an active pipeline or a terminal result markedhistorical=true: keep the request idempotent because the current review is still in progress.reviewingwith a current, non-historicalAPPROVEDorREJECTEDresult: recover the stale lifecycle state and allow a new review submission.online/offline: continue rejecting submit requests.
The Next and legacy consoles should expose the resubmit action only when the backend can accept it.
Actually behavior
A submit request for any reviewing version returns without changing the state or starting a new pipeline, even when publishPipelineInfo.status is already APPROVED or REJECTED. A reviewed version is rejected as an invalid submit state.
How to Reproduce
- Create and submit a Skill version with a publish pipeline enabled.
- Let the pipeline finish with
REJECTED(orAPPROVED) while the stored version status remainsreviewing. - Disable the pipeline or otherwise keep the terminal pipeline result on the version.
- Call the submit API for the same version again.
- Observe that the version remains
reviewingand no new review is started.
The same lifecycle issue applies to Prompt and AgentSpec submit flows.
Desktop (please complete the following information):
- OS: Any
- Version: current
develop - Module:
ai,console - SDK: HTTP Admin/Console API
Additional context
publishPipelineInfo.historical was introduced to preserve compatibility with historical records whose completed review result was retained while the version still had reviewing status. A historical terminal result must therefore remain idempotent; only a current non-historical terminal result should trigger stale-state recovery.
Activity
[ISSUE #15620] Fix AI resource review resubmission (#15621)