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

Function harnessForTask

internal/app/harness.go:70–79  ·  view source on GitHub ↗

harnessForTask returns the adapter for the task's stored harness. NULL/empty harness column → claude+nil (back-compat). Unknown non-empty name → nil+error. Callers that can tolerate the error (e.g. list.go's per-row [live] marker) should skip the operation; callers that can't (cmdTranscript, cmdDo's

(task *flowdb.Task)

Source from the content-addressed store, hash-verified

68// callers that can't (cmdTranscript, cmdDo's resume path) should
69// surface the error to the user and stop.
70func harnessForTask(task *flowdb.Task) (harness.Harness, error) {
71 if task == nil {
72 return claude.New(), nil
73 }
74 var name string
75 if task.Harness.Valid {
76 name = task.Harness.String
77 }
78 return harnessByName(name)
79}
80
81// ambientHarness probes the current process env for each known
82// harness's session-id env var. Returns the matching adapter if

Callers 7

TestHarnessForTaskFunction · 0.85
liveSessionsForTasksFunction · 0.85
bgAgentStatusFunction · 0.85
cmdUpdateTaskFunction · 0.85
printTaskMetadataFunction · 0.85
cmdDoneFunction · 0.85
cmdTranscriptFunction · 0.85

Calls 2

NewFunction · 0.92
harnessByNameFunction · 0.85

Tested by 1

TestHarnessForTaskFunction · 0.68