feat(frontend): show node output reference hint in config modal#23
Open
LukasHirt wants to merge 2 commits into
Open
feat(frontend): show node output reference hint in config modal#23LukasHirt wants to merge 2 commits into
LukasHirt wants to merge 2 commits into
Conversation
mzner
previously approved these changes
Jul 24, 2026
Action nodes (tag/comment/move/copy/rename/notify) already recorded their
result on the NodeResult execution record, but never wrote it into the
shared vars map that {{...}} template rendering reads from — unlike LLM
nodes, whose output is wired in via vars["llm.output"]. That meant an
action's result was, in practice, never referenceable from a downstream
node's template, even though nothing in the code or UI signaled that.
Mirror the llm.output pattern by writing each action's result into vars
under "<actionType>.output" (tag.output, comment.output, move.output,
copy.output, rename.output, notify.output) right where result.Output is
already set. This makes the upcoming frontend output hint truthful
instead of aspirational.
Signed-off-by: Lukas Hirt <info@hirt.cz>
Users configuring a node had no reliable way to learn the exact {{...}}
syntax needed to reference its output from a downstream node — only a
couple of fields carried it as scattered placeholder text.
Add a persistent "Output" section to NodeDetailsPanel.vue, shown for
every node type, that states the verified-correct template token(s):
- llm node: {{llm.output}}
- action nodes: {{tag.output}}, {{comment.output}}, {{move.output}},
{{copy.output}}, {{rename.output}}, {{notify.output}} — matching the
vars keys the executor now writes (see the paired backend commit)
- trigger node: {{file.name}} / {{file.content}}, available whenever
the run targets a specific file
The WorkflowNodeData.outputVariable field was checked and confirmed to
have no effect on runtime behavior (backend/pkg/executor/executor.go
hardcodes the "llm.output" key regardless of it), so the LLM hint
intentionally does not offer a "customized" variant of the token.
Adds a Vitest component-mount test for NodeDetailsPanel.vue (the first
of its kind in this package) covering LLM, action, and trigger nodes.
Signed-off-by: Lukas Hirt <info@hirt.cz>
LukasHirt
force-pushed
the
feat/node-output-reference-hint
branch
from
July 24, 2026 20:50
de4c87c to
bcc04fc
Compare
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.
Summary
Users configuring any node in the workflow canvas had no reliable way to learn the exact
{{...}}template syntax needed to reference that node's output from a downstream node. The only hints were scattered placeholder strings on a couple of specific fields (LLM prompt/comment/message), not a consistent, always-visible piece of UI, and their accuracy had never been verified against the executor.Investigation (executor.go ground truth)
Read
backend/pkg/executor/executor.goin full. Findings:runLLM()writesvars["llm.output"] = output(line 172) and setsresult.Outputon theNodeResult. So{{llm.output}}genuinely works today. Confirmed by the pre-existingTestRunTriggerLLMActiontest, which already asserts a downstream action node receives the rendered{{llm.output}}.runAction()setresult.Outputon the execution-result record, but none of them wrote anything into the sharedvarsmap. I proved this with a new failing test (TestActionOutputIsReferenceableDownstream, added first per TDD) that chains atagaction into acommentaction referencing{{tag.output}}— before the fix, the comment literally contained the unexpanded string{{tag.output}}. So action outputs were not referenceable at all prior to this PR, despiteresult.Outputexisting — a real trap for anyone assuming otherwise.WorkflowNodeData.outputVariable(frontend/src/types/workflow.ts): grepped the whole repo — it's declared on the type but never read anywhere, frontend or backend.runLLM()unconditionally uses the literal key"llm.output"regardless of this field. It currently has zero effect on runtime behavior, so the new hint intentionally does not offer a "customized variable name" variant — that would have been fictional.file.name/file.contentare populated intovarsonce per run whenever aresourcePathis supplied (line 66-76), independent of trigger type. This is meaningfully "the trigger's output" and is surfaced the same way.Changes
Backend (
backend/pkg/executor/executor.go) — small, scoped fix so the new UI hint is true rather than aspirational: each action case now also writes its result intovarsunder"<actionType>.output"(tag.output,comment.output,move.output,copy.output,rename.output,notify.output), mirroring the existingllm.outputconvention (a single global key per node-kind, not per node-id — same characteristic the existingllm.outputkey already has). AddedTestActionOutputIsReferenceableDownstreamcovering this end-to-end through a chained tag → comment workflow.Frontend (
frontend/src/components/NodeDetailsPanel.vue) — added a persistent "Output" section, shown for every node type, stating only verified-correct tokens:{{llm.output}}{{tag.output}}, comment:{{comment.output}}, move:{{move.output}}, copy:{{copy.output}}, rename:{{rename.output}}, notify:{{notify.output}}{{file.name}},{{file.content}}Added
frontend/tests/unit/NodeDetailsPanel.spec.ts— the first component-mount test in this package, using@vue/test-utils+createGettext()(real gettext plugin, sinceuseGettext()throws without it) withoc-icon/oc-button/oc-text-inputstubbed (host-shell design-system components unavailable in unit tests). Covers LLM, tag/move/notify action nodes, and a trigger node.Both new tests were written first, confirmed to fail for the right reason (fictional/missing wiring), then made to pass.
Test plan
cd backend && go test ./...— all packages pass, including newTestActionOutputIsReferenceableDownstreamcd backend && go vet ./...— cleancd frontend && npm run test:unit— 3 files / 9 tests passcd frontend && npm run check:types— cleancd frontend && npm run lint— cleanScope note: did not touch node categorization, the "+" button, node positioning, the OK button, or auto-open-on-add behavior — kept strictly to the output-hint concern.