Skip to main content
Glama

Delegate a contract to Reasonix

reasonix_delegate
Destructive

Delegate a user-approved task contract to an isolated edit worker with scoped write permissions and sandboxed execution, enabling safe code changes.

Instructions

After explicit user approval, delegate one immutable TaskContractV1 to an isolated Reasonix edit worker. For a trivial edit whose local context is already verified, do one focused preflight and delegate directly; do not browse docs or memory solely to construct the contract. write_scope is the exclusive write allowlist and already denies every other path. forbidden_scope is only for sensitive carve-outs inside broader write scopes; never use **/* or another catch-all that matches a concrete write_scope target. Default wait_mode=review holds this call until review, interaction, failure, or timeout; a wait timeout is recoverable and does not cancel the worker. New tasks default to worker_lane=fast (direct edits; no Goal, AutoResearch, review/task skills, or subagents); use worker_lane=deep only for explicitly long-horizon delivery/goal work. Select the lowest reasoning_effort adequate for the task (low is the lowest supported). Set execution_timeout_seconds proportionately (fast default 600, deep default 3600, maximum 14400); omitted resumes retain the stored deadline. Use background only when the caller intentionally wants asynchronous recovery flow. Contract verification and allowed_commands run as exact static argv with no shell: sh -c/bash -c/eval, pipes, redirection, and inline interpreters are rejected. For byte-exact file content, use file_assertions instead of shell comparison commands.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
resumeNo
task_idYes
base_refNo
contractYes
path_baseNoDefaults to cwd for new tasks; omitted legacy resumes preserve stored semantics.
wait_modeNoreview
worker_laneNoWorker execution lane. fast (default) is a direct-edit Reasonix session without Goal/AutoResearch/subagents; deep is an explicit long-horizon Goal session. Omitted resumes preserve the stored lane.
pause_revisionNo
reasoning_effortNoReasoning effort; low is the lowest supported value for new tasks.
pause_reason_hashNo
wait_timeout_secondsNo
execution_timeout_secondsNoTask execution deadline. New fast-lane tasks default to 600 seconds and deep-lane tasks to 3600 seconds; omitted resumes preserve the stored value. A wait timeout never cancels the worker.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
diffNo
phaseYes
risksNo
stateYes
usageNo
branchYes
reasonNo
summaryNo
task_idYes
worktreeYes
diff_statNo
timed_outNo
session_idNo
updated_atYes
commit_hashNo
worker_laneYes
changed_filesNo
contract_hashYes
repair_roundsYes
repository_idYes
pause_revisionNo
resume_requiredNo
review_revisionNo
inspect_requiredNo
review_tree_hashNo
source_collisionNo
pause_reason_hashNo
active_interactionNo
reasonix_work_modeNo
review_diff_sha256No
integration_commandNo
reasonix_session_modeNo
required_review_criteriaNo
execution_timeout_secondsYes
effective_reasoning_effortYes
requested_reasoning_effortYes
source_checkout_integratedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed57 schema fields changedv0.2.0-rc.4
    • addedInput schema / properties / contract / properties / allowed_commands
      Added value: +{
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "argv": {
      +        "items": {
      +          "maxLength": 4096,
      +          "type": "string"
      +        },
      +        "maxItems": 128,
      +        "minItems": 1,
      +        "type": "array"
      +      },
      +      "cwd": {
      +        "maxLength": 1024,
      +        "type": "string"
      +      },
      +      "id": {
      +        "$ref": "#/properties/contract/properties/acceptance_criteria/items/properties/id"
      +      },
      +      "timeout_seconds": {
      +        "maximum": 1800,
      +        "minimum": 1,
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "argv"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 256,
      +  "type": "array"
      +}
    • addedInput schema / properties / contract / properties / file_assertions
      Added value: +{
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "expected_utf8": {
      +        "maxLength": 65536,
      +        "type": "string"
      +      },
      +      "id": {
      +        "$ref": "#/properties/contract/properties/acceptance_criteria/items/properties/id"
      +      },
      +      "path": {
      +        "maxLength": 1024,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "proves": {
      +        "items": {
      +          "$ref": "#/properties/contract/properties/acceptance_criteria/items/properties/id"
      +        },
      +        "maxItems": 256,
      +        "minItems": 1,
      +        "type": "array"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "path",
      +      "expected_utf8",
      +      "proves"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 256,
      +  "type": "array"
      +}
    • addedInput schema / properties / contract / properties / forbidden_scope / default
      Added value: +[]
    • addedInput schema / properties / contract / properties / forbidden_scope / description
      Added value: +"Optional sensitive carve-outs inside broader write scopes; never use a catch-all pattern that matches a concrete write_scope target."
    • addedInput schema / properties / contract / properties / invariants / default
      Added value: +[]
    • addedInput schema / properties / contract / properties / non_goals / default
      Added value: +[]
    • addedInput schema / properties / contract / properties / pause_conditions / default
      Added value: +[]
    • addedInput schema / properties / contract / properties / verified_context / default
      Added value: +[]
    • addedInput schema / properties / contract / properties / write_scope / description
      Added value: +"Exclusive repository-relative write allowlist; every path not listed is already denied."
    • changedInput schema / properties / contract / required
      Previous value: -[
      -  "schema_version",
      -  "objective",
      -  "user_outcome",
      -  "verified_context",
      -  "write_scope",
      -  "forbidden_scope",
      -  "invariants",
      -  "non_goals",
      -  "acceptance_criteria",
      -  "verification",
      -  "pause_conditions"
      -]New value: +[
      +  "schema_version",
      +  "objective",
      +  "user_outcome",
      +  "write_scope",
      +  "acceptance_criteria",
      +  "verification"
      +]
    • addedInput schema / properties / execution_timeout_seconds
      Added value: +{
      +  "description": "Task execution deadline. New fast-lane tasks default to 600 seconds and deep-lane tasks to 3600 seconds; omitted resumes preserve the stored value. A wait timeout never cancels the worker.",
      +  "maximum": 14400,
      +  "minimum": 60,
      +  "type": "integer"
      +}
    • addedInput schema / properties / path_base
      Added value: +{
      +  "description": "Defaults to cwd for new tasks; omitted legacy resumes preserve stored semantics.",
      +  "enum": [
      +    "cwd",
      +    "repository"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / pause_reason_hash
      Added value: +{
      +  "pattern": "^[0-9a-f]{64}$",
      +  "type": "string"
      +}
    • addedInput schema / properties / pause_revision
      Added value: +{
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / reasoning_effort
      Added value: +{
      +  "description": "Reasoning effort; low is the lowest supported value for new tasks.",
      +  "enum": [
      +    "low",
      +    "medium",
      +    "high",
      +    "max"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / wait_mode
      Added value: +{
      +  "default": "review",
      +  "enum": [
      +    "review",
      +    "background"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / wait_timeout_seconds
      Added value: +{
      +  "default": 600,
      +  "maximum": 600,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / worker_lane
      Added value: +{
      +  "description": "Worker execution lane. fast (default) is a direct-edit Reasonix session without Goal/AutoResearch/subagents; deep is an explicit long-horizon Goal session. Omitted resumes preserve the stored lane.",
      +  "enum": [
      +    "fast",
      +    "deep"
      +  ],
      +  "type": "string"
      +}
    • changedOutput schema / additionalProperties
      Previous value: -trueNew value: +false
    • addedOutput schema / properties / active_interaction
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "createdAt": {
      +      "type": "string"
      +    },
      +    "id": {
      +      "type": "string"
      +    },
      +    "kind": {
      +      "enum": [
      +        "permission",
      +        "input"
      +      ],
      +      "type": "string"
      +    },
      +    "request": {
      +      "additionalProperties": {},
      +      "type": "object"
      +    },
      +    "resolvedAt": {
      +      "type": "string"
      +    },
      +    "response": {
      +      "additionalProperties": {},
      +      "type": "object"
      +    },
      +    "status": {
      +      "enum": [
      +        "pending",
      +        "resolved",
      +        "cancelled"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "id",
      +    "kind",
      +    "status",
      +    "createdAt",
      +    "request"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / branch
      Added value: +{
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedOutput schema / properties / changed_files
      Added value: +{
      +  "items": {
      +    "maxLength": 1024,
      +    "type": "string"
      +  },
      +  "maxItems": 256,
      +  "type": "array"
      +}
    • addedOutput schema / properties / commit_hash
      Added value: +{
      +  "pattern": "^[0-9a-f]{40,64}$",
      +  "type": "string"
      +}
    • addedOutput schema / properties / contract_hash
      Added value: +{
      +  "pattern": "^[0-9a-f]{64}$",
      +  "type": "string"
      +}
    • addedOutput schema / properties / diff
      Added value: +{
      +  "maxLength": 12288,
      +  "type": "string"
      +}
    • addedOutput schema / properties / diff_stat
      Added value: +{
      +  "maxLength": 4096,
      +  "type": "string"
      +}
    • addedOutput schema / properties / effective_reasoning_effort
      Added value: +{
      +  "enum": [
      +    "minimal",
      +    "low",
      +    "medium",
      +    "high",
      +    "max"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / execution_timeout_seconds
      Added value: +{
      +  "maximum": 14400,
      +  "minimum": 60,
      +  "type": "integer"
      +}
    • addedOutput schema / properties / inspect_required
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / integration_command
      Added value: +{
      +  "maxLength": 1024,
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedOutput schema / properties / pause_reason_hash
      Added value: +{
      +  "pattern": "^[0-9a-f]{64}$",
      +  "type": "string"
      +}
    • addedOutput schema / properties / pause_revision
      Added value: +{
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedOutput schema / properties / phase
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / reason
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / reasonix_session_mode
      Added value: +{
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedOutput schema / properties / reasonix_work_mode
      Added value: +{
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedOutput schema / properties / repair_rounds
      Added value: +{
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedOutput schema / properties / repository_id
      Added value: +{
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedOutput schema / properties / requested_reasoning_effort
      Added value: +{
      +  "enum": [
      +    "minimal",
      +    "low",
      +    "medium",
      +    "high",
      +    "max"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / required_review_criteria
      Added value: +{
      +  "items": {
      +    "maxLength": 64,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  "maxItems": 1000,
      +  "type": "array"
      +}
    • addedOutput schema / properties / resume_required
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / review_diff_sha256
      Added value: +{
      +  "pattern": "^[0-9a-f]{64}$",
      +  "type": "string"
      +}
    • addedOutput schema / properties / review_revision
      Added value: +{
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedOutput schema / properties / review_tree_hash
      Added value: +{
      +  "pattern": "^[0-9a-f]{40}$",
      +  "type": "string"
      +}
    • addedOutput schema / properties / risks
      Added value: +{
      +  "items": {
      +    "maxLength": 2048,
      +    "type": "string"
      +  },
      +  "maxItems": 128,
      +  "type": "array"
      +}
    • addedOutput schema / properties / session_id
      Added value: +{
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedOutput schema / properties / source_checkout_integrated
      Added value: +{
      +  "const": false,
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / source_collision
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "baseCommit": {
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "checkpoint": {
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "committedPaths": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "detectedAt": {
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "dirtyPaths": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "overlappingPaths": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "sourceHead": {
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "unavailable": {
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "checkpoint",
      +    "baseCommit",
      +    "dirtyPaths",
      +    "committedPaths",
      +    "overlappingPaths",
      +    "unavailable",
      +    "detectedAt"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / state
      Added value: +{
      +  "enum": [
      +    "provisioning",
      +    "running",
      +    "waiting_permission",
      +    "waiting_input",
      +    "paused",
      +    "review_required",
      +    "verifying",
      +    "completed",
      +    "commit_failed",
      +    "failed",
      +    "cancelled",
      +    "closed"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / summary
      Added value: +{
      +  "maxLength": 4096,
      +  "type": "string"
      +}
    • addedOutput schema / properties / task_id
      Added value: +{
      +  "maxLength": 64,
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedOutput schema / properties / timed_out
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / updated_at
      Added value: +{
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedOutput schema / properties / usage
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "cacheHitRatio": {
      +      "anyOf": [
      +        {
      +          "maximum": 1,
      +          "minimum": 0,
      +          "type": "number"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "cacheHitTokens": {
      +      "minimum": 0,
      +      "type": "number"
      +    },
      +    "cacheMissTokens": {
      +      "minimum": 0,
      +      "type": "number"
      +    },
      +    "completionTokens": {
      +      "minimum": 0,
      +      "type": "number"
      +    },
      +    "currency": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "estimatedCost": {
      +      "anyOf": [
      +        {
      +          "minimum": 0,
      +          "type": "number"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "promptTokens": {
      +      "minimum": 0,
      +      "type": "number"
      +    },
      +    "reasoningTokens": {
      +      "minimum": 0,
      +      "type": "number"
      +    },
      +    "usageSource": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "promptTokens",
      +    "completionTokens",
      +    "reasoningTokens",
      +    "cacheHitTokens",
      +    "cacheMissTokens",
      +    "cacheHitRatio",
      +    "estimatedCost",
      +    "currency",
      +    "usageSource"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / worker_lane
      Added value: +{
      +  "enum": [
      +    "fast",
      +    "deep"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / worktree
      Added value: +{
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedOutput schema / required
      Added value: +[
      +  "task_id",
      +  "state",
      +  "phase",
      +  "contract_hash",
      +  "repository_id",
      +  "branch",
      +  "worktree",
      +  "worker_lane",
      +  "requested_reasoning_effort",
      +  "effective_reasoning_effort",
      +  "execution_timeout_seconds",
      +  "source_checkout_integrated",
      +  "repair_rounds",
      +  "updated_at"
      +]
  2. Changed3 schema fields changedv0.1.1
    • removedInput schema / properties / contract / properties / verification / items / properties / argv / additionalItems
      Removed value: -{
      -  "maxLength": 4096,
      -  "type": "string"
      -}
    • changedInput schema / properties / contract / properties / verification / items / properties / argv / items
      Previous value: -[
      -  {
      -    "maxLength": 4096,
      -    "minLength": 1,
      -    "type": "string"
      -  }
      -]New value: +{
      +  "maxLength": 4096,
      +  "type": "string"
      +}
    • addedInput schema / properties / contract / properties / verification / items / properties / argv / maxItems
      Added value: +128
  3. First observedv0.1.0-rc.1

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description goes well beyond annotations by disclosing key behaviors: write_scope is an exclusive allowlist, forbidden_scope is only for sensitive carve-outs, commands are exact static argv with no shell/pipes/redirection, wait_timeout is recoverable and does not cancel the worker, and omitted resumes preserve stored settings. It also notes the requirement for 'explicit user approval,' which is critical context. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is dense and front-loaded with the core purpose, followed by practical operational rules. It is longer than ideal and runs as a single block of text, but every sentence adds substantive guidance—defaults, constraints, and security invariants—so the length is justified.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (12 parameters, nested contract object, multiple enums, output schema, annotations), the description covers the most decision-relevant aspects: task scoping, worker behavior, timeouts, resume semantics, and command execution security. It gives enough context for an agent to select and invoke the tool correctly without requiring external documentation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 33%, but the description compensates richly. It explains the semantics of write_scope and forbidden_scope, defaults for wait_mode, worker_lane, reasoning_effort (low is lowest), execution_timeout_seconds defaults (fast 600, deep 3600, max 14400), and advises file_assertions for byte-exact content. This adds meaning far beyond raw schema names.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific action: 'delegate one immutable TaskContractV1 to an isolated Reasonix edit worker' after explicit user approval. This clearly distinguishes the tool from siblings (inspect, control) by naming the delegated contract workflow and the worker isolation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides strong situational guidance: for trivial edits with verified local context, do one focused preflight and delegate directly; avoid browsing docs/memory solely to construct the contract. It also differentiates worker_lane=fast versus deep, explains background mode, and specifies when deep is needed ('explicitly long-horizon delivery/goal work').

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.