{"record":{"id":"27d6b60b0defb5c5","repo":"deepseek-ai/deepseek-harness","slug":"sandbox-escalation-to-mode-is-not-strictly-wi","errorCode":null,"errorMessage":"sandbox escalation to \"${mode}\" is not strictly wider than this call's current \"${effectiveMode}\" mode","messagePattern":"sandbox escalation to \"(.+?)\" is not strictly wider than this call's current \"(.+?)\" mode","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/sandbox/sandbox/src/escalation.ts","lineNumber":163,"sourceCode":" * widening against the call's effective mode, then resolve the approval\n * channel, then map every outcome — the ordered fail-closed sequence both\n * enforcing families share. Returns the granted mode to stamp onto exactly\n * this call; throws the distinct verbatim text for every other path (a\n * non-widening request, a missing approval service, an agent-less execution,\n * a rejection, a cancellation, an unanswerable ask) — the tool registry turns\n * the throw into the call's isError result, and nothing has run. A\n * non-widening request never prompts a human.\n * @param request - the escalation to judge (see {@link EscalationRequest}).\n * @param approval - the approval ingredients the tool holds (see {@link EscalationApproval}).\n * @returns the granted mode, consumed by the one call that asked.\n */\nexport async function approveEscalation<A, C>(request: EscalationRequest, approval: EscalationApproval<A, C>): Promise<SandboxMode> {\n  const { requestedMode: mode, effectiveMode, justification, subject } = request\n  // Strict widening is an EXECUTION check against the call's effective mode —\n  // deliberately not a schema constraint (the enum is the closed target\n  // vocabulary; the effective mode is per-call truth).\n  if (!(WIDER_MODES[effectiveMode] ?? []).includes(mode as SandboxMode)) {\n    throw new Error(`sandbox escalation to \"${mode}\" is not strictly wider than this call's current \"${effectiveMode}\" mode`)\n  }\n  if (approval.approver === undefined) {\n    throw new Error(`sandbox escalation to \"${mode}\" requires approval, but no approval service is composed`)\n  }\n  if (approval.agent === undefined) {\n    throw new Error(`sandbox escalation to \"${mode}\" requires approval, but the call has no agent to route it through`)\n  }\n  // Self-contained for the audit trail: approval/asked stores this reason,\n  // and the target mode is part of the grant's identity.\n  const outcome = await approval.approver.request({\n    agent: approval.agent,\n    toolName: approval.toolName,\n    callId: approval.callId,\n    reason: `escalate sandbox to ${mode}: ${justification}`,\n    ...approval.signal ? { signal: approval.signal } : {},\n  })\n  switch (outcome) {\n    // The schema enum already pinned `mode` to the closed target vocabulary;","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/sandbox/sandbox/src/escalation.ts#L145-L181","documentation":"Error \"sandbox escalation to \"${mode}\" is not strictly wider than this call's current \"${effectiveMode}\" mode\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/sandbox/sandbox/src/escalation.ts:163 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Request a mode strictly wider than the current effective mode, or drop the escalation if the current mode already suffices."],"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"}