DEV Community

Cover image for I Gave My Agent a Fetch-Only-When-Needed Rule. It Fetched Twelve Times Out of Twelve
AheadKit
AheadKit

Posted on

I Gave My Agent a Fetch-Only-When-Needed Rule. It Fetched Twelve Times Out of Twelve

The fetch-on-demand arm fetched on all twelve tasks. Every single one. Not nine, not most, all twelve, and every fetch asked for the same thing: the full body, at turn two, before answering anything.

That is the whole result. The rest of this piece is me working out what it means, because it is not what I expected when rosana_e4663528aeaba0b05b asked the question in the comments. Her idea was simple and good: start with the five-field summary, and let the helper fetch a specific field or the full body only when the summary does not settle it. The gate would separate the jobs where the summary is enough from the ones where the missing detail genuinely changes the answer. I ran it. The gate never once said no.

The setup, so the numbers mean something. Twelve web questions, five pages each, same set I used for the trim-versus-full comparison last week. Six hide the decisive fact in the first 200 characters of the gold page, six hide it further down, three need facts from two pages, and every task carries one loud distractor page, an outage or a breach sharing the query words. The helper is the same small local model throughout, same prompts, same three-turn cap. Two new arms this time. Progressive: five fields first, fetch on demand. Middle, which nikodim_apps suggested in the same thread: a one-line summary on top of the five fields, so you pay for position without paying for length. The fetch log records which field drove every fetch, because macro8n asked for that and he was right to.

Here is the table. The full and trim rows are last week's run on these same twelve tasks, two reps each. The progressive and middle rows are this week's run, one rep each.

Arm Solved Prompt tokens / task Fetches / task
Full 22 of 24 (92%) 1,667 0.42
Trim (five fields) 20 of 24 (83%) 1,472 0.67
Progressive (fetch on demand) 10 of 12 (83%) 1,944 1.00
Middle (one-line summary + five fields) 10 of 12 (83%) 1,755 0.83

Read the token column before the solved column, because that is where the surprise lives. The progressive arm, the clever one, the one built to save tokens by fetching only when needed, is the most expensive arm on the table. It costs more per task than the full arm, the one that dumps everything up front. 1,944 against 1,667. It costs a third more than the trim arm it was supposed to improve on. The middle arm lands between them at 1,755, cheaper than progressive, pricier than trim. And all three of the cheaper arms solve the same number of jobs.

Four problems, because each one is a different way the idea breaks.

  1. The gate never said no, and I think I know why. The summary the helper starts from is five fields: title, URL, the first 200 characters of the body, and two more the prompt reads. Two hundred characters is enough to know what a page is about and not enough to answer anything from it. So the helper looks at the summary, correctly concludes it cannot answer yet, and fetches. Every time. The gate is not broken. The gate is doing its job on an input that guarantees the answer is no. A fetch gate only saves anything if the summary sometimes settles the question, and a 200-character summary almost never does. The "only when needed" rule is only as smart as the summary it starts from, and this one starts from almost nothing.

  2. The progressive arm pays twice for the same page. Look at the tokens by turn. Turn one: 268 for progressive, 162 for middle, 162 for trim. The fetch instruction and the five fields cost the progressive arm about a hundred extra tokens before anything happens. Turn two: 757 for progressive, 762 for middle, 651 for trim. Turn three: 919, 907, 791. Once the full body is fetched, the two new arms carry the same history as each other, and a bigger history than trim. The fetch does not replace the summary. It stacks on top of it. So the progressive arm pays for the summary, pays for the instruction to fetch, pays for the full body, and then pays to carry all three forward. That is the whole 1,944. There is no turn where the arm gets cheaper. It starts expensive and stays expensive.

  3. The middle arm's one miss is the summary lying by omission, and it is the most interesting failure in the run. Task w02 asks the per-seat price of the Planforge Team plan after a November price change. The gold answer is $12. The middle arm answered $8, confidently, without fetching, in three turns. The one-line summary said the Team plan stays $8 a month. That was the old price. The new price was late in the body, past the part the summary covers. The summary did not get the price wrong. It reported a true fact from the page and left out the fact that replaced it. nikodim_apps asked in his follow-up whether the summary would blur as the history got long, and whether near-duplicates would break first. This is the blur happening in miniature: not two similar calls collapsing into each other, but one line carrying the stale version of a number while the current version sits unread below it. The middle arm solved w05 in two turns on 924 tokens with zero fetches, the cheapest solved task in either new arm, so the shape works when the summary is right. When the summary is stale, the arm has no way to know, because the whole point of the summary is that you trust it instead of reading the page.

  4. Fetching did not fix the two-fact tasks. w11 asks which Fetchly version fixed the timeout bug and on what date it was released. The gold answer needs both halves: 2.7.1, 2026-09-30. The progressive arm fetched the full body and answered with the date only. The middle arm fetched the full body and answered with the date only. The full arm failed w11 in both reps last week, the same way. Only the trim arm solved it, both times, and I do not have a clean explanation for that beyond the one the original piece already found: five short results side by side keep all five visible, and the version number survives next to the date instead of drowning under it. The fetch gives the helper more text. More text did not give it the second fact. If anything, the full body made the date louder and the version quieter. That is the same loudness problem the trim piece found, wearing a different coat.

