[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.
[Hackathon] feat: Custom Operator Builder — Create Reusable Operators from Code
The Story
Dr. Sarah's lab has a set of Python functions they use in every project — a BMI calculator, an outlier remover, a custom normalization method specific to their biomedical data. Every time they start a new workflow, someone has to open a Python UDF operator and re-type (or copy-paste) the same code. If someone improves the function, the other workflows don't get the update. There's no library, no reuse, no sharing.
What if they could save their code as a real operator — one that appears in the operator panel, ready to drag and drop, just like the built-in ones?
What We Built
A Custom Operator Builder that lets users create reusable operators from Python code. Write once, use everywhere.
My Operators Page
New sidebar entry under "Your Work" → "My Operators":
Full-Page Operator Editor
Split-screen editor like a real IDE:
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 (left side of workflow editor) under a "My Operators" category:
How It Works Under the Hood
Custom operators don't modify Texera's operator registry or engine. They're a smart wrapper around Python UDF:
PythonUDFV2nodePROPS = {...}dictionary prepended to the codecustomDisplayNameshows the operator's name instead of "Python UDF"This means zero engine changes, full compatibility with existing execution infrastructure.
Demo
Files Changed
New Components
dashboard/component/user/user-operator/user-operator.component.*— My Operators list/grid pagedashboard/component/user/user-operator/user-operator-editor.component.*— Full-page editor with Monacoworkspace/component/left-panel/operator-menu/custom-operator-label/custom-operator-label.component.*— Draggable label in operator panelNew Services
dashboard/service/user/custom-operator/custom-operator.service.ts— CRUD with localStorage persistencedashboard/service/user/custom-operator/custom-operator-factory.service.ts— Builds PythonUDFV2 predicate from saved configNew Types
dashboard/type/custom-operator.interface.ts— CustomOperator, ports, properties, code templateModified (additive only)
app-routing.module.ts— 3 new routes (list, create, edit)dashboard.component.html/ts— "My Operators" sidebar linkoperator-menu.component.*— "My Operators" collapse panel in workflow editordrag-drop.service.ts—dragStartedCustom()method for pre-built predicatesTesting