feat: add wac ai context for frontend chat#9021
Conversation
Deploying windmill with
|
| Latest commit: |
c38fca8
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://48b81205.windmill.pages.dev |
| Branch Preview URL: | https://workflow-code-frontend-conte.windmill.pages.dev |
bc8354e to
beacaf3
Compare
beacaf3 to
e9723d1
Compare
|
Claude finished @centdix's task in 4m 51s —— View job Review — PR #9021 (WAC AI context for frontend chat)Read SummaryThis PR makes the script-editor copilot (chat, inline chat, autocomplete) WAC-aware:
The plumbing is consistent end-to-end and the gate against flow-inline-script context leakage holds ( FindingsNo P0 / P1 issues found. P2 — WAC prompt drops the per-language context (
P2 — const workflowAsCode =
options?.workflowAsCode ??
(options?.lang ? false : (this.scriptEditorOptions?.workflowAsCode ?? false))
Nit — In AGENTS.md complianceNo violations spotted — the diff is mostly TS plumbing. No Test coverage
Manual verification still worth doing before merge: open a WAC TypeScript script in the script editor and confirm the chat system prompt picks up the WAC TS guide (and not the Python one) — easiest way is to open chat from a |
Codex ReviewFound 1 issue:
Test coverageFrontend: the PR adds focused unit tests for the prompt helper and WAC detection. I attempted to run them with Manual verification should cover opening a saved Bun or Python WAC script directly and from a flow script edit drawer, then sending a chat/autocomplete request. The observable result is that both paths include the WAC-specific prompt rather than the generic script prompt. |
Pi ReviewI've reviewed this PR (18 files, +202/−41) and found no P0 or P1 issues. The change correctly threads the P2 — Duplicated WAC language list across modules
These two locations independently enumerate the supported WAC languages (Bun TypeScript + Python). They serve different purposes (ScriptEditor guards whether to set the Test coverage
Manual verification suggested before merge
|
Summary
Add frontend AI context for Workflow-as-Code script editors so WAC TypeScript and Python editors receive the correct workflow-specific guidance instead of only the generic script prompt.
Changes
getWorkflowAsCodePrompthelper language-aware, selecting the TypeScript or Python WAC SDK context as appropriate.workflowAsCodeflag from the script editor through chat, inline chat, and autocomplete prompt construction.auto_kind, and existing WAC code detection while avoiding flow-inline script context leaks.Test plan
uv run --with pyyaml bash system_prompts/check-freshness.shcd frontend && npm run test:unit -- src/lib/components/copilot/chat/script/wacPrompt.test.tscd frontend && npm run check:fastcd frontend && npm run check(passes with existing unrelated warnings)Generated with Claude Code