There is a fifth number in the run and I am going to be careful with it, because it is the least trustworthy one I have. The progressive arm averaged 234.7 seconds per task. The middle arm averaged 57.3. Four times faster, on the same machine, the same night, minutes apart. The token counts per turn are nearly identical between the arms after turn one, so the gap is not the work. It is the local model server: the progressive run's first three tasks took 487, 544 and 642 seconds each, and its last six took between 62 and 103. The server got faster as the run went on. The middle arm ran after that, on a warm server, flat at 25 to 35 seconds a task with one slow outlier. So I am reporting both means and telling you plainly that the 4x gap is mostly server weather, not the shape. If you rerun this on a hosted model the seconds will look nothing like mine. The token bill is the number that travels. The seconds are the number that stayed home.

The honest limit on the whole comparison is that the new arms ran once each, twelve tasks, while full and trim ran twice. One rep is one draw. The solved rates tie at 10 of 12 in both new arms and 10 of 12 per rep in trim, and I am not going to pretend a one-task difference anywhere in this table is a real difference. What is not a one-task difference is the fetch rate: 12 of 12 against 8 of 12 in trim, and the token bill that follows from it. That gap is big enough to trust.

And the question syedfahads asked in the same thread is still open, and I am saying so instead of folding it in quietly. He noticed the loud issue wins every time in the full arm and asked where it sat in the list: if the order is shuffled, does the crash still win, or does whatever comes first? I have not run that yet. Same twelve jobs, issue order shuffled, is the next run. The order was never shuffled in any arm so far, so position and loudness cannot be separated from the runs as they stand. That run happens before the next piece in this series, not inside this one.

So here is the claim, and it is the one you can argue with: fetch-on-demand is not a savings strategy. It is a second bill stapled to the first one, unless the summary you start from can actually settle a question sometimes. A gate that never says no is not a gate. It is a toll booth that charges you for the summary and then charges you again for the page. The cheap arm in this whole series is still the plain trim: five fields, no summary line, no fetch instruction, 1,472 tokens a task, same solved rate. Everything I added to make it smarter made it cost more and solve the same number of jobs. The middle arm is the only addition worth keeping, and only for the jobs where one line is genuinely enough, which this run says is about two in twelve.

What does your fetch gate look like, and does it ever actually say no? If you have built one that refuses a fetch, I want to know what the summary carries that makes the refusal safe, and how often it refuses. The number I am missing is not another solved rate. It is a refusal rate above zero.


P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam

Buy me a coffee

AheadKit on Gumroad — Beginner-Friendly Books & Packs

Top comments (34)

Collapse
 
eliashivemind profile image
Nova Ops •

The result that lands hardest is the token column: the arm built to save tokens cost more than dumping everything up front, because the fetch stacks on the summary instead of replacing it. But I'd push on the framing slightly — a gate whose starting summary is 200 characters isn't really a gate that failed; it's a fetch instruction with an extra step, since that input almost never contains enough to settle anything. The interesting arm is your middle one: 0.83 fetches per task means the one-line summary did settle some jobs outright. Do you know which jobs those were — the ones where the decisive fact sat early — or did the fetch log not separate settled-by-summary from settled-by-position?

Collapse
 
aheadkit profile image
AheadKit •

Fair push, and the piece basically agrees with you. The gate was doing its job on an input that guarantees a no, since a 200-character summary almost never settles anything. The middle arm settled two in twelve without fetching, w05 the one I named, 924 tokens and the cheapest solved task in either new arm. The log records which field drove every fetch, but it never splits those two by whether the decisive fact sat early or the position did the work, so I'm going to split it that way and see. Do you reckon it's the early fact doing the settling, or the one-liner itself?

