feat(dashboard): /config Prompt section — template editor + live preview #477
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!477
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev/458"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds the Prompt section editor to the
/configform for each agent type.Test plan
/config, select any agent type, click the Prompt tab${var}chips insert at cursor (mousedown preserves caret)${nope}→ warning chip appears; known vars are cleanbun x vitest run→ 562 tests passCloses #458
Two Harness components inferred { system_prompt_template: string } (required) instead of AgentTypeConfig (where the field is optional), making the inferred Dispatch incompatible with the onTypeConfigChange prop type. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>behavior
apps/web/src/lib/prompt.ts—detectUnknownVarsscans the raw template string, so any template using${if:parent_pr}…${endif}conditional syntax always emits a spurious${endif}warning chip.parent_pr(the stacked-PR var) is the obvious candidate for a conditional wrapper, so this will fire on real production templates.The test at line 61 acknowledges it but doesn't assert
endifis absent — the comment says "users shouldn't write bare${endif}" while${if:…}${endif}is valid and expected syntax.Fix: strip conditional blocks before scanning, mirroring the first pass of
interpolatePromptTemplate:Update the
"ignores conditional keywords"test to assertexpect(unknowns).not.toContain("endif")after the fix.Mirrors interpolatePromptTemplate pass 1: strip \${if:NAME}…\${endif} blocks before scanning for unknown tokens, so production templates with conditional wrappers no longer emit false-positive warning chips. Update the "ignores conditional keywords" test to assert \`endif\` is absent; add a companion test that verifies unknowns outside the block are still caught. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>Fixed in latest commit.
detectUnknownVarsnow strips${if:NAME}…${endif}blocks before scanning (mirrorsinterpolatePromptTemplatepass 1), so${endif}and vars inside conditional blocks are never flagged as unknown. Updated the test to assertnot.toContain("endif"); added a companion case verifying unknowns outside blocks are still caught. All 12 tests pass.38b02a677efd5635eba2detectUnknownVarsnow correctly strips conditional blocks before scanning —${endif}no longer surfaces as a spurious warning. Test coverage is thorough. CI green.