This commit is contained in:
Your Name
2026-11-26 15:46:20 +08:00
parent db6d327e91
commit be79e09c83
170 changed files with 21159 additions and 13217 deletions
@@ -88,7 +88,7 @@ final class AssistantRequestControl
/** Atomic ownership record immediately before this generation's first POST execution. */
public function beginSubmission(string $profile, string $user): string
{
if (!in_array($profile, ['qwen', 'openai'], true) || strlen($user) > 128) throw new \RuntimeException('Invalid submission scope');
if (!in_array($profile, ['qwen', 'openai', 'doubao'], true) || strlen($user) > 128) throw new \RuntimeException('Invalid submission scope');
$token = bin2hex(random_bytes(12));
return $this->update(static function (array &$state) use ($profile, $user, $token): string {
if (!self::canStartState($state)) throw new \RuntimeException('UPSTREAM_CLEANUP_PENDING');
@@ -198,7 +198,7 @@ final class AssistantRequestControl
public function bindTask(string $profile, string $user, string $taskId, string $workflowRunId = '', string $submissionId = ''): void
{
if (!in_array($profile, ['qwen', 'openai'], true)
if (!in_array($profile, ['qwen', 'openai', 'doubao'], true)
|| !self::validUpstreamId($taskId) || strlen($user) > 128
|| ($workflowRunId !== '' && !self::validUpstreamId($workflowRunId))) {
throw new \RuntimeException('Invalid upstream task identity');
@@ -573,7 +573,7 @@ final class AssistantRequestControl
$task = $target['upstream'] ?? [];
if (!is_array($task) || !is_string($task['task_id'] ?? null) || !self::validUpstreamId($task['task_id'])
|| !is_string($task['workflow_run_id'] ?? null) || !self::validUpstreamId($task['workflow_run_id'])
|| !in_array($task['profile'] ?? '', ['qwen', 'openai'], true)
|| !in_array($task['profile'] ?? '', ['qwen', 'openai', 'doubao'], true)
|| !is_string($task['user'] ?? null) || strlen($task['user']) > 128
|| !is_int($task['generation'] ?? null) || $task['generation'] <= 0) return null;
return ['profile' => $task['profile'], 'user' => $task['user'], 'task_id' => $task['task_id'],