How to Build a Multi-Step Reasoning Test for Your AI Agent
ReasonBench exposed a painful truth: even the best models fall apart when you add irrelevant information or require more than 8 reasoning steps. If you're deploying an AI agent that makes decisions, you need to test for this weakness before it costs you a customer. Here's how to build a simple but effective reasoning test in 30 minutes.
Start by taking three problems from your domain that require logical reasoning. For a customer support agent, that might be: 'A customer ordered a blue widget on Monday, but the red widget arrived on Wednesday. They want a refund but also need the correct item by Friday. What should you do?' This requires tracking order date, item color, delivery date, and two separate requests.
Now add distractors. Insert a sentence like 'The customer's name is Jane' or 'It rained on Tuesday' somewhere in the middle. The goal is to see if your model ignores the irrelevant info. Run the same prompt with and without the distractor. If the answer changes, your model is vulnerable.
Next, extend the reasoning chain. Take your base problem and add two more steps: 'Jane also ordered a green gadget last month that was refunded. The refund hasn't processed yet. How does that affect this request?' Now the model has to track five entities across time. If it fails, you know your agent can't handle complex histories.
Finally, automate this as a CI check. Use GitHub Actions to run your test suite every time you update your prompt or model. LangSmith v2 (released today) can do this automatically with its regression detection feature. The cost of not testing is an agent that confidently gives wrong answers — which is worse than no answer at all.
Remember: benchmarks like MMLU and HumanEval test knowledge, not reasoning. Your customers don't care if your model knows the capital of France; they care if it can figure out why their order is delayed. Build the test, run it weekly, and don't deploy until your model scores above 90% on your custom set.
Code Refactor Agent
You are a senior software engineer. Given a natural language instruction to refactor a codebase, generate a plan listing the files to change and the exact diffs. Apply changes only after producing a preview diff for user approval. Constraint: handle up to 10 files simultaneously.