MCPcopy Create free account
hub / github.com/Facets-cloud/flow / harnessForSpawn

Function harnessForSpawn

internal/app/harness.go:114–122  ·  view source on GitHub ↗

harnessForSpawn returns the harness to use when bootstrapping a new session for a task: 1. If the task already has a harness set, look it up by name — unknown names error out so we don't silently spawn the wrong adapter for a pinned task. 2. Otherwise, detect ambient — the harness running THIS `flo

(task *flowdb.Task)

Source from the content-addressed store, hash-verified

112// with the session_id write (guarded by a COALESCE clause so an
113// existing pin isn't overwritten), so step 1 dominates on every
114// subsequent invocation.
115func harnessForSpawn(task *flowdb.Task) (harness.Harness, error) {
116 if task != nil && task.Harness.Valid && task.Harness.String != "" {
117 return harnessByName(task.Harness.String)
118 }
119 if h := ambientHarness(); h != nil {
120 return h, nil
121 }
122 return claude.New(), nil
123}
124
125// defaultHarness returns the adapter for code paths that have no

Callers 3

cmdDoFunction · 0.85
cmdAutoExecFunction · 0.85

Calls 3

NewFunction · 0.92
harnessByNameFunction · 0.85
ambientHarnessFunction · 0.85