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:
@@ -165,3 +165,14 @@ func hasEnv(env []string, key string) bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// stageAuth resolves the sign-in for stage processes once, like a Chat's.
|
||||
var stageAuth authEnv
|
||||
|
||||
// StageEnv is the environment for a non-interactive CLI the server starts for a
|
||||
// pipeline stage: base (the run directory's environment) plus the same sign-in
|
||||
// fallbacks chats use (the private service token, then the login file) when
|
||||
// base itself chooses no account.
|
||||
func StageEnv(ctx context.Context, binary string, base []string) []string {
|
||||
return stageAuth.resolve(ctx, binary, withServiceToken(append([]string{}, base...)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user