---
url: 'https://adk.nht.io/api/batteries/sandbox/node/functions/resolveMaxDepthArgv.md'
---

# Function: resolveMaxDepthArgv()

```ts
function resolveMaxDepthArgv(maxDepth: number | undefined): readonly string[];
```

Defined in: [src/batteries/sandbox/node/search\_ripgrep.ts:96](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/sandbox/node/search_ripgrep.ts#L96)

Emit `--max-depth N` only when a depth was EXPLICITLY requested.

## Parameters

| Parameter  | Type                    | Description                                        |
| ---------- | ----------------------- | -------------------------------------------------- |
| `maxDepth` | `number` | `undefined` | The requested depth, or `undefined` for unbounded. |

## Returns

readonly `string`\[]

The flag pair, or an empty array when unbounded.

## Remarks

Issue #48: the adapter emitted this flag unconditionally, so omitting `maxDepth` produced the
literal argv `--max-depth undefined`, rg exited 2, and every omitted-depth search failed. Omission
now means unbounded — rg's own behaviour — and the flag is simply not emitted.
