fix(review): align runtime-context diagnostics and docs

This commit is contained in:
NI0317
2026-07-31 15:19:59 +08:00
parent 469dc8ffce
commit 1beb38554e
14 changed files with 39 additions and 24 deletions
+1
View File
@@ -74,6 +74,7 @@ function childEnvironment(spec: PtyBackendSpawnSpec): NodeJS.ProcessEnv {
function spawnArgv(ctx: Context, config: ResolvedConfig, policy: SandboxExecutionPolicy): string[] {
const argv = [config.shellPath, ...config.shellArgs]
if (policy.mode === 'danger-full-access') return argv
// Re-state the discriminant because object spread does not preserve its narrowed type.
return ctx.sandbox.confine(argv, { ...policy, mode: policy.mode }).argv
}