[Hackathon] feat: Custom Operator Builder — Create Reusable Operators from Code#5108
Open
EmilySun621 wants to merge 2 commits into
Open
[Hackathon] feat: Custom Operator Builder — Create Reusable Operators from Code#5108EmilySun621 wants to merge 2 commits into
EmilySun621 wants to merge 2 commits into
Conversation
This bundles the feature work that built up on this branch:
- Custom agents: dashboard CRUD page and editor dialog (48px icon tile,
chip-style guardrails, model selector). Each custom agent now carries a
LiteLLM model_name (Opus 4.7 / Haiku 4.5) that is passed through to the
agent-service so different agents can use different models.
- Conversation history is scoped per (workflowId, agentId): switching
agent or workflow yields a different conversation list. localStorage
key: texera.workflowConversations.v1.{workflowId}.{agentId}.
- Time machine: workflow snapshot list, revert, and agent-tagged
checkpoints. New workflow-history-tool in agent-service backs the
"undo my last change" flow; amber gains a WorkflowSnapshotResource;
sql/updates/23.sql adds the snapshot table.
- Operator-aware custom-agent prompts: the system prompt now injects the
full operator catalog with a "prefer built-in operators over Python
UDFs" rule, sourced from WorkflowSystemMetadata at request time.
- LiteLLM: added the claude-opus-4.7 entry alongside claude-haiku-4.5
and gpt-5-mini in bin/litellm-config.yaml.
- Agent panel rewritten around the (conversation list / chat) two-view
model with subscription-managed list reloads and per-step persistence.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a "My Operators" section under Your Work where users can author
Python operators by writing UDF code, configuring ports/properties,
and saving them as draggable items in the workflow editor. Each saved
operator wraps a PythonUDFV2 node pre-filled with the saved code and
ports — no engine or operator-registry changes required.
- Data model + localStorage CRUD (custom-operator.{interface,service})
- "My Operators" list page + full-page editor with Monaco code editor,
port/property builder, and a Test Run that validates UDF shape
- Operator panel surfaces a "My Operators" collapse at the top of the
workflow editor; dragging a custom operator builds a PythonUDFV2
predicate via CustomOperatorFactoryService and reuses the existing
DragDropService flow via a new dragStartedCustom() entry point
- Custom properties get rendered as a PROPS dict prepended to the saved
code so user UDFs can read self-configured values without extending
the Python UDF schema
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
😤 The Problem
A lab has Python functions they use in every project — a BMI calculator, an outlier remover, a custom normalization method. Every new workflow means someone opens a Python UDF and re-types the same code. If someone improves the function, the other workflows don't get the update.
No library. No reuse. No sharing. Just copy-paste across workflows.
✨ What We Built
🧩 Custom Operator Builder
Write Python code → save it as a named operator → drag and drop it in any workflow, just like a built-in one.
📋 My Operators Page
New sidebar entry under "Your Work":
🖥️ Full-Page Operator Editor
Split-screen IDE-like experience:
Left panel (40%) — Configuration:
self.args['property_name']Right panel (60%) — Code Editor:
🎯 Drag & Drop in Workflow Editor
Once saved, custom operators appear in the operator panel under a "My Operators" category:
⚙️ How It Works Under the Hood
Custom operators are a smart wrapper around Python UDF — no engine modifications:
PythonUDFV2nodePROPS = {...}dictionary prepended to codecustomDisplayNameshows your operator name instead of "Python UDF"🎬 Demo Walkthrough
📸 Screenshots
🏗️ Architecture
🔒 Zero modifications to Texera's core engine
✅ Testing
💡 Why This Matters
Every data science platform has built-in operators. Almost none let users create their own without touching the engine internals. This turns every lab's common Python functions into first-class, drag-and-drop, shareable operators — with zero infrastructure changes.