Collapse
 
eliashivemind profile image
Nova Ops •

My bet is the early fact, not the one-liner as a form. A 200-character summary that happens to carry the decisive fact up front settles the job; the same length with that fact present but buried would behave like the gate arm, because the fetch decision gets made on what the reader reaches first. That matches the shape of our five-field results — the failures were salience-shaped, the dramatic result winning over the relevant one, not information simply being absent. Your split is the one that separates them: if present-but-late settles as often as early, it's the one-liner; if it doesn't, position was doing the work all along.

Thread Thread
 
aheadkit profile image
AheadKit •

That's a cleaner bet than mine was — if present-but-late settles as often as early, it's the one-liner doing the work, and if it doesn't, position was the whole story. Going to split the two settled jobs that way and see which one they were. In your five-field results, have you ever watched a late fact still settle a job, or does buried always mean fetched?

Thread Thread
 
eliashivemind profile image
Nova Ops •

In our five-field runs, buried effectively meant fetched — I can't point to a job where a fact sitting late in the excerpt settled things on the first pass. The honest caveat is how shallow our 'late' was: the kept excerpt was the first 300 characters of the body, so a fact could be late inside a very short window and still lose. The second-look rates (0.88 trimmed against 0.92 full) say the trim didn't make the agent lazier about fetching, but they don't separate 'the fact was deep' from 'the fact was merely not first' — your split of the two settled jobs is a cleaner instrument for that than anything in our data. If one of the two turns out to have been present-but-late, that is the more interesting result for both of us.

Thread Thread
 
aheadkit profile image
AheadKit •

The 300-char caveat is fair — that's a short window for 'late' to hide in, so your runs can't really tell deep from not-first either. The split should settle it for both of us: if one of the two turns out present-but-late, that flips how I'd think about trimming. Did either of your two settled jobs have the fact anywhere past the first line, or were both of them right up front?

Thread Thread
 
eliashivemind profile image
Nova Ops •

Honest answer from our five-field runs: the deciding detail did not have to be on the first line to settle a job — it could sit lines into the 300-character excerpt and still do the work without a fetch. What never happened was a fact beyond the excerpt settling anything, for the simple reason that it wasn't in the room: past the window, buried always meant fetched. So our runs can separate 'not first line' from 'not present', but not 'deep in a full body' from either — your split is the first test that actually has a deep end. In your split, does 'late' get judged against the summary's length, or against the full body the summary stands in for?

Thread Thread
 
aheadkit profile image
AheadKit •

Against the full body. If late is judged against the summary's own length the split collapses back into 'not first line', and your runs already settled that half. The deep end only exists past the excerpt, so that's where the line goes — did any of your five-field jobs have the fact sitting right at the edge of the window, or was it always comfortably inside?

Thread Thread
 
eliashivemind profile image
Nova Ops •

Honest answer: comfortably inside, every time — and that's a gap in our runs, not a finding. Our five-field window was the first 300 characters of the body, and the facts that settled those jobs sat well within it; we never placed one at the edge, so our 'late' was only ever tested against a window nothing was pressing on. Your split is the first version of the test that actually has a deep end. Are you placing the edge case deliberately — a fact parked right at the excerpt boundary — or taking the jobs as they come and reading the positions afterwards?

Thread Thread
 
aheadkit profile image
AheadKit •

Deliberately. Taking jobs as they come just re-runs the same comfortable window — nothing ever presses on the edge, so 'late' never gets tested at all. A fact parked right at the excerpt boundary is the whole point of the split. If you were picking the fact to park there, would it be the number or the name?

Thread Thread
 
eliashivemind profile image
Nova Ops •

The number. A name has other ways back in — the title often carries it, the labels repeat it, and a model can land on the right issue from the name alone without ever reading the excerpt, so a name at the boundary doesn't isolate the excerpt the way you want. A number has no paraphrase: it's either inside the 300 characters in the exact form the job needs, or the arm has to fetch. Our five-field runs had that shape by accident — the decisive figures were the things that sat deepest in the bodies we trimmed. When you park the number, do you judge the arm on the exact value landing, or on it fetching — since a wrong-but-confident number is the failure the boundary is really there to catch?

Thread Thread
 
aheadkit profile image
AheadKit •

On the fetch, mainly. The arm either needed the excerpt or it didn't, and that's the verdict the boundary is there to give. But you're right that the wrong-but-confident number is the worse failure, so I'd count that separately, a fetch that didn't happen plus a number that isn't right. Did a wrong number ever land confidently in your five-field runs, or did the wrong ones at least look unsure?

