diegosouzapw/OmniRoute · error · Error

Jules create task failed

Error message

Jules create task failed: ${response.status} ${error}

What it means

Thrown in Jules createTask when the POST to the Jules API /sessions endpoint (which creates a task session, including automationMode/plan-approval options) returns a non-2xx status. The status and upstream body are embedded in the message: it fires on invalid repository/source, bad or missing API key, malformed options, quota limits, or upstream server errors.

Solutions

  1. Inspect response.status and the embedded upstream body to classify the failure (auth vs payload vs quota)
  2. For 401/403, refresh or correct the Jules API key in credentials
  3. For 400, validate params.options (autoCreatePr, planApprovalRequired) and the target repo/source against Jules requirements
  4. For 429/5xx, retry with backoff and report the task as temporarily failed
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/lib/cloudAgent/agents/jules.ts:224 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/15c13d7fd967af7f. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/cloudAgent/agents/jules.ts:224

      },
    };

    if (params.options.autoCreatePr) {
      body.automationMode = "AUTO_CREATE_PR";
    }
    if (params.options.planApprovalRequired) {
      body.requirePlanApproval = true;
    }

    const response = await fetch(buildJulesApiUrl("/sessions"), {
      method: "POST",
      headers: julesHeaders(credentials.apiKey, true),
      body: JSON.stringify(body),
    });

    if (!response.ok) {
      const error = await response.text();
      throw new Error(`Jules create task failed: ${response.status} ${error}`);
    }

    const data = (await response.json()) as Record<string, unknown>;
    const sessionId =
      (typeof data.id === "string" && data.id) ||
      (typeof data.name === "string" ? normalizeJulesSessionId(data.name) : "") ||
      taskId;

    return {
      id: taskId,
      providerId: this.providerId,
      externalId: sessionId,
      status: CLOUD_AGENT_STATUS.QUEUED,
      prompt: params.prompt,
      source: params.source,
      options: params.options,
      activities: [],
      createdAt: new Date().toISOString(),

View on GitHub (pinned to a179ffed5b)