The Open Framework for Building Agents
fix(eve): start a new task when an agent call sends an empty taskId (#4823)
roboeve[bot]910705caaac8
diff --git a/.changeset/empty-task-id-starts-task.md b/.changeset/empty-task-id-starts-task.mdnew file mode 100644index 000000000..e81f4a2d3--- /dev/null+++ b/.changeset/empty-task-id-starts-task.md@@ -0,0 +1,5 @@+---+"eve": patch+---++An agent or `serve` tool call with an empty `taskId` now starts a new task instead of failing with `UNKNOWN_TASK`. Some models send `""` for the optional `taskId` rather than omitting it.diff --git a/packages/eve/src/execution/tasks/model-step.test.ts b/packages/eve/src/execution/tasks/model-step.test.tsindex f92e3b399..db956494b 100644--- a/packages/eve/src/execution/tasks/model-step.test.ts+++ b/packages/eve/src/execution/tasks/model-step.test.ts@@ -14,7 +14,7 @@ const session: HarnessSession = {};// Some models fill an optional string with "" instead of omitting it (#4819).-it.fails("starts a new task for an agent call whose taskId is empty", () => {+it("starts a new task for an agent call whose taskId is empty", () => {const committed = commitCallEntry(session, {callId: "call-1",definition: subagentTool("researcher"),diff --git a/packages/eve/src/execution/tasks/task-id-input.ts b/packages/eve/src/execution/tasks/task-id-input.tsindex 0ffa2d700..272830f76 100644--- a/packages/eve/src/execution/tasks/task-id-input.ts+++ b/packages/eve/src/execution/tasks/task-id-input.ts@@ -74,7 +74,8 @@ export interface ServeCallInput {export function splitTaskIdInput(modelInput: JsonObject): ServeCallInput {const { [TASK_ID_INPUT]: taskId, ...input } = modelInput;- if (typeof taskId !== "string") return { input };+ // Some models fill an optional string with "" instead of omitting it.+ if (typeof taskId !== "string" || taskId === "") return { input };return { input, taskId };}