{"record":{"id":"59c0ff7e9e14cbee","repo":"deepseek-ai/deepseek-harness","slug":"terminal-bash-sandbox-mode-policy-mode-requi","errorCode":null,"errorMessage":"terminal-bash: sandbox mode \"${policy.mode}\" requires a ctx.sandbox provider in the execution world","messagePattern":"terminal-bash: sandbox mode \"(.+?)\" requires a ctx\\.sandbox provider in the execution world","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/terminal/terminal-bash/src/index.ts","lineNumber":97,"sourceCode":"    BASH_SILENCE_DEPRECATION_WARNING: '1',\n  }\n}\n\n/**\n * The pwsh prompt function that emits the shared OSC `133;D;` + BEL marker\n * before every prompt, mirroring bash's PROMPT_COMMAND. `[char]27`/`[char]7`\n * build the control bytes at runtime because raw ESC characters in submitted\n * input are unreliable under PSReadLine.\n */\nexport const PWSH_PROMPT_SETUP =\n  \"function prompt { [Console]::Write([char]27 + ']133;D;' + [int]$LASTEXITCODE + [char]7); '\" + CONTROLLED_PROMPT + \"' }\"\n\nfunction spawnArgv(ctx: Context, config: ResolvedConfig, policy: SandboxExecutionPolicy): string[] {\n  const argv = [config.shellPath, ...config.shellArgs]\n  if (policy.mode === 'danger-full-access') return argv\n  const sandbox = ctx.get('sandbox')\n  if (sandbox === undefined) {\n    throw new Error(`terminal-bash: sandbox mode \"${policy.mode}\" requires a ctx.sandbox provider in the execution world`)\n  }\n  // Re-state the discriminant because object spread does not preserve its narrowed type.\n  return sandbox.confine(argv, { ...policy, mode: policy.mode }).argv\n}\n\n// TODO(pty-initialize-race-home): Fold this outer abort race into\n// LocalPtySession.initialize when the send-state consolidation lands; the\n// session already owns the send lifecycle the race protects.\nasync function startupSession(\n  session: LocalPtySession,\n  dialect: ShellDialect,\n  signal?: AbortSignal,\n): Promise<void> {\n  const start = async (): Promise<void> => {\n    if (dialect === 'bash') {\n      await session.initialize(signal)\n      return\n    }","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/terminal/terminal-bash/src/index.ts#L79-L115","documentation":"Error \"terminal-bash: sandbox mode \"${policy.mode}\" requires a ctx.sandbox provider in the execution world\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/terminal/terminal-bash/src/index.ts:97 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Compose a ctx.sandbox provider in the execution world, or use an unsandboxed mode."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}