feat(workflow): block publish on fixed-mode template + config-lockable arg mode#599
Merged
Conversation
…e arg mode
Two related arg_modes improvements for the workflow editor:
1. Fixed-mode + {{...}} now blocks publish. A field pinned to mode=fixed
whose value contains a Go template silently never renders, shipping a
broken URL/body/prompt. parse.Validate now emits this as an Error
(was a Warning), so it gates publish across every path -- UI form, MCP
workflow_publish, and helpers -- while draft SaveDraft (no Validate)
stays editable. The editor also auto-switches a fixed field to
expression the moment you type {{, so the common case never trips it.
2. New wick:"mode=fixed|expression" config tag. Schema-driven connector
and channel op args now render the Fixed/Expression toggle on every
field kind (default fixed). A mode= tag greys the toggle out and locks
it to that mode; the chosen mode still persists to arg_modes.
Surfaces it end to end: entity.Config.Mode reflected from the tag,
exposed in args_schema, honored by SchemaForm/Field/ArgField.
Document the publish-blocker for fixed-mode fields with {{...}} templates,
the auto-switch-to-expression UX on canvas, and the new wick:"mode=fixed|expression"
config tag that locks the Fixed/Expression toggle in the workflow inspector.
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.
What
Two related
arg_modesimprovements for the workflow editor.1. Fixed-mode +
{{...}}blocks publishA field pinned to
mode=fixedwhose value contains a Go template silently never renders — it ships a broken URL / body / prompt to production.parse.Validatenow emits this as an Error (was a Warning), so it gates publish across every path that promotes a draft:validationErrorCount)workflow_publish(service.Publish→parse.Validate)Draft
SaveDraftdoes not runValidate, so editing is never blocked. The editor also auto-switches a fixed field toexpressionthe moment you type{{, so the common case never trips the gate.2. New
wick:"mode=fixed|expression"config tagSchema-driven connector / channel op args (e.g.
push_id,title,body) now render the Fixed ⇄ Expression toggle on every field kind (default fixed). Amode=tag greys the toggle out and locks it to that mode; the chosen mode still persists toarg_modes.mode=fixedmode=expressionHow
entity.Config.Modereflected from themode=tag (normalizeModeaccepts onlyfixed/expression), exposed inargs_schema.SchemaForm/Field/ArgFieldhonormode+lockedMode; toggle now renders for all kinds (checkbox swaps to a text input in expression mode).parse.validateArgModesreturns Errors instead of Warnings.Behavior
{{}}{{auto-flips to expressionworkflow_publishTests
pkg/entity(mode tag),parse(argmodes block/allow), connectors, tools/agents — all green.npm run check(tsc + vite build) passes.Notes
Pre-existing, out of scope: engine treats an absent
arg_modeskey as expression while the UI defaults to fixed;arg_modesis only written on toggle click. Same as every existing node field (url/body/prompt) — not a regression here. Can auto-seedarg_modes[key]="fixed"on first value change as a follow-up if desired.