How it works
The harness stores the task outside the request that happened to start it. A declaration id, the document still missing, and the last status sit in a record that survives the process. When a person replies two days later, or a customs feed changes, a new process loads that record and continues. The model call is short. The task is long. Treating the work as one HTTP request means the moment that request ends, the id and the wait are gone, and the next message looks like a brand new shipment.
Waiting is part of the design. The loop should record a pause and stop spending steps until a named event arrives, such as a file upload or a status poll that is actually due. A tight poll overnight burns the step budget and does not clear a document the broker has not sent. Restart also needs a rule for partial work. If the commercial invoice was already requested, the resumed agent should not request it again as though the first day never happened.
A worked example
Customs hold on S-17
On Monday an importer asks why shipment S-17 is held. The model calls get_declaration with S-17. The tool returns held, missing commercial invoice. The harness writes a task record: shipment S-17, waiting on invoice, requested Monday. It calls request_document and then pauses. The HTTP request that started the chat is long finished.
On Wednesday the importer uploads the invoice into the same task. A new process loads the record, sees S-17 and the outstanding document, and calls check_status. The tool returns the invoice attached and the hold still in review. It does not call request_document again.
On Thursday check_status returns released. The reply quotes S-17 and the release. The task record closes. Three calendar days, three short runs, one shipment.
Illustrative example, not a production trace and not a measured result.
What goes wrong
- The declaration id lives only in the Monday response body, the process exits, and on Wednesday the agent asks which shipment the importer means, as if Monday's request had never been stored.
- Instead of pausing, the loop calls check_status every few minutes through Monday night, hits the step budget, and never records that it is waiting for a document.
- Wednesday's upload starts a blank task, request_document fires again, and the broker receives a second demand for an invoice that is already attached.
How to measure it
Count tasks that resume with the same shipment id after a gap, and tasks that start over and ask for the id again. Record the pause reason and the event that woke the task.
Read resumes that repeat a request_document call. If the task record already showed the invoice requested, the restart ignored state. Also count step-budget stops that fell inside an overnight poll rather than on a real status change.
Further reading
How Abracadabra helps
The importer returns two days later and either continues on S-17 without repeating the whole story, or is asked to explain the shipment again from the beginning.
Abracadabra reads each conversation and labels the task, the step where it stopped, and signals such as repeated intents, user corrections and abandonment, pinned to the turn. After you change this part of the harness, compare task success for that task and cohort with the previous period. Experimentation and guarded rollouts are in early access.
Request access to read this on your own agent.