Skip to content

Suggest and apply fixes for common Python UDF errors from the result panel #8662

Description

@pedroreyesalvarado

Feature Summary

When a Python UDF raises, Texera surfaces the traceback in the console and stops there. The user has to read the traceback, map it back to a column name or a type in the input schema, scroll up to the operator's code, edit it by hand, and re-run.

For the most common failure modes this round-trip is mechanical, and it is the part of the loop new users get stuck on: the traceback names a symptom (KeyError: 'genre') while the information actually needed to fix it (the input schema says the column is genres) lives in a different panel.

This proposes a panel in the result area that reads the error and the operator's own context, proposes a concrete edit, and lets the user apply it with one click.

Scope is deliberately narrow: four recognizable error classes, no new backend endpoints, no engine changes.

Proposed Solution or Design

A new "AI Fix" tab appears in the result panel when the selected operator has an error, alongside the existing Console and Result tabs. It is gated on the existing workflowWorkspace.copilotEnabled GUI config flag, so deployments without an LLM configured see no change.

Flow:

  1. The user clicks Analyze (explicit — nothing is sent anywhere until they do).
  2. The panel gathers the operator context that already exists client-side: the error text from the console messages, the input port schema from the compilation service, and the operator's current code/properties.
  3. It classifies the error against four patterns and sends a targeted prompt to the existing LiteLLM proxy (/api/chat/completions) — the same route the Copilot feature already uses. No new endpoint.
  4. The response is shown as a diff against the current code or property value. Nothing is written to the workflow yet.
  5. Apply writes the change through WorkflowActionService (so it is undoable and syncs to collaborators like any other edit) and re-runs the workflow. Discard returns the panel to idle.

The four classes it handles, chosen because each has a fix derivable from context already on the client:

Error Context used
KeyError: '<col>' input port schema — suggests the closest real column
TypeError: unsupported operand attribute types — suggests the explicit cast
ValueError: Input contains NaN / NullPointerException suggests the guard / dropna
model-not-found / 404 the configured model list

Anything else is reported as unsupported rather than guessed at.

Safety properties worth calling out:

  • The suggestion is checked against the live operator state before it is applied; if the code or field changed since the suggestion was generated, the apply is refused rather than silently overwriting the newer value.
  • If the deployment requires a warehouse and none is selected, the fix is applied but no run is claimed, since ExecuteWorkflowService would refuse it.

Affected Area

Workflow UI

Activity

  1. github-actions commented on Sep 24, 2026

    @github-actions
    Contributor

    👋 Thanks for your first contribution to Texera, @pedroreyesalavrado!

    If you're looking for a good place to start, browse issues labeled starter-task; they're scoped to be approachable for newcomers.

    You can drive common housekeeping yourself by commenting one of these commands on its own line:

    • Issues. Comment /take to assign an open issue to yourself, or /untake to release it. You can find unclaimed work with the search filter is:issue is:open no:assignee.
    • Sub-issues. To link issues into a parent/child hierarchy, comment /sub-issue #5166 #5222 on the parent to attach those children (or /unsub-issue #5166 #5222 to detach them). From a child issue, comment /parent-issue #5166 to set its parent, or /unparent-issue to clear it (the current parent is detected automatically). References may be written as #5166 or as a bare 5166; cross-repository references are not supported.
    • Pull requests (author only). Comment /request-review @user to request a review from someone, or /unrequest-review @user to withdraw that request.

    Each command must match exactly: /take this will not work, only /take does. For the full contribution flow, see CONTRIBUTING.md.

  2. added a commit that references this issue on Oct 28, 2026
    f8c5e1a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions