u/Ambitious-Service45

My agent builds Google Forms from a sentence. Three things I got badly wrong.

I ship a Chrome extension where you type "make me a 10-question onboarding survey" and an agent writes the whole thing into Google Forms through the Forms API. Three things I got wrong building it, each of which cost real money before I noticed.

  1. Strict schema validation let a stuck model burn my budget.

My tool schema says requests is an array. On long batches the model would send the whole thing as a JSON string instead. I rejected it, which was correct, and which was also the mistake. The model can't see why it got rejected, so it rewrites the same payload smaller and smaller. One "add 20 questions" turn spent nine rounds and about 150k tokens before it gave up and told the user the API was broken.

Two fixes. Parse the string if it's a string, since that's unambiguous and costs nothing. And when you do reject something, name the mistake the model is actually making rather than handing back the parser error. "Expected double-quoted property name at position 827" tells it nothing it can act on. "Check that location sits INSIDE createItem next to item" tells it everything.

  1. A round cap is not a circuit breaker.

I had a max-rounds limit and it was far too loose to catch a model that's stuck. Nothing about the fourth identical failure is more informative than the third. I now stop after 3 consecutive tool failures, reset by any success, so a long correct run never gets punished. The final round tells the model it's the final round, so it explains itself to the user instead of dying silently.

  1. Retrying failed requests is usually wrong, with exactly one exception.

Never retry an HTTP error. The model already ran, you already paid, and you'll double-bill. But fetch rejecting with a TypeError means no response headers arrived at all, so the request never reached the server and nothing was billed. That single case is safe to retry, and it's the one that matters, because it's what a dropped connection looks like to your user.

Happy to go deeper on any of it.

reddit.com
u/Ambitious-Service45 — 13 hours ago

My extension writes Google Forms from a sentence. Describing what it did in 51 languages was the hard part.

I localized a Chrome extension into 51 languages this month. It turns a sentence into a Google Form, which means most of its UI strings describe edits it just made to your form. That turns out to be the worst possible kind of string to translate.

The translation itself was the easy part. What broke was the way I'd written the strings.

The worst one was a UI line that renders as `Add question at position 3`. In English you build it from a template: `Add {{what}} at position {{position}}`.

That falls apart in Russian, Turkish and Hindi. A trailing `{{position}}` after the noun forces a grammatical case the rest of the sentence can't carry, so the verb gets stranded or the noun needs a form the template can't produce. I spent a while trying to find one wording that worked across all three and still read naturally in English. There isn't one.

The fix was to stop composing mid-sentence. Front the position and cut it off with a colon: `Position 3: add question`. Each fragment then stands alone and every language inflects independently.

Separate problem, same file: arrows are bidirectional characters. I used `→` in a "moved item 2 → 5" string. U+2192 has `Bidi_Mirrored=Yes`, so Chrome flips it inside an Arabic or Hebrew run. That's correct behaviour, and it means pre-flipping it to `←` for RTL locales would be wrong twice over. Leave it alone and let the bidi algorithm work.

The other thing worth saying is that machine translation fails in specific, predictable ways. Real errors I caught on review:

- Russian: "every edit" came back as a word meaning "governance / board of directors"

- Turkish: locative where the sentence needed ablative, so "behind you" instead of "from behind you"

- French: a reflexive verb lost its pronoun, so "watch it build itself" became "watch it build"

- Portuguese: grammatically correct but spoken register, which reads wrong in a UI

None of those are detectable without a speaker. Budget for review, not just translation.

Also check your apostrophes. My French file came back with 9 curly apostrophes mixed in among 36 straight ones. Invisible in review, inconsistent in render.

reddit.com
u/Ambitious-Service45 — 14 hours ago