# Class LittleGhost::Harnesses::Request

Documentation version: Edge

Canonical HTML: https://littleghostai.org/docs/LittleGhost/Harnesses/Request.html

One unit of work for a harness: the task and the limits it runs under.

    LittleGhost::Harnesses::Request.new(
      prompt: "Add a test for the refund policy lookup.",
      cwd: "repository",
      budget_usd: 2,
      max_turns: 40,
      timeout: 900
    )

`cwd` is a Workspace path for the process's working directory. `session_id`
resumes an earlier session of the same harness. `model`, `effort` (a reasoning
effort level such as `medium`, for harnesses that support one), and
`instructions` (text added to the tool's system prompt, or placed before the
task when the tool has no such option) are optional. `add_dirs` lists extra
absolute directories a tool may read. `budget_usd` and `max_turns` bound the
work; `timeout` bounds wall-clock seconds. `environment` adds child-process
variables and takes precedence over harness defaults. `mcp_servers` maps a
server name to the HTTP URL of a Model Context Protocol server the tool may
call, such as a ToolServer behind a relay; without it the tool starts with no
MCP servers.

Values that reach the command line are checked so they cannot be read as
options.

## Inheritance

`LittleGhost::Harnesses::Request < Data.define(
      :prompt, :cwd, :session_id, :model, :effort, :instructions, :add_dirs, :budget_usd, :max_turns, :timeout,
      :environment, :mcp_servers
    )`

## Attributes

<a id="attribute-i-add_dirs"></a>
### `add_dirs` (R)

Frozen Array of extra absolute directories the harness may read.

<a id="attribute-i-budget_usd"></a>
### `budget_usd` (R)

Maximum spend in US dollars, or nil.

<a id="attribute-i-cwd"></a>
### `cwd` (R)

Workspace path used as the working directory, or nil for the root.

<a id="attribute-i-effort"></a>
### `effort` (R)

Reasoning effort level passed to the harness, or nil for its default.

<a id="attribute-i-environment"></a>
### `environment` (R)

Frozen Hash of additional child-process variables.

<a id="attribute-i-instructions"></a>
### `instructions` (R)

Additional instructions for the harness, or nil.

<a id="attribute-i-max_turns"></a>
### `max_turns` (R)

Maximum agent turns, or nil.

<a id="attribute-i-mcp_servers"></a>
### `mcp_servers` (R)

Frozen Hash of MCP server names to HTTP URLs.

<a id="attribute-i-model"></a>
### `model` (R)

Model name passed to the harness, or nil for its default.

<a id="attribute-i-prompt"></a>
### `prompt` (R)

The task given to the harness.

<a id="attribute-i-session_id"></a>
### `session_id` (R)

Harness session to resume, or nil to start a new one.

<a id="attribute-i-timeout"></a>
### `timeout` (R)

Wall-clock limit in seconds.

## Class methods

<a id="method-c-new"></a>
### `.new`

```ruby
.new(prompt:, cwd: nil, session_id: nil, model: nil, effort: nil, instructions: nil, add_dirs: [],
        budget_usd: nil, max_turns: nil, timeout: DEFAULT_TIMEOUT, environment: {}, mcp_servers: {})
```

Builds a validated request. Raises ArgumentError for invalid values.
