fix(sandbox): guard enable path and harden UI rendering performance (#341)

* fix(sandbox): guard enable path and harden UI rendering performance

* chore(deps): allow esbuild postinstall in pnpm onlyBuiltDependencies

* fix(sandbox): align availability reporting and address PR review feedback

* fix(sandbox): block planning without process attestation
This commit is contained in:
Chris Scott authored and GitHub committed 2026-08-27 08:58:23 -04:00
1 parent ba8e8f4b29
commit d63198ec8a
19 files changed
+501 -82

No files matched your search

+9 -2
View File
@@ -7,6 +7,7 @@ import { mkdirSafe } from '../../utils/fs-safe'
import { logger } from '../../utils/logger'
import { SettingsService } from '../settings'
import { CredentialProvider } from '../credential-provider'
import { getProcessIdentityAttestationError } from '../opencode/process-identity'
import { detectSandboxCapability } from './capability'
import {
WORKSPACE_SANDBOX_NAME,
@@ -624,10 +625,12 @@ export class SandboxRuntimeService {
getStatus(): SandboxStatus {
const capability = detectSandboxCapability()
const attestationError = capability.available ? getProcessIdentityAttestationError() : null
const reason = capability.reason ?? attestationError
return {
available: capability.available,
available: capability.available && attestationError === null,
enabled: this.isEnabled(),
...(capability.reason !== undefined ? { reason: capability.reason } : {}),
...(reason !== null && reason !== undefined ? { reason } : {}),
...(capability.msbVersion !== undefined ? { msbVersion: capability.msbVersion } : {}),
}
}
@@ -640,6 +643,10 @@ export class SandboxRuntimeService {
if (!capability.available) {
return { mode: 'blocked', reason: capability.reason ?? 'Sandbox capability is unavailable' }
}
const attestationError = getProcessIdentityAttestationError()
if (attestationError !== null) {
return { mode: 'blocked', reason: attestationError }
}
const workDirectory = await resolveSandboxWorkDirectory(directory)
if (workDirectory === null) {
return {