iex(4)> Batcher.BatchBuilder.upload_batch("/v1/responses", "gpt-4o-mini") :ok [debug] QUERY OK source="batches" db=0.1ms idle=1078.7ms SELECT b0."id", b0."state", b0."error_msg", b0."url", b0."updated_at", b0."created_at", b0."model", b0."cached_tokens", b0."input_tokens", b0."openai_batch_id", b0."openai_input_file_id", b0."openai_output_file_id", b0."output_tokens", b0."reasoning_tokens" FROM "batches" AS b0 WHERE (CAST(b0."id" AS INTEGER) = CAST(? AS INTEGER)) [3] ↳ AshSqlite.DataLayer.run_query/2, at: lib/data_layer.ex:604 [debug] QUERY OK source="batches" db=0.2ms idle=1079.6ms UPDATE "batches" AS b0 SET "state" = ?, "updated_at" = ? WHERE (b0."id" = ?) RETURNING "id", "state", "error_msg", "url", "updated_at", "created_at", "model", "cached_tokens", "input_tokens", "openai_batch_id", "openai_input_file_id", "openai_output_file_id", "output_tokens", "reasoning_tokens" [:uploading, ~U[2025-12-09 18:38:36.714497Z], 3] ↳ AshSqlite.DataLayer.update_query/4, at: lib/data_layer.ex:1595 [debug] QUERY OK source="batch_transitions" db=0.1ms idle=1081.1ms INSERT INTO "batch_transitions" ("to","from","batch_id","transitioned_at") VALUES (?1,?2,?3,?4) RETURNING "batch_id","transitioned_at","to","from","id" [:uploading, :building, 3, ~U[2025-12-09 18:38:36.716108Z]] ↳ anonymous fn/4 in AshSqlite.DataLayer.bulk_create/3, at: lib/data_layer.ex:719 [info] Batch 3 marked ready for upload: total_requests=2 total_size=257 bytes [debug] QUERY OK source="batches" db=0.1ms idle=1087.8ms SELECT b0."id", b0."state", b0."error_msg", b0."url", b0."updated_at", b0."created_at", b0."model", b0."cached_tokens", b0."input_tokens", b0."openai_batch_id", b0."openai_input_file_id", b0."openai_output_file_id", b0."output_tokens", b0."reasoning_tokens" FROM "batches" AS b0 WHERE (CAST(b0."state" AS TEXT) = CAST(? AS TEXT)) AND (CAST(b0."id" AS INTEGER) = CAST(? AS INTEGER)) [:uploading, 3] ↳ AshSqlite.DataLayer.run_query/2, at: lib/data_layer.ex:604 [info] Processing batch 3: building and uploading file [debug] Started building batch_3.jsonl [debug] QUERY OK source="requests" db=0.0ms idle=802.9ms SELECT r0."id", r0."request_payload" FROM "requests" AS r0 WHERE (CAST(r0."batch_id" AS INTEGER) = CAST(? AS INTEGER)) ORDER BY r0."id" LIMIT ? [3, 101] ↳ AshSqlite.DataLayer.run_query/2, at: lib/data_layer.ex:604 [debug] Finished building batch_3.jsonl [info] Started uploading batch_3.jsonl [debug] Successfully uploaded batch_3.jsonl [info] Batch 3 uploaded successfully (OpenAI File ID: file-1ftqspMtnKPvoL3sSeYf7L) [debug] QUERY OK source="batches" db=0.5ms idle=480.4ms UPDATE "batches" AS b0 SET "state" = ?, "updated_at" = ?, "openai_input_file_id" = ? WHERE (b0."id" = ?) RETURNING "id", "state", "error_msg", "url", "updated_at", "created_at", "model", "cached_tokens", "input_tokens", "openai_batch_id", "openai_input_file_id", "openai_output_file_id", "output_tokens", "reasoning_tokens" [:uploaded, ~U[2025-12-09 18:38:37.193959Z], "file-1ftqspMtnKPvoL3sSeYf7L", 3] ↳ AshSqlite.DataLayer.update_query/4, at: lib/data_layer.ex:1595 [debug] QUERY OK source="batch_transitions" db=0.1ms idle=481.8ms INSERT INTO "batch_transitions" ("to","from","batch_id","transitioned_at") VALUES (?1,?2,?3,?4) RETURNING "batch_id","transitioned_at","to","from","id" [:uploaded, :uploading, 3, ~U[2025-12-09 18:38:37.197569Z]] ↳ anonymous fn/4 in AshSqlite.DataLayer.bulk_create/3, at: lib/data_layer.ex:719 [debug] QUERY OK source="batches" db=0.2ms idle=481.6ms SELECT b0."id", b0."state", b0."error_msg", b0."url", b0."updated_at", b0."created_at", b0."model", b0."cached_tokens", b0."input_tokens", b0."openai_batch_id", b0."openai_input_file_id", b0."openai_output_file_id", b0."output_tokens", b0."reasoning_tokens" FROM "batches" AS b0 WHERE (CAST(b0."state" AS TEXT) = CAST(? AS TEXT)) AND (CAST(b0."id" AS INTEGER) = CAST(? AS INTEGER)) [:uploaded, 3] ↳ AshSqlite.DataLayer.run_query/2, at: lib/data_layer.ex:604 [debug] Creating OpenAI batch with file_id: file-1ftqspMtnKPvoL3sSeYf7L, endpoint: /v1/responses [debug] Successfully created OpenAI batch: batch_69386cad71fc8190bce5d504a5588024 [debug] QUERY OK source="batches" db=0.5ms idle=975.7ms UPDATE "batches" AS b0 SET "state" = ?, "updated_at" = ?, "openai_batch_id" = ? WHERE (b0."id" = ?) RETURNING "id", "state", "error_msg", "url", "updated_at", "created_at", "model", "cached_tokens", "input_tokens", "openai_batch_id", "openai_input_file_id", "openai_output_file_id", "output_tokens", "reasoning_tokens" [:openai_processing, ~U[2025-12-09 18:38:37.898892Z], "batch_69386cad71fc8190bce5d504a5588024", 3] ↳ AshSqlite.DataLayer.update_query/4, at: lib/data_layer.ex:1595 [error] Error occurred for Batcher.Batching.Batch: %{"id" => 3}! Error occurred on action: create_openai_batch. "** (Ash.Error.Invalid) \nBread Crumbs:\n > Exception raised in: Batcher.Batching.Batch.create_openai_batch\n\nInvalid Error\n\n* Batcher.Batching.Request.begin_processing had no matching bulk strategy that could be used.\n\nRequested strategies: [:atomic]\n\nCould not use `:stream`: Not in requested strategies\nCould not use `:atomic_batches`: Not in requested strategies\nCould not use `:atomic`: data layer `Elixir.AshSqlite.DataLayer` does not support the expr_error.\n\nValidation error(AshStateMachine.Errors.NoMatchingTransition, %{target: :processing, action: :begin_processing, old_state: state}) with condition true and not ((state in [:pending]) and (:processing in [:processing]))\n\n\n\n\n (ash 3.7.6) lib/ash/error/invalid/no_matching_bulk_strategy.ex:8: Ash.Error.Invalid.NoMatchingBulkStrategy.exception/1\n (ash 3.7.6) lib/ash/actions/update/bulk.ex:1233: Ash.Actions.Update.Bulk.do_run/8\n (ash 3.7.6) lib/ash/actions/update/bulk.ex:500: Ash.Actions.Update.Bulk.run/6\n (ash 3.7.6) lib/ash/actions/update/bulk.ex:187: Ash.Actions.Update.Bulk.run/6\n (ash 3.7.6) lib/ash.ex:3321: Ash.bulk_update!/4\n (batcher 0.1.0) lib/batcher/batching/changes/create_openai_batch.ex:28: anonymous fn/2 in Batcher.Batching.Changes.CreateOpenaiBatch.change/3\n (ash 3.7.6) lib/ash/changeset/changeset.ex:4765: anonymous fn/2 in Ash.Changeset.run_after_actions/3\n (elixir 1.18.4) lib/enum.ex:4968: Enumerable.List.reduce/3\n (elixir 1.18.4) lib/enum.ex:2600: Enum.reduce_while/3\n (ash 3.7.6) lib/ash/changeset/changeset.ex:4385: anonymous fn/2 in Ash.Changeset.transaction_hooks/2\n (ash 3.7.6) lib/ash/changeset/changeset.ex:4295: Ash.Changeset.with_hooks/3\n (ash 3.7.6) lib/ash/actions/update/update.ex:440: Ash.Actions.Update.commit/3\n (ash 3.7.6) lib/ash/actions/update/update.ex:313: Ash.Actions.Update.do_run/4\n (ash 3.7.6) lib/ash/actions/update/update.ex:257: Ash.Actions.Update.run/4\n (ash 3.7.6) lib/ash.ex:3639: Ash.update/3\n (batcher 0.1.0) deps/ash_oban/lib/transformers/define_schedulers.ex:1081: Batcher.Batching.Batch.AshOban.Worker.CreateOpenaiBatch.perform/1\n (oban 2.20.1) lib/oban/queue/executor.ex:145: Oban.Queue.Executor.perform/1\n (oban 2.20.1) lib/oban/queue/executor.ex:77: Oban.Queue.Executor.call/1\n (elixir 1.18.4) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2\n (ash 3.7.6) lib/ash.ex:3341: Ash.bulk_update!/4\n (batcher 0.1.0) lib/batcher/batching/changes/create_openai_batch.ex:28: anonymous fn/2 in Batcher.Batching.Changes.CreateOpenaiBatch.change/3\n (ash 3.7.6) lib/ash/changeset/changeset.ex:4765: anonymous fn/2 in Ash.Changeset.run_after_actions/3\n (elixir 1.18.4) lib/enum.ex:4968: Enumerable.List.reduce/3\n (elixir 1.18.4) lib/enum.ex:2600: Enum.reduce_while/3\n (ash 3.7.6) lib/ash/changeset/changeset.ex:4385: anonymous fn/2 in Ash.Changeset.transaction_hooks/2\n (ash 3.7.6) lib/ash/changeset/changeset.ex:4295: Ash.Changeset.with_hooks/3\n (ash 3.7.6) lib/ash/actions/update/update.ex:440: Ash.Actions.Update.commit/3\n (ash 3.7.6) lib/ash/actions/update/update.ex:313: Ash.Actions.Update.do_run/4\n (ash 3.7.6) lib/ash/actions/update/update.ex:257: Ash.Actions.Update.run/4\n (ash 3.7.6) lib/ash.ex:3639: Ash.update/3\n (batcher 0.1.0) deps/ash_oban/lib/transformers/define_schedulers.ex:1081: Batcher.Batching.Batch.AshOban.Worker.CreateOpenaiBatch.perform/1\n (oban 2.20.1) lib/oban/queue/executor.ex:145: Oban.Queue.Executor.perform/1\n (oban 2.20.1) lib/oban/queue/executor.ex:77: Oban.Queue.Executor.call/1\n (elixir 1.18.4) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2\n (elixir 1.18.4) lib/task/supervised.ex:36: Task.Supervised.reply/4\n"