Pipeline runs use the workspace's directory environment

Resolve the run workspace's environment with workenv (direnv, parent
.envrc, mise; same account rule as Claude chats) at run start and resume,
and apply it to Pi stage processes, a per-environment Pipelines-owned
OpenCode stage service (keyed by a hash of the change, reused across runs,
idle ones stopped after PIPELINES_OPENCODE_STAGE_IDLE_TIMEOUT, revived per
registration), delivery-gate checks and merges, plain-stage opencode CLI
calls and file-change capture git reads. Record the directory, .envrc
files, sources and variable names (never values) on the run detail; a
blocked .envrc becomes a run warning.
This commit is contained in:
2026-11-04 18:08:42 +00:00
parent e0d7b720f5
commit cedfc22e45
26 changed files with 1173 additions and 84 deletions
+22
View File
@@ -519,6 +519,28 @@ type RunDetail struct {
// two apart and see which model was used.
TitleSource string `json:"title_source,omitempty"`
TitleModel string `json:"title_model,omitempty"`
// Environment records the workspace's own environment (direnv/mise) the
// run's stages, stage services and checks ran with: files and variable
// names only, never values. Absent for runs that predate it.
Environment *RunEnvironment `json:"environment,omitempty"`
}
// RunEnvironment is the directory environment a run resolved for its
// workspace. It never carries a variable's value.
type RunEnvironment struct {
Directory string `json:"directory"`
Files []string `json:"files,omitempty"`
Sources []string `json:"sources,omitempty"`
Set []string `json:"set,omitempty"`
Unset []string `json:"unset,omitempty"`
// Dropped are inherited server credentials removed because the directory
// chooses the Claude account (for example it sets CLAUDE_CONFIG_DIR).
Dropped []string `json:"dropped,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// ServiceKey names the OpenCode stage service environment; empty when the
// directory changes nothing.
ServiceKey string `json:"service_key,omitempty"`
ResolvedAt string `json:"resolved_at,omitempty"`
}
// RunNotificationReceipt records publisher attempts, not device reception.