[ release ]

The agent now stops a small model going round in circles

A loop guard in the agent catches a model repeating one thought or making the same call again, without a second model. Plus a new arc-think-once skill, and a command palette, chat search and Markdown export in the desktop app. We have no speed or token figures yet.

ArcFlare··3 min read
#release#agent#skills#desktop

The problem

Small thinking models waste tokens in two ways. They go round one thought ("2 + 2 = 4. Let me check again. 2 + 2 = 4."), or they make the same call again in the hope of a different result. On a model that generates tens of tokens a second, that is minutes spent on nothing.

The agent now has a loop guard (lib/agent/loopguard.js) that catches both. It does not use a second model.

What it catches

  • A repeated thought. Thinking is read as it streams. The same sentence four times (six for a very short one), or the same passage three times back to back, drops the request. llama.cpp stops generating when the client hangs up. The step is then asked once more with thinking off, and a one-line note rides on the last message so the cached prompt prefix is untouched. If it loops again, the turn stops and says so rather than trying a third time.
  • Too much thinking. Each step has a ceiling on thinking: an eighth of the context window, between 1,024 and 4,096 tokens.
  • A repeated read. For read_file, grep, glob, list_dir, skill_load and tool_search, the same call a third time, with nothing written or run since and the earlier result at most eight calls back, gets a one-line answer instead of the same output again.
  • A repeated command. A shell command is always run, because running it may be the point. The third identical result carries a note that running it again will not change it.

/stats shows what the guard caught. ARCFLARE_LOOP_GUARD=off turns it off, and ARCFLARE_THINK_CAP=<tokens> sets the ceiling (0 for none).

20 new tests cover it. They include the cases where it must do nothing: ordinary reasoning, a list of similar lines, and a short true statement repeated a few times are all left alone.

What we have not measured

We have not timed this on real models, so there are no speed-up or token-saving figures in this post. Those are still to come, and we will publish them when we have them.

A new skill: arc-think-once

The guard catches a loop after it has started. The arc-think-once skill is about not starting one: decide once, test the idea with a tool, move on. One passing check is enough. A failing check is information, not a verdict, and after two failed tries the agent should change approach.

Add it with:

arcflare store skills add arc-think-once

That makes six Arc skills. Every Arc's instructions also now carry a short "How you think" part that says the same.

Desktop app

These are coming in the next update:

  • Command palette. Press Ctrl or Cmd+K, then type to jump to any view or start a new chat.
  • Chat search and export. Search conversations by title and message text, and export a conversation as Markdown.
  • Focus ring. Every button and nav item shows a clear keyboard focus ring. Text fields keep marking focus on their border.
  • Agent view. It shows a note when the loop guard cuts a thought.

The loop guard is documented in the agent docs.

Keep reading