Run pipeline stages on Claude Code (harness=claude)
A model stage with harness=claude, provider=anthropic and a Claude model id runs one claude -p process per visit with the server user's Claude sign-in. Only the declared tools exist (--tools) and nothing else is approved (--permission-mode dontAsk); edits are approved only below the run directory and the stage's artifacts directory. A permissions block, run write paths, delivery=true and reasoning_effort none/minimal are refused, not widened. Usage comes from the CLI's final result and counts toward budgets. Failures are fixed text; billing, quota and rate-limit refusals map to ErrProviderQuota. The redacted stream is the session export and evidence. provider-check --harness claude and model overrides are covered.
This commit is contained in:
+17
-2
@@ -91,8 +91,8 @@ func (ModelStage) Spec(def Definition) (ModelSpec, error) {
|
||||
if backend == "" {
|
||||
backend = "opencode"
|
||||
}
|
||||
if backend != "opencode" && backend != "pi" {
|
||||
return ModelSpec{}, fmt.Errorf("harness must be opencode or pi")
|
||||
if backend != "opencode" && backend != "pi" && backend != ClaudeBackend {
|
||||
return ModelSpec{}, fmt.Errorf("harness must be opencode, pi or claude")
|
||||
}
|
||||
effort, err := normalizeReasoningEffort(def.Configs["reasoning_effort"])
|
||||
if err != nil {
|
||||
@@ -118,6 +118,21 @@ func (ModelStage) Spec(def Definition) (ModelSpec, error) {
|
||||
return ModelSpec{}, err
|
||||
}
|
||||
}
|
||||
if backend == ClaudeBackend {
|
||||
if def.Configs["provider"] != ClaudeProvider {
|
||||
return ModelSpec{}, fmt.Errorf("the claude harness needs provider=%s", ClaudeProvider)
|
||||
}
|
||||
tools, _, _ := ToolNames(def)
|
||||
if _, err := claudeTools(tools); err != nil {
|
||||
return ModelSpec{}, err
|
||||
}
|
||||
if _, present := def.Blocks["permissions"]; present {
|
||||
return ModelSpec{}, fmt.Errorf("the claude harness cannot enforce a permissions block; use the opencode harness for this stage")
|
||||
}
|
||||
if effort == "none" || effort == "minimal" {
|
||||
return ModelSpec{}, fmt.Errorf("the claude harness supports reasoning_effort low, medium, high, xhigh or max")
|
||||
}
|
||||
}
|
||||
retries := DefaultRetries
|
||||
if value := def.Configs["retries"]; value != "" {
|
||||
retries, err = strconv.Atoi(value)
|
||||
|
||||
Reference in New Issue
Block a user