Skip to content

feat(agent-react): add the ReAct baseline agent - #21

Merged
kottinov merged 6 commits into
mainfrom
feat/agent-react
Nov 18, 2026
Merged

kottinov merged 6 commits into
mainfrom
feat/agent-react

Conversation

@kottinov

Copy link
Copy Markdown
Collaborator

Why

The thesis needs a strong baseline: the same model and tools that evorca uses, without self-improvement. This PR adds the react agent, Claude Sonnet 5 in a ReAct loop with a bash tool over the telemetry, and RCA-Agent's domain knowledge in its prompt.

What changed

  • agents/react/ holds the agent: a persistent bash session, a strict submit_answer tool, and a loop that wraps up at a step cap, a soft budget, or a soft deadline. It writes prediction.json, trajectory.jsonl, and summary.json.
  • scripts/extract-background.ts makes background.json from RCA-Agent's prompts at the pinned OpenRCA commit. It drops only the rules that fit RCA-Agent's controller and executor split, and fails if the prompts change.
  • The image is node:26-trixie-slim with Python 3.13, pandas, pytz, and DuckDB, from hashed lockfiles.

Scope

  • Covers the agent and its image. The CLI entry, the model proxy, and the benchmark run are separate work.
  • The prompt has no domain hints beyond RCA-Agent's. It also states the environment limits and the scoring rule.

Blast Radius

New package only, plus one row in the root README. Nothing imports it, and evorca evaluate cannot run it until the CLI registers it.

Verification

  • pnpm check passes. 52 agent tests drive the real SDK against a local mock Messages API.
  • pnpm --filter @evorca/agent-react smoke runs the image as nobody with a read-only root and a tmpfs, on an internal network that reaches only the mock. DuckDB and pandas read synthetic telemetry, and all three files are written.
  • No real API call ran, because no API key was available.

Parse /task.json, define the strict submit_answer tool, check an answer against the fields that the task asks for, and write it as OpenRCA prediction JSON.
One bash process runs the model's commands in turn. A command past the timeout ends the session's process group, and long output keeps its start and its end.
extract-background makes background.json from RCA-Agent's prompts at the pinned OpenRCA commit. buildPrompt adds the environment and the answer format, and keeps the system prompt and the tools the same for every task of a scenario.
investigate runs the model until it submits an answer. It wraps up at the step cap, the soft budget, or the soft deadline, and ends on a refusal or an API error with the best answer so far. runTask writes prediction.json, trajectory.jsonl, and summary.json.
The image adds Python 3.13 with pandas, pytz, and DuckDB from hashed pins. The smoke test runs one task in the image with the runner's restrictions against a mock Messages API on an internal network.
@kottinov
kottinov merged commit ae1d7c9 into main Nov 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant