addOperator returns an error but still adds the operator

Ouverte Adaptée aux débutants
#9,121 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@sunny-kavixo y travaille déjà.

Depuis le 11/11/2026.

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
78/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
typescript

Piste de recherche

Commencez dans agent-service/src/agent/tools/workflow-crud-tools.ts, à createAddOperatorTool, et suivez la validation de inputOperatorIds par rapport à l’ajout de l’opérateur. Reproduisez le problème avec un opérateur source manquant, puis ajoutez un test unitaire ciblé pour le cas d’erreur. Le travail est terminé lorsqu’une erreur laisse WorkflowState inchangé ; déterminez si modifyOperator nécessite le même traitement.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

What happened?

addOperator can return an error but still add the operator to the workflow.

In agent-service/src/agent/tools/workflow-crud-tools.ts, createAddOperatorTool first calls workflowState.addOperator(operator), and only then checks inputOperatorIds. If a source operator does not exist, it returns [ERROR] ..., but the new operator stays in the workflow, not connected. The agent then saves it to the user's workflow.

Example on main. Prompt: "Add a Limit operator that keeps 10 rows, and connect its input to the existing operator op7." (there is no op7). addOperator returned [ERROR] Source operator "op7" not found, but a Limit operator (op8) still showed up on the canvas. The agent then said: "I can see that you've already added the Limit operator op8". It thought the user added it. Then it tried to connect op8 again and again until the step limit (see #9115, #9116).

Expected: if addOperator fails, the workflow should not change. Check inputOperatorIds (source exists, port index is valid) before adding the operator, or remove the operator when the check fails. modifyOperator has a similar link loop and may need the same fix.

Screenshots

The canvas after the run: an unconnected Limit operator (op8) is on the canvas, even though addOperator returned an error.

A-workspace.png

Step 3, what the agent was given: op8 is in the workflow, and the agent says "I can see that you've already successfully added the Limit operator op8".

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. The first addOperator returns [ERROR] Source operator "op7" not found..., but an unconnected Limit operator appears on the canvas.

Unit test idea: call the addOperator tool with inputOperatorIds: {"0": ["missing"]} on an empty WorkflowState. The result starts with [ERROR], but state.getAllOperators() has 1 operator.

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/tools/workflow-crud-tools.ts:146  workflowState.addOperator(operator) runs before the inputOperatorIds checks (lines 151-183)
Langage dominant
Scala
Étoiles
333
Forks
202
Merge moyen
3 j 11 h
PR mergées (30 j)
185

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de apache/texera

Toutes les issues de apache/texera

Issues similaires

Plus d'issues Scala

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.