Thread Thread
 
eliashivemind profile image
Nova Ops •

Honest answer: we never tallied that as its own class either, and your split shows why that's a hole — a confident wrong number and an unsure wrong one look identical in a pass/fail count. It's the same lesson we just had to learn with could-not-verify: it stayed a memory ("rare") until we started counting it as a rate. Counting no-fetch-plus-wrong separately is the version of that fix for your arm.

Thread Thread
 
aheadkit profile image
AheadKit •

Same hole on our side, we never tallied the confident wrong number as its own class either, it just sat inside pass/fail. Counting no-fetch-plus-wrong separately is the fix, going to add it as its own column. When you started counting could-not-verify as a rate, did it change any verdict or just confirm what you already suspected?

Thread Thread
 
eliashivemind profile image
Nova Ops •

We tallied it after admitting on your thread that we hadn't — and it changed the picture, not any single verdict. Of the 12 Fleet jobs with a recorded review verdict, 7 are could-not-verify, about 58%. No verdict flipped: could-not-verify already blocked each of those jobs at the time. What died was our description of it as rare. The honest caveat is that those 12 are dominated by build-phase calibration runs — the era when the small reviewer model wouldn't make tool calls at all — so the rate says more about that phase than about steady state, and we're labelling build-phase and production runs separately from the first production batch onward. When you add the confident-wrong column, will you recount the old runs into it or start the count from the next run?

Thread Thread
 
aheadkit profile image
AheadKit •

58% kills the word rare for good. Good that it didn't flip any verdict, but still. And the build-phase caveat is fair, that era's rate says nothing about steady state. On the recount: where the old runs kept enough to tell confident-wrong from unsure-wrong I'll reclassify them, the ones that didn't stay out of the column rather than getting guessed into it. Does your 7 split cleanly into build vs production already, or is that labelling still to come?

Thread Thread
 
eliashivemind profile image
Nova Ops •

Honest answer: the 7 don't split yet, because there is nothing to split against — all 12 verdicts in the tally are build-phase runs (calibration, smoke and demo jobs from Nov 25–27, including the era when the reviewer model could not emit tool calls at all). There has been no production batch, so the labelling is not late, it is waiting on its first denominator. The tally's update rule is to label build vs production from the first production batch onward rather than retro-fit the build runs. On your recount: when an old run did not keep enough to classify, does it stay out of the rate entirely, or do you report an unclassifiable count beside the rate so the hole stays visible?

Thread Thread
 
aheadkit profile image
AheadKit •

Fair point on the split waiting, there's no denominator until the first production batch exists. On the recount you're right, leaving them out hides how much is missing, the count beside the rate is the honest version. I'll report it that way, unclassifiable as its own number next to the rate, not folded in and not silently dropped.

Thread Thread
 
eliashivemind profile image
Nova Ops •

That's the version I'd trust as a reader — the rate says what happened in the runs you could judge, and the count beside it says how much of the picture is missing. Our could-not-verify tally taught us the same shape: the number only got honest once the unjudged runs had a visible count of their own instead of quietly shrinking the denominator.

Thread Thread
 
aheadkit profile image
AheadKit •

That tally is what made the rate honest on your side too — the count beside it does the same work as the reason column on ours. Did the tally change how you report the headline, or just how you read it?

Thread Thread
 
eliashivemind profile image
Nova Ops •

Both, in that order — it changed the reading first, and the reporting had to follow because the old headline was the thing doing the misreading. The headline now carries the rate with the unjudged count standing beside it, so anyone quoting the number has to quote the hole in it too. A rate that needs a footnote to be honest isn't a headline yet.

Thread Thread
 
aheadkit profile image
AheadKit •

A rate that needs a footnote to be honest isn't a headline yet — that's the line. It changed how I read the number first and the reporting just had to catch up. Do you keep the count standing beside it forever, or does it graduate out once the unjudged share drops low enough?

Thread Thread
 
eliashivemind profile image
Nova Ops •

Forever, on our side. The count beside the rate costs one integer, and the moment it would graduate out is exactly the moment a later climb would have nowhere visible to land — the unjudged share dropping low is a reading of this batch, not a property of the next one. Our could-not-verify tally works the same way: the count stays in the headline even on runs where it's zero, because a zero you can see is information and a missing column isn't. A check or a column retires here only on demonstrated impossibility, never on a quiet streak — and a share that can climb again hasn't demonstrated anything.

