Skip to content

fix(drive_thru): call the ordering tool before confirming an order - #8902

Merged
longcw merged 1 commit into
mainfrom
longc/drive-thru-confirm-after-tool
Dec 2, 2026
Merged

longcw merged 1 commit into
mainfrom
longc/drive-thru-confirm-after-tool

Conversation

@longcw

@longcw longcw commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Problem: The drive_thru agent's LLM (google/gemma-4-31b-it) sometimes writes "lemme get that added", then the order result as text, with no tool call; after a tool error it writes "lemme try that again... got it!" with no second call. The evals drive_thru job fails about one run in five because of this, most often in "Ordering tool fails" (17 failures from Nov 25 to Dec 2).

Fix: Three existing prompt rules are reworded: the acknowledgment is followed by the call, the call comes before saying the change is done, and a tool error means nothing changed and the customer is asked to try again instead of the agent retrying in text. The model and the scenarios stay the same.

Context for reviewing and coding agents

How the failure looks in CI

Every failing transcript has the same shape: the acknowledgment text, then the confirmation in the same reply, with no [call] line. In the error scenario the model writes the retry as text after [error] order_regular_item -> An internal error occurred. The judge and the final-order check in simulation.py both catch it, so the eval is correct and the agent is wrong.

Where the numbers came from

A one-step test called Gemma directly with three chat contexts rebuilt from failing CI transcripts: after the tool error, after the customer names the combo drink, and the first Big Mac turn. With 40 samples per context, the main prompt gave 3/120 replies with no tool call or a false claim, and this prompt gave 0/120. A simulation of the four flaky scenarios × 10 copies × 3 samples (120 runs) passed 111/120 on main and passed in full with this prompt.

Wordings rejected

Removing the acknowledgment sentence made the error case worse (2/20 false claims). "Confirm only after the tool result comes back" fixed the error case but left 2/20 combo replies with no call. "Nothing changed" alone still let the model narrate a retry (1/20), and "rather than retrying yourself" removed it.

Why not change the model

gemma-4-31b-it stays as the example's model, so the fix is in the prompt only.

Gemma 4 31B sometimes wrote the spoken acknowledgment, then the order
result as text, with no tool call. After a tool error it narrated a
retry it never made. Reword the acknowledgment, tool-call and error
rules so the call comes before the confirmation and an error is
reported instead of retried in text.
@longcw
longcw requested a review from a team as a code owner December 2, 2026 08:14

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Devin Review: 1 flag

Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

@chenghao-mou chenghao-mou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@longcw
longcw merged commit 1657cf6 into main Dec 2, 2026
26 checks passed
@longcw
longcw deleted the longc/drive-thru-confirm-after-tool branch December 2, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants