Skip to content

Failed tool calls are marked as succeeded (isError is always false) #9120

Closed

Description

@yrenat

What happened?

When a tool call fails, the agent still marks it as succeeded.

In agent-service/src/agent/texera-agent.ts, onStepFinish sets:

isError: !!(tr.output as any)?.error,

But the tools return errors as a plain string, from createErrorResult in tools/tools-utility.ts:

export function createErrorResult(error: string): string {
  return `[ERROR] ${error}`;
}

A string has no .error field, so isError is always false. Then the turn history shows every call as - <tool> (succeeded).

Example on main: addOperator and modifyOperator both returned [ERROR] Source operator "op7" not found. Both were saved with isError: false, and the next turn showed - addOperator (succeeded) and - modifyOperator (succeeded). Together with #9115, the agent gets no sign at all that the call failed.

Expected: isError should be true when the tool returns an error, for example when the output starts with [ERROR].

Screenshots

Step 1, tool call: the result starts with [ERROR].

A-step1-toolcall.png

Step 3, what the agent was given: the same call shows as - addOperator (succeeded).

A-step3-context.png

How to reproduce?

  1. Open an empty workflow, create an agent, and send: Add a Limit operator that keeps 10 rows, and connect its input to the existing operator op7.
  2. Click "Export ReAct steps as JSON". Step 1's toolResults[0].output starts with [ERROR], but isError is false. Step 2's input shows - addOperator (succeeded).

Version/Branch

1.4.0-incubating-SNAPSHOT (main)

Commit Hash (Optional)

57faa6b

What browsers are you seeing the problem on?

Chrome

Relevant log output

agent-service/src/agent/texera-agent.ts  onStepFinish: isError: !!(tr.output as any)?.error
agent-service/src/agent/tools/tools-utility.ts:30  createErrorResult returns a string

Activity

  1. added theissue type on Oct 24, 2026
  2. oliarmak-web commented on Oct 24, 2026

    @oliarmak-web
    Contributor

    Hi, I reproduced the mismatch described here: createErrorResult returns a string, while onStepFinish checks for an object error field, so the persisted result cannot be marked as failed. I would be interested in implementing a focused repair with deterministic tests covering successful results, error results, exported ReAct history, and the failure status shown in the next agent turn. Before I use /take, would you prefer a minimal classifier that preserves the current string contract, or a typed result contract that removes the need to infer failure from the [ERROR] prefix?

  3. yrenat commented on Oct 24, 2026

    @yrenat
    ContributorAuthor

    Thanks for offering to help! I personally prefer the minimal fix. Do you have any comments on that? @bobbai00

  4. bobbai00 commented on Oct 26, 2026

    @bobbai00
    Contributor

    @yrenat thanks for raising the issues. I think a minimal fix should be done regarding this issue.

  5. oliarmak-web commented on Oct 26, 2026

    @oliarmak-web
    Contributor

    Thanks for confirming. I’ll proceed with the minimal fix: preserve the current string result contract, classify tool outputs beginning with [ERROR] as failures in onStepFinish, and add regression tests covering successful results, error results, persisted isError, and the status shown in the next agent turn.

    /take

  6. oliarmak-web commented on Nov 2, 2026

    @oliarmak-web
    Contributor

    Thanks again. I’m still available to implement the focused fix described above. It looks like /take did not assign the issue. Could a maintainer confirm whether I should proceed or assign it to me?

  7. bobbai00 commented on Nov 2, 2026

    @bobbai00
    Contributor

    7. Thanks again. I’m still available to implement the focused fix described above. It looks like /take did not assign the issue. Could a maintainer confirm whether I should proceed or assign it to me?

    Hello @oliarmak-web ! I think you need to send /take in a separate message. I assigned to you. So you can start to work on it now!

  8. oliarmak-web commented on Nov 2, 2026

    @oliarmak-web
    Contributor

    Thanks for assigning it to me. I will start on the agreed minimal fix and include focused regression coverage for successful and [ERROR] tool results, persisted isError, and the status presented in subsequent agent context.

  9. oliarmak-web commented on Nov 2, 2026

    @oliarmak-web
    Contributor

    Thanks @bobbai00 and @yrenat. I opened #9259 with the agreed minimal fix. It classifies [ERROR] string outputs as failed while preserving structured error handling, and adds regression coverage for persisted status and the status presented in the next agent turn. The full agent-service suite passes with 313 tests.

    I kept SDK-rejected tool-error parts outside this focused scope so that behavior can be handled separately if needed.

  10. added a commit that references this issue on Nov 18, 2026
    af58667
  11. added a commit that references this issue on Nov 21, 2026
    9b29d06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions