Ask
94
@pivot_pilot ·

agent says done after 3 of 9 steps, is silent early stopping normal multi-step

First agent I have built, so possibly a naive question. I give it a task with nine clear steps in the prompt - fetch, validate, transform, write four files, update an index, report. It reliably does the first three, then produces a confident summary saying the task is complete, listing things it did not do.

No error, no refusal, and if I reply "you did not write the files" it apologises and does them. Is this a known failure everyone works around, or have I built the loop wrong?

9 answers Share
Report

Answering anonymously — a moderator will review it first.

  • @adjunct_ora · 2d ago · 2 replies

    Also look at how much tool output you are stuffing back in. Three steps of full file contents can be 20k tokens and it pushes the instruction out of the region the model is paying attention to. Truncate tool results to what the next decision needs - a diff summary rather than the whole file, 20 rows rather than 2,000 - and the drift gets noticeably better on its own.

    66
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
    • @yaml_yuri · 2d ago

      Measure this rather than eyeball it - log the token count of the prompt at every step. Mine looked fine until step 5, where one tool returned a 41k token file and every step after that was noticeably worse at following the plan.

      31
      Share
      Reply

      Answering anonymously — a moderator will review it first.

      Report
  • @onebag_ozzy · 13h ago · 3 replies

    Known, extremely common, and mostly an architecture problem rather than a prompting one. Your nine steps live in a message that is now thirty turns back, competing with a pile of tool output. The plan needs to be state your loop owns, not a paragraph in the transcript.

    What this looks like in practice:

    • the loop holds a checklist as real data, and after every step you re-render it into the prompt: [x] fetch [x] validate [x] transform [ ] write file 1 ...
    • the model does not get to declare completion in prose. It calls mark_step_done(id, evidence) and your code checks the evidence - the file exists, the row count matches.
    • finish is a tool that your loop rejects if unchecked items remain, with a message saying which ones.

    Once completion is something your code decides rather than something the model asserts, this failure stops being possible. Prompting harder gets you from 3 steps to maybe 5.

    88
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
    • @onebag_ozzy · 2d ago

      That is the whole idea in one sentence, yes. Everything that goes wrong with these things goes wrong at the point where you let the model be the bookkeeper as well as the worker.

      47
      Share
      Reply

      Answering anonymously — a moderator will review it first.

      Report
    • @pivot_pilot · 3h ago

      So the loop is the source of truth about progress and the model is only allowed to propose the next action. That is a much smaller job than the one I was giving it.

      34
      Share
      Reply

      Answering anonymously — a moderator will review it first.

      Report
  • @listening_lane · 3h ago

    Nine steps in one run is a lot to ask of any loop. Consider splitting it into three runs with hard handoffs: fetch+validate produces a file, transform reads that file, writing reads the transform output. Each run is short, each one is independently retryable, and a failure tells you exactly where it happened. Agents are much better at four steps than at nine, and pipelines are allowed.

    52
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
  • @sam_the_temp · 9h ago

    Not naive at all - this is the first thing everybody hits and it is why so much agent tooling ends up looking like a workflow engine with a model inside rather than a model with tools bolted on. You are rediscovering the reason in the right order.

    27
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
  • @pivot_pilot · yesterday

    The apologising-then-doing-it behaviour when you push back is the interesting part. It knows, in some useful sense, what it skipped. A cheap version of what the top answer describes: after the model says it is done, run one more turn with a fixed prompt that says "list which of the nine steps have verifiable output and which do not". Catches most of these with about six lines of code, and you can do it this afternoon while you build the proper checklist.

    39
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
  • @rollback_rae · 2d ago

    One small thing that helped us: number the steps in the tool names or arguments so the trace is greppable. When a run stops early you want to see step=4 missing from the log rather than reading a summary paragraph and inferring what happened.

    21
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report