{"slug": "our-agent-reviews-its-own-mistakes-every-day-here-is-the-loop-and-the-tests-it", "title": "Our agent reviews its own mistakes every day. Here is the loop, and the tests it produced", "summary": "A developer built SpaceApp, a self-hosted workspace where AI coding CLIs run side by side, and added a daily self-review loop that turns the agent's repeated mistakes into code changes, each backed by a test. The review prompt is built from figures Space counts rather than the agent's own account of its day, separating genuine mistakes from safety-gate refusals, and files fixes as queue items worked in separate upgrade rounds. The developer reports that most resulting fixes were simply rewritten error messages that state the next step, such as \"read the pane before you answer again; never repeat the same answer.", "body_md": "I build SpaceApp, a self-hosted workspace where AI coding CLIs run side by side in persistent rooms. Nous is the part of it that sees every room and pane, does the routine work itself and brings me only the decisions that need me.\n\nAn agent that does routine work makes routine mistakes, and the same ones come back. This post is about the loop that catches the repeats: a daily self-review that turns them into code changes, each with a test. Every part of it is in the public repository, so you can read the code instead of taking my word for it.\n\nThe first version was a scheduled task typed into a pane once a day. It kept getting lost: the pane it was bound to closed, and the review was skipped on 21 and 23 October. Since 24 October, Space itself starts the review as a turn of its own, once per local day at or after the hour you choose, and skips it when a review already ran that day.\n\nSource: [`daily-review.ts`](https://github.com/oll4com/spaceapp/blob/main/apps/api/src/nous/daily-review.ts) and [`standing-orders.ts`](https://github.com/oll4com/spaceapp/blob/main/apps/api/src/nous/standing-orders.ts).\n\nThe review prompt is built from figures Space counts, not from the agent's own account of its day:\n\nThe split between mistakes and gate refusals matters. Without it, a safety rule doing its job would show up in the review as a bug to fix.\n\nFive orders, in this order:\n\n`OPEN <day> REVIEW: <cause>; evidence: <tools and counts>; fix: <the code change you want>`\nNothing when no cause repeats.\nA lesson in a note helps only while the agent reads it. A line in the queue asks for a change in the code, so the next turn, or the next model, does not have to remember.\n\nThe queue is worked in separate upgrade rounds. The fixes that came out of it carry a test named after the review or queue item that found it, in [`nous-self-upgrade.test.ts`](https://github.com/oll4com/spaceapp/blob/main/apps/api/tests/nous-self-upgrade.test.ts). A few of them:\n\nOne group of tests is titled \"errors that say the next step\" (daily review of 21 October): a shell terminal with no AI CLI is refused before anything is sent, with \"do not send again\"; a copilot pane points to the copilot's own tools; an answer that left the screen unchanged says \"read the pane before you answer again; never repeat the same answer\".\n\nReading the file back, most of these fixes are not clever. They are error messages rewritten so the next step is inside the message. A bare \"failed\" gives a model nothing to do except try the same thing again.\n\nYou need Linux, macOS or Windows 11, Node.js 20.11 or newer, and at least 4 CPUs, 8 GB RAM and 15 GiB of free disk:\n\n```\nnpx --yes run-spaceapp@latest install\n```\n\nSpaceApp is MIT-licensed. Code and docs: [https://github.com/oll4com/spaceapp](https://github.com/oll4com/spaceapp) · site: [https://spaceapp.dev](https://spaceapp.dev)\n\nIf you run agents for long stretches: what do you count as a mistake, and what do you count as a guard doing its job?", "url": "https://wpnews.pro/news/our-agent-reviews-its-own-mistakes-every-day-here-is-the-loop-and-the-tests-it", "canonical_source": "https://dev.to/space_app_fc7f6872808dc84/our-agent-reviews-its-own-mistakes-every-day-here-is-the-loop-and-the-tests-it-produced-4n7k", "published_at": "2026-11-18 14:31:30+00:00", "updated_at": "2026-11-18 14:44:40.342569+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-safety"], "entities": ["SpaceApp", "Nous", "GitHub"], "also_reported_by": [], "takeaway": "Scheduling the daily self-review as a turn of its own, rather than a task typed into a pane, stopped reviews from being skipped when the pane closed; the resulting fixes mostly rewrote bare error messages to state the next step.", "recommendation": {"advice": "Schedule agent self-review as a first-class turn driven by counted metrics, not the agent's own account, and rewrite bare failure messages to state the next step so the model does not retry blindly.", "playbook": "agent-architecture", "playbook_url": "https://wpnews.pro/playbooks/agent-architecture"}, "alternates": {"html": "https://wpnews.pro/news/our-agent-reviews-its-own-mistakes-every-day-here-is-the-loop-and-the-tests-it", "markdown": "https://wpnews.pro/news/our-agent-reviews-its-own-mistakes-every-day-here-is-the-loop-and-the-tests-it.md", "text": "https://wpnews.pro/news/our-agent-reviews-its-own-mistakes-every-day-here-is-the-loop-and-the-tests-it.txt", "jsonld": "https://wpnews.pro/news/our-agent-reviews-its-own-mistakes-every-day-here-is-the-loop-and-the-tests-it.jsonld"}}