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:
2026-11-11 10:30:37 +00:00
parent 16643b9f1b
commit bd07abcde8
19 changed files with 1448 additions and 16 deletions
+7 -1
View File
@@ -402,8 +402,14 @@ func (a App) Run(ctx context.Context, args []string) error {
return err
}
generator = &stage.PiClient{Executable: profile.Executable, Directory: cwd, Tools: []string{}, OnOwnership: func(id, reference string, active bool) error { session = id; return nil }}
case stage.ClaudeBackend:
cwd, err := os.Getwd()
if err != nil {
return err
}
generator = &stage.ClaudeStageClient{Directory: cwd, Tools: []string{}, OnOwnership: func(id, reference string, active bool) error { session = id; return nil }}
default:
return fmt.Errorf("provider-check harness must be opencode or pi")
return fmt.Errorf("provider-check harness must be opencode, pi or claude")
}
text, err := generator.Generate(check, stage.ModelConfig{Harness: o.harness, Provider: provider, Model: model}, "Provider connection validation only. Do not use tools. Reply with exactly PIPELINES_PROVIDER_OK.")
if err == nil && strings.TrimSpace(text) != "PIPELINES_PROVIDER_OK" {