# How to Enable the Resume System in Maka (MAKA_RUNTIME_SAFE_BOUNDARY_RESUME)

> Enable Maka's Safe Boundary Resume by setting MAKA_RUNTIME_SAFE_BOUNDARY_RESUME=1. Unlock the Desktop UI button, CLI /resume, and automatic crash recovery for a smoother development experience.

- Repository: [The Apache Software Foundation/maka](https://github.com/apache/maka)
- Tags: how-to-guide
- Published: 2026-08-26

---

**Set the environment variable `MAKA_RUNTIME_SAFE_BOUNDARY_RESUME` to `1` to activate Maka’s Safe Boundary Resume feature, which unlocks the Desktop UI button, CLI `/resume` command, and automatic crash recovery.**

Maka—Apache’s AI runtime—ships with its resume capability disabled by default to prevent accidental model invocations that consume tokens. To enable the resume system in Maka, developers must explicitly set a specific environment variable before starting the runtime.

## Why the Resume System Is Disabled by Default

Maka disables resume functionality by default as a **cost-control safeguard**. When active, the resume feature invokes the underlying model to reconstruct context and continue interrupted execution, which immediately consumes API tokens. Keeping it off ensures developers do not incur unexpected charges during testing or automated restarts.

## How to Enable Safe Boundary Resume

To enable the resume system in Maka, set the environment variable `MAKA_RUNTIME_SAFE_BOUNDARY_RESUME` to the string value `1`. The runtime host reads this variable during execution composition to determine whether to expose resume controls.

According to the source code in [`packages/runtime-host/src/server/execution-composition.ts`](https://github.com/apache/maka/blob/main/packages/runtime-host/src/server/execution-composition.ts), the check looks like this:

```typescript
// packages/runtime-host/src/server/execution-composition.ts
safeBoundaryResumeEnabled: process.env.MAKA_RUNTIME_SAFE_BOUNDARY_RESUME === '1',

```

When this evaluates to true, the host activates the Safe Boundary Resume path.

### Method 1: Temporary Export (Unix/macOS)

For one-off testing without persisting the setting, prefix your command:

```bash
MAKA_RUNTIME_SAFE_BOUNDARY_RESUME=1 maka run ...

```

### Method 2: Persist in a .env File

Maka uses `dotenv` to load environment variables from a `.env` file. Create or edit the file in your project root:

```dotenv

# .env

MAKA_RUNTIME_SAFE_BOUNDARY_RESUME=1

```

Then start the application normally:

```bash
maka start

```

### Method 3: Explicit CLI Resume

Even without the environment variable enabling automatic behavior, you can manually resume a crashed turn via the CLI:

```bash

# After a crash, manually resume the last turn

maka resume

```

## What Happens When You Enable Resume

Once `safeBoundaryResumeEnabled` is true, Maka exposes three resume mechanisms:

- **Desktop "Safe resume" UI button**: Appears in the Maka Desktop interface when an interrupted turn is detected.
- **CLI `/resume` command**: Enables the explicit resume subcommand for terminal-based workflows.
- **Automatic resume on startup**: The system attempts to recover and continue a crashed turn when the runtime initializes.

## Verifying Resume Is Active

To confirm the setting programmatically in Node.js, inspect `process.env` directly:

```javascript
if (process.env.MAKA_RUNTIME_SAFE_BOUNDARY_RESUME === '1') {
  console.log('Resume is enabled');
}

```

## Summary

- The resume system in Maka is disabled by default to avoid unintended token consumption.
- Set `MAKA_RUNTIME_SAFE_BOUNDARY_RESUME=1` to enable Safe Boundary Resume.
- The runtime checks this variable in [`packages/runtime-host/src/server/execution-composition.ts`](https://github.com/apache/maka/blob/main/packages/runtime-host/src/server/execution-composition.ts).
- When enabled, the feature exposes Desktop UI controls, CLI commands, and automatic crash recovery.
- Enabling resume causes the model to be invoked again, incurring token costs.

## Frequently Asked Questions

### Why is the Maka resume system disabled by default?

Maka disables resume by default to prevent accidental model calls that consume tokens and generate API costs. This safety-first approach ensures developers explicitly opt-in to the token usage associated with context reconstruction.

### What is the exact value needed for MAKA_RUNTIME_SAFE_BOUNDARY_RESUME?

The runtime strictly checks for the string `'1'`. Values like `true`, `yes`, or `1` (number) will not activate the feature; only `MAKA_RUNTIME_SAFE_BOUNDARY_RESUME=1` works as implemented in [`execution-composition.ts`](https://github.com/apache/maka/blob/main/execution-composition.ts).

### Where is the resume setting checked in the Apache Maka source code?

The setting is evaluated in [`packages/runtime-host/src/server/execution-composition.ts`](https://github.com/apache/maka/blob/main/packages/runtime-host/src/server/execution-composition.ts) where the `safeBoundaryResumeEnabled` property is set by comparing `process.env.MAKA_RUNTIME_SAFE_BOUNDARY_RESUME` against `'1'`.

### Does enabling resume increase token consumption?

Yes. Enabling `MAKA_RUNTIME_SAFE_BOUNDARY_RESUME` allows the runtime to invoke the model to reconstruct the state of interrupted turns, which consumes tokens and may incur costs depending on your API provider.