取消抠图工具的每回合四项媒体请求限制
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Successful in 7m28s
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Successful in 7m46s
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Successful in 7m49s
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Successful in 7m58s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 2m13s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m42s
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled

resource_request_ids 增加 enforce_turn_limit 参数,上限检查只在付费路径生效

agc_remove_background 传 false 豁免上限,id 派生与幂等复用不变

create_or_derive(含 agc_edit_image 委托)维持四项上限与原有报错文案

决策记录补充 2026-09-18 抠图豁免条目

实施计划文档同步注明抠图不占四项额度
This commit is contained in:
2026-09-18 23:55:19 +08:00
parent 9a21690fe9
commit c413ca44df
3 changed files with 19 additions and 5 deletions
@@ -637,7 +637,11 @@ impl DirectToolBridgeState {
Ok(())
}
fn resource_request_ids(&self, request_fingerprint: &str) -> Result<(String, String), String> {
fn resource_request_ids(
&self,
request_fingerprint: &str,
enforce_turn_limit: bool,
) -> Result<(String, String), String> {
let mut authorization = self
.turn_authorization
.lock()
@@ -649,7 +653,9 @@ impl DirectToolBridgeState {
if let Some(ids) = active.resource_request_ids.get(request_fingerprint) {
return Ok(ids.clone());
}
if active.resource_request_ids.len() >= DIRECT_TOOL_BRIDGE_MAX_RESOURCE_CALLS_PER_TURN {
if enforce_turn_limit
&& active.resource_request_ids.len() >= DIRECT_TOOL_BRIDGE_MAX_RESOURCE_CALLS_PER_TURN
{
return Err("单个用户回合最多只能创建四项媒体资源请求".to_string());
}
let operation_id =
@@ -1891,7 +1897,7 @@ async fn bridge_create_or_derive_resource(
.await?
} else {
let (operation_id, idempotency_key) =
state.resource_request_ids(&request_fingerprint)?;
state.resource_request_ids(&request_fingerprint, true)?;
let revision = read_game_creator_agent_runtime_project_revision(&state.root)?.revision;
let source_resource_id = source_asset
.as_ref()
@@ -2001,7 +2007,9 @@ async fn bridge_remove_background(state: &DirectToolBridgeState, arguments: &Val
})
.await?
} else {
let (operation_id, idempotency_key) = state.resource_request_ids(&fingerprint)?;
// 抠图不计费且服务端秒级完成,不占每回合付费媒体请求的四项额度。
let (operation_id, idempotency_key) =
state.resource_request_ids(&fingerprint, false)?;
let revision = read_game_creator_agent_runtime_project_revision(&state.root)?.revision;
let request = DeriveLocalProjectResourceInput {
project_path: state.root.to_string_lossy().into_owned(),