[hackathon] UDF Copilot: schema-aware AI in the Python UDF editor - #5081
[hackathon] UDF Copilot: schema-aware AI in the Python UDF editor#5081mengw15 wants to merge 3 commits into
Conversation
Restores gui.conf, llm.conf, storage.conf, udf.conf, user-system.conf, and docker-compose.yml to upstream defaults. The leaked values (LiteLLM master key, local DB credentials, Google OAuth client ID, host paths) were introduced in 0d9a128 ("init"). Local overrides should be supplied via the existing `${?VAR_NAME}` environment indirection in each .conf file instead. Note: the secret in the prior commit remains in git history. The LiteLLM key must be rotated independently. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Thank you for participating in the hackathon. We really enjoyed your idea and appreciate the contribution. We are now archiving hackathon submissions by closing the submission PRs. However, we strongly encourage you to continue developing your idea and explore the possibility of merging it into the main branch. To move forward, please:
Thanks again for your participation and contribution! |
|
@mengw15 how likely can we merge this into main? |
sorry I missed this earlier. I'm revisiting the project now and plan to open a discussion on it. The feature is fairly independent, and it can splits into several parts — I think a number of them can go into main. I haven't gone through the implementation in detail yet, but since the changes are mostly additive, I don't think merging will be a big problem. |
Demo
Screen.Recording.2026-05-15.at.4.48.45.PM.mov
The problem
Open a Python UDF in Texera today and the editor greets you with an empty file. You don't know what's in
tuple_. You don't know which columns the upstream operator emits, what their types are, or what a sample row looks like. So you guess — writetuple_["name"], run, watch it crash onKeyError, flip back to the upstream operator's output tab to remind yourself of the real column name, edit, run, crash again on a type mismatch. When something does break at runtime, the traceback lands in a separate panel disconnected from the editor; you read it, decode it, fix by hand. And when your code starts producing a new column, you have to remember to also declare it in the operator's "Extra Output Columns" property — forget, and the execution fail.Summary
retainInputColumns).What's in this PR
registerInlineCompletionsProvider(ghost text + column dropdown),addAction(Cmd+K rewrite, Fix-with-AI),registerCodeActionProvider(Pyright lightbulb), side panel for chat./api/udf-copilot/:/complete,/chat,/rewrite,/fix,/sync-schema,/sample-capture,/sample-row. Diagnose-then-fix prompt with 3-way classification (UDF code error vs API-contract violation vs framework error). Output validation + one-shot retry for known anti-patterns (yield tuple_["x"]scalar yield,.items()on Tuple).amber/.../data_processor.py): captures the first input tuple per UDF and asynchronously POSTs to agent-service so the AI gets real data even for workflows where no operator is paginated.UdfCopilotService.requestFixAndOpen.Test plan
tuple_["— column-name dropdown appears with all upstream columnstuple_["a"] >— ghost text suggests a value-aware threshold based on the sample rowtuple_["foo"] = 1— yellow banner shows+ foo:integer; Sync writes to Extra Output Columns− foo(strikethrough); Sync removes from property paneloutputColumns+retainInputColumnstuple_.items()bug; in Console tab click red "Fix with AI" button next to the error title; editor auto-opens, Fix overlay pre-filled with traceback, AI rewrites toas_key_value_pairs()🤖 Generated with [Claude Code]