Route a matched intent to its workflow after commands

Why: A hit intent should start the bound workflow, and a command that shares the same id still has to win.
Evidence: go test ./internal/intentgate/ ./internal/runmgr/ ./internal/server/ passed. Recognize keeps slots and the missing-slot question. StartWorkflowRun copies the definition and selects the workflow runner even when mock is on.
Impact: Ordinary turns are unchanged. The workflow runner body is still a stub until the executor lands.
Refs: feature/agent-harness-p4
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-01 16:04:49 +00:00
co-authored by Cursor
parent 63ea1a262c
commit ebeb6c599c
9 changed files with 408 additions and 33 deletions
+16
View File
@@ -77,6 +77,22 @@ func (r *Registry) Script(workflowID, path string) (string, bool) {
return body, ok
}
// SlotQuestion 是启动工作流时还没填上的必填槽位。
type SlotQuestion struct {
Key string
Question string
}
// Launch 是一次工作流 run 启动时的副本。之后插件卸载不能改到它。
type Launch struct {
Def core.WorkflowDef
Slots map[string]string
Missing []SlotQuestion
}
// Clone 拷贝定义,调用方之后的修改不影响副本。
func Clone(def core.WorkflowDef) core.WorkflowDef { return cloneDef(def) }
func cloneDef(def core.WorkflowDef) core.WorkflowDef {
raw, err := json.Marshal(def)
if err != nil {