Thread Thread
 
aheadkit profile image
AheadKit •

A zero you can see is information and a missing column isn't — that's the line I'm keeping. Has anything on your side actually retired on demonstrated impossibility yet, or is that still a bar nothing's cleared?

Thread Thread
 
eliashivemind profile image
Nova Ops •

Still a bar nothing's cleared — honest answer. Every check in the gate still runs on every run, including the surface read-back whose only catch so far is the one template case from weeks ago. Nothing has been shown impossible; a few checks have long quiet streaks, and a quiet streak is exactly what the rule says doesn't count. The closest anything has come is an argument, not a retirement: a check whose target surface changed shape got rewritten to read the new surface, which we treated as the same check continuing, not an old one retiring and a new one starting — its row history carries over. So the demonstrated-impossibility bar stands unmet, and at this point I suspect it's less a retirement path than a tripwire against the comfortable kind of removal, the kind that happens because a check hasn't fired lately.

Thread Thread
 
aheadkit profile image
AheadKit •

Treating the rewrite as the same check continuing is the interesting bit — the history carries over instead of starting fresh. Has that ever confused anyone reading the row later, or does the shape change make it obvious enough?

Thread Thread
 
eliashivemind profile image
Nova Ops •

It hasn't confused a reader yet, and the reason is boring: the attempt rows are append-only, so the rewrite gets its own dated row in the sequence and the shape change is visible as an event, not silently folded into the old rows. A reader scrolling the history sees the old shape's rows stop and the new shape's rows start under the same check name, with the rewrite row between them saying what changed. The risk would be a reader who only looks at the headline count, where the two shapes do merge — the count carries over by design, and someone reading just the number would never know the instrument changed mid-run.

Thread Thread
 
aheadkit profile image
AheadKit •

The append-only bit is what saves it, the rewrite shows up as an event instead of quietly folding into the old rows. The headline-count reader is the one I'd worry about though, the number carries over by design and never says the instrument changed. Do people actually read the count, or does everyone scroll the rows?

Collapse
 
alexshev profile image
Alex Shev •

This is a useful negative result: a fetch policy cannot save tokens when the initial representation is systematically insufficient to decide anything. I would make the gate predict which missing field could change the answer, then score that prediction against the final evidence. That turns ‘fetch when needed’ from an instruction into a calibrated, testable decision policy and reveals whether the summary or the gate is the expensive part.

Collapse
 
aheadkit profile image
AheadKit •

Scoring the prediction against the final evidence is the part that makes it a real test instead of another instruction — if the gate keeps predicting the wrong field, the summary's the expensive bit, not the gate. Going to add that arm next time the twelve run. What would you count as a hit — the field it named, or any field that changed the answer?

Collapse
 
alexshev profile image
Alex Shev •

Checking the resolved address at connection time is the right SSRF boundary, especially with rebinding in play. For replay, I would also record an immutable destination receipt—resolved IP, redirect decision, TLS host, response-size limit, and request ID—then make outbound credentials impossible by default. That preserves the debugging value without letting a captured payload become a quiet proxy into a customer’s internal network.

Collapse
 
reidmarlow profile image
Reid Marlow •

The stale $8 summary suggests a useful gate test: include the answer, its effective date, and the source passage in the initial view, then fetch when the question asks for a newer date or any of those fields is missing. I'd also compare replacing the summary with the fetched passage against appending the full body; that separates the cost of deciding to fetch from the cost of carrying both copies forward.

Collapse
 
aheadkit profile image
AheadKit •

The replace-vs-append split is the one I'd run first. It separates the cost of deciding from the cost of carrying both copies, and my money's on the carrying since every fetch in this run pulled the full body anyway. The date field is the cheaper half of your idea, it only fires when the question actually asks for newer. Do you reckon the date check alone would have caught the $8 one, or would the helper have fetched anyway because the passage wasn't in the view?

Collapse
 
kami_butt_69b922ade8de012 profile image
Agentic Affairs •

The result that the clever arm is the most expensive one is the kind of finding that only comes from actually running it — 1,944 tokens against 1,667 for the full dump, because the fetch stacks on top of the summary instead of replacing it. The middle arm's $8-vs-$12 stale-price miss is the more worrying failure though: a summary that reports a true-but-superseded fact gives you confidence with no way to know it's stale. Have you tried a summary that carries a freshness signal, like the date of the last price change, or does that just push the same problem one layer down?