Agent Nodes
Applies to: ChengOS v0.2.0+ | Last verified: 2026-09-25 | Source:
crates/cheng-nodes/src/nodes/builtin/agent
Only one node here goes on the canvas: agent/react_agent. The other three are the internal stages of
its loop — plan, execute, review — and they are hidden from the node palette on purpose. They are
documented anyway, because their inputs and outputs are the clearest description of what an iteration
actually does, and their fields explain the agent's own knobs: iteration budget, task run mode, and
the safety policy that decides when a long task is still making progress.
ReAct Agent — agent/react_agent
Intelligent decision agent that automatically plans, executes and evaluates tasks
Inputs
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
context | object (port) | — | null | Existing AgentContext (optional, for continuing historical conversation). Connection port, not a form field. Control: text |
task | string | — | null | Task description to accomplish (optional, auto-extracted from context conversation history if empty). Control: textarea |
llm_config | object (port) | ✅ | — | LLM configuration (JSON string or object). Connection port, not a form field. Control: text |
max_iterations | integer | — | 40 | Maximum Plan/Execute/Review iterations for each user message. Control: number |
max_tool_calls_per_turn | integer | — | — | Optional maximum number of tool calls allowed for each user message. Control: number |
execution_mode | enum | — | light | Legacy loop execution mode. Prefer Task Run Mode. Control: select. Options: light (Backward-compatible fixed iteration behavior.), adaptive (Future policy-renewed mode for medium/uncertain tasks.), heavy (Future long-task mode with stricter ledger and review safety rails.) |
task_run_mode | enum | — | null | Short task pauses at chunk exhaustion; long task continues while progress is being made. Control: select. Options: short (Bounded task chunk; pause for user confirmation when exhausted.), long (Progress-driven task loop; renew internal windows while making progress.) |
short_task_budget_chunk | integer | — | 40 | Legacy short-task chunk size. Prefer Iteration Budget. Control: number |
long_task_safety_policy | object | — | — | Advanced long-task safety limits |
tools | array<any> | — | [] | Available tools (populated from connected tool nodes via tools port) |
use_function_calling | boolean | — | true | Use native function calling mode. Control: switch |
use_llm_evaluation | boolean | — | false | Enable LLM evaluation. Control: switch |
max_checkpoints | integer | — | 3 | Max checkpoint count (LLM may request extension when iterations exhausted). Control: number |
instruction_prompt | string | — | null | Custom instruction prompt (overrides default system prompt). Control: textarea |
user_message | string | — | null | User additional instruction (prepended to task, e.g.: Before starting, read SKILLS_INDEX.md first). Control: textarea |
reviewer_prompt | string | — | null | Reviewer criteria / prompt (used when LLM evaluation is enabled). Control: textarea |
reviewer_llm_config | object (port) | — | null | Reviewer LLM configuration (optional, falls back to main LLM config). Connection port, not a form field. Control: text |
max_review_rounds | integer | — | 1 | Max LLM review rounds. Control: number |
min_tool_calls_for_skill | integer | — | 3 | Min successful tool calls to emit skill summary (0 = disabled). Control: number |
transparent_agent_streaming | boolean | — | true | Stream agent planning (text, reasoning, tool-call progress) live. Control: switch |
reminder_policy | object | — | — | Advanced: Todo nudge/gate reminder policy |
compaction_preset | enum | — | standard | How eagerly this agent compacts its working context: standard (balanced), aggressive (compacts earlier and archives used tool schemas; large one-shot data results and MCP/skill discovery), lenient (keeps more recent tool history; long coding and reasoning tasks). Control: select. Options: standard, aggressive, lenient |
Outputs
| Field | Type | Description |
|---|---|---|
final_answer | string (port) | Final answer. Connection port, not a form field. |
context | object (port) | Agent context (contains conversation history). Connection port, not a form field. |
session_id | string (port) | Session ID (consistent with context.session_id, convenient for downstream direct connection). Connection port, not a form field. |
trace | string (port) | Execution trace. Connection port, not a form field. |
total_tokens | integer | Cumulative token consumption |
iterations_used | integer | Number of iterations executed |
success | boolean | Whether task was completed successfully |
status | string | Status message |
requires_review | boolean | Whether human review is required |
pause_reason | string | Pause reason |
suggested_next_action | string | Suggested next action |
interim_report | string | Interim report |
continuation_policy | object | Compact continuation policy state |
skill_summary | object | Lean AgentContext for skill distillation (conditional: absent when not needed) |
artifacts | array<object> (port) | Artifact references produced by tools during this run. Connection port, not a form field. |
ReAct Plan — agent/react_plan
Analyze task status and decide next action
Inputs
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
task | string | ✅ | — | Task description to accomplish. Control: textarea |
llm_config | object (port) | ✅ | — | LLM configuration (JSON string or object). Connection port, not a form field. |
max_iterations | integer | — | 10 | Maximum iterations allowed. Control: number |
tools | array<any> | — | [] | Available tools (populated from connected tool nodes via tools port). Control: multi-select |
use_function_calling | boolean | — | true | Use native function calling mode. Control: switch |
Outputs
| Field | Type | Description |
|---|---|---|
decision | enum | Action decision made by the agent |
context | object | Updated execution context |
tokens_used | integer | Tokens consumed in this planning step |
ReAct Execute — agent/react_execute
Execute tool calls and get observation results
Inputs
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
decision | enum | ✅ | — | Action decision from Plan node |
context | object | — | {"checkpoint_count":0,"execution_mode":"light... | Current execution context |
Outputs
| Field | Type | Description |
|---|---|---|
result | object | Tool execution result |
context | object | Updated execution context |
is_final | boolean | Whether this is a final decision |
observation | string | Observation result (fed back to Plan node) |
decision | enum | Original decision (passed through to Review node) |
ReAct Review — agent/react_review
Evaluate execution results and decide whether to continue iteration
Inputs
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
task | string | ✅ | — | Original task description. Control: textarea |
result | object | ✅ | — | Tool execution result |
decision | enum | ✅ | — | Original action decision |
context | object | ✅ | — | Current execution context |
Outputs
| Field | Type | Description |
|---|---|---|
review | enum | Review decision |
context | object | Updated execution context |
should_continue | boolean | Whether to continue iterating |
observation | string | Observation for next iteration |
final_answer | string | Final answer (if completed) |
tokens_used | integer | Tokens consumed in evaluation |