namzu.aidocs

Run Configuration

Required and optional runtime config for Namzu agents, including model, limits, permissions, environment, and working directory.

This page explains the runtime config you pass into agents such as ReactiveAgent. The goal is not only to list fields, but to make it clear which fields are required, which are policy, and which affect runtime behavior versus tool execution.

1. Two Inputs Go Into a Run

Every run has two distinct inputs:

Input objectOwns
AgentInputmessages, working directory, abort signal, task store, runtime tool overrides
ReactiveAgentConfigprovider, tools, model, budgets, IDs, persona, skills, advisory config

This distinction matters because the SDK separates per-invocation message state from runtime policy and dependencies.

It also matters because some low-level runtime fields are intentionally not exposed on ReactiveAgentConfig today. If you need verificationGate, sandboxProvider, pluginManager, taskRouter, agentBus, or compactionConfig, use Low-Level Runtime.

2. Minimal ReactiveAgent.run() Shape

// Assume `provider`, `tools`, `projectId`, `sessionId`, and `tenantId`
// have already been prepared by your app-level runtime bootstrap.
const result = await agent.run(
  {
    messages: [{ role: 'user', content: 'Hello' }],
    workingDirectory: process.cwd(),
  },
  {
    provider,
    tools,
    model: 'gpt-4o-mini',
    tokenBudget: 8_192,
    timeoutMs: 60_000,
    projectId,
    sessionId,
    tenantId,
  },
)

At minimum, a practical run needs:

  • provider
  • tools
  • model
  • tokenBudget
  • timeoutMs
  • projectId
  • sessionId
  • tenantId
  • messages
  • workingDirectory

3. Core Runtime Fields

FieldRequired in practiceWhat it controls
providerYesLLM backend implementation
toolsYesTool registry the runtime can expose and execute
modelYesModel identifier used for provider calls
tokenBudgetYesMaximum token budget for the run
timeoutMsYesWall-clock timeout for the run
projectIdYesLong-lived project scope
sessionIdYesImmediate session scope
tenantIdYesIsolation boundary
workingDirectoryYesFilesystem root for built-in tool behavior
messagesYesConversation input for the run

4. Limit and Budget Fields

FieldPurpose
maxIterationsHard stop on iteration count
maxResponseTokensOutput-size guard for model responses
costLimitUsdCost budget guard when pricing is available
temperatureModel creativity or variance control

These settings shape the runtime loop, not only the provider call.

5. Permission and Environment Fields

FieldPurpose
permissionModeTool-permission mode: auto or plan
envEnvironment variables exposed to tools and sandboxed commands

permissionMode is especially important:

  • auto is the normal runtime mode
  • plan blocks non-read-only tools at execution time in the tool registry

env is useful when tools need controlled environment data such as:

  • API base URLs
  • feature flags
  • CLI-specific runtime variables

6. Prompt and Behavior Fields

ReactiveAgentConfig also supports higher-level prompt and reasoning inputs:

FieldPurpose
systemPromptDirect system-level instructions
basePromptBase prompt segment
personaStructured prompt identity
skillsStructured skill bundle list
advisoryAdvisor configuration

These fields change how the runtime assembles prompt context before it calls the provider.

7. Hierarchy and Advanced Fields

FieldPurpose
parentRunIdLinks a child run back to its parent
depthTracks hierarchy depth in parent/child agent trees
contextLevelSignals how much context should be carried
invocationStateShared invocation state passed through hierarchies

These are more relevant for supervisors, orchestration layers, or manager-driven spawning than for the first quickstart.

8. AgentInput Fields

AgentInput includes these runtime-time fields:

FieldPurpose
messagesInput conversation
workingDirectoryBase directory for filesystem-oriented tools
signalAbort signal for cancellation
taskStoreOptional task persistence surface
runtimeToolOverridesPer-run tool availability overrides

workingDirectory affects several built-in tools directly:

  • read_file
  • write_file
  • edit
  • ls
  • glob
  • grep
  • bash

9. Runtime Defaults at the SDK Level

The SDK also exports RuntimeConfigSchema and RUNTIME_DEFAULTS for higher-level application config assembly.

Important defaults include:

FieldDefault
modelqwen/qwen3.6-plus:free
temperature0.3
tokenBudget100_000
maxResponseTokens8192
timeoutMs600_000
maxIterations200

Those defaults are useful for application-level config objects, but most production apps should still set explicit values for the runs they actually care about.

Use one app-level runtime config object and derive agent configs from it:

import {
  RUNTIME_DEFAULTS,
  generateProjectId,
  generateSessionId,
  generateTenantId,
} from '@namzu/sdk'
 
const runtime = {
  ...RUNTIME_DEFAULTS,
  model: 'gpt-4o-mini',
  tokenBudget: 16_384,
  timeoutMs: 120_000,
}
 
// Assume `provider` and `tools` were created during runtime bootstrap.
const agentConfig = {
  provider,
  tools,
  model: runtime.model,
  tokenBudget: runtime.tokenBudget,
  timeoutMs: runtime.timeoutMs,
  maxIterations: runtime.maxIterations,
  temperature: runtime.temperature,
  projectId: generateProjectId(),
  sessionId: generateSessionId(),
  tenantId: generateTenantId(),
}

11. Common Mistakes

MistakeConsequence
omitting workingDirectoryfilesystem tools have no stable base path
passing permissionMode: 'plan' unexpectedlymutating tools are blocked
keeping tokenBudget too low for tool-rich tasksearly stop or forced finalization
forgetting maxResponseTokens in provider-direct callslarge responses can be harder to control
mixing app config defaults and per-run overrides inconsistentlydebugging run behavior becomes harder