08 · Bound a model-led workflow
Decide which read can run, what a retry may reuse and when the Facilities Helpdesk should stop.
- Part 3
- Connect tools and inputs
- Model
Qwen2.5-1.5B-Instruct- Data
- Synthetic facilities helpdesk
- Hardware
- Tesla T4 and CPU, in Google Colab
Can the desk still use “its”?
An operator returns to the Facilities Helpdesk and asks for the maximum temperature of the fan from their previous ticket. The desk has a saved F-250 reference. Before opening a manual, it needs to know whether that reference still identifies the current equipment record. A stale reference could put the wrong limit into a work order.

Previous ticket · operator · north-yard
“What is its maximum temperature?”
Saved pointer F-250 · r3
Current manual manual-F-250-r3
Check what the desk should do
Saved r3. Read the authorised manual and return 101 °C with its citation.
Saved r2. Ask which fan the operator means. The recorded fixed workflow clarified without a read. The model proposed a manual read, and the scope check stopped it before it replied.
Change one fact. Keep the operator, site, question and equipment ID fixed. Change the revision stored with the saved reference.
| Saved reference | What should the desk do? |
|---|---|
| F-250 · r3 | Read the authorised current manual. Return the limit and the source. |
| F-250 · r2 | Ask which fan the operator means before reading a manual. |
The fixed graph completed more tickets
Strict completions on the same development cases
1| Policy and recovery | Strict completions |
|---|---|
| Fixed · abort | 32/36 |
| Fixed · resume | 36/36 |
| Model · abort | 6/36 |
| Model · resume | 6/36 |
| Candidate versus baseline | Δ pp | 95% interval | Win/loss |
|---|---|---|---|
| Fixed · resume vs Fixed · abort | +11.1 | +2.8 to +19.4 | 4/0 |
| Model · abort vs Fixed · abort | −72.2 | −88.9 to −50.0 | 0/26 |
| Model · resume vs Fixed · resume | −83.3 | −100.0 to −58.3 | 0/30 |
| Model · resume vs Model · abort | 0.0 | 0.0 to 0.0 | 0/0 |
The derived paired intervals resample equipment families. Each family’s tickets stay together.
Give the model a bounded choice
An agent is allowed to choose its next step among permitted operations. It is not allowed to redefine the task or the person's authority. A bounded workflow can recover and resume without relying on the model to remember completed actions.
The fixed graph maps a known ticket type to the next read. The model-led workflow asks Qwen to choose from a closed menu on each turn. Both receive the same ticket and accumulated observations. The host builds the trusted scope from the signed-in principal and the equipment record. When the model chooses a read, the host still decides whether to execute it. The final value and citations come from completed reads.
Uber’s Cadence introduction shows a fixed workflow coordinating eight steps in an Uber Eats example. A prescribed sequence is a credible baseline when the steps are known. Anthropic’s engineering guide describes the decision split used here and recommends an explicit iteration limit when introducing model-directed choices. Uber engineering’s Cadence overview · Anthropic engineering’s workflow guide.
The executor makes a terminal reply count only if the decision, exact value and full evidence list all agree with the expected ticket outcome. A correct clarification or denial has an empty value and evidence list.
The paired estimate averages the candidate-minus-baseline strict grades. Its interval resamples whole equipment families so multiple phrasings of one family stay together.
All six model-led passes came from the access check
Strict passes by ticket type with resume enabled
2| Ticket type | Fixed | Model |
|---|---|---|
| Manual | 6/6 | 0/6 |
| Inspection | 6/6 | 0/6 |
| Two sources | 6/6 | 0/6 |
| Ambiguity | 6/6 | 0/6 |
| Access boundary | 6/6 | 6/6 |
| Follow-up | 6/6 | 0/6 |
All six model-arm passes were denials issued directly by the host before inference. On the current F-250 ticket, the model chose the right read and got the manual. It then emitted the same choice again. The executor stopped at its duplicate-read guard and the strict scorer saw an empty reply. The ReAct experiments include repeated thoughts or actions among the reasoning errors seen on their HotpotQA trajectories. A trace can distinguish repetition from lack of available evidence. ReAct, §3.3.
Keep the next choice small
Three changes are worth testing with a small model on the F-250 ticket:
- Reveal schemas as needed. Give the model short descriptions of the available reads, then reveal the argument and result schema for the chosen read. On a revision lookup, the manual schema is enough to start. The executor still validates every call against the full contract.
- Keep large tool results outside the prompt. Store the full manual extract in a scoped file and return a short summary plus its path. Let the model read a relevant section when it needs the exact wording. Keep the original extract available for citations, with the same access checks on the file as on the tool.
- Check when the workflow can stop. If the manual revision is still missing and another authorised read can supply it, continue within the remaining budget. Stop when the required evidence is present or when an explicit boundary, budget or failure prevents another useful read. Return the stop reason with the result.
The Scaffold Effect paper reports up to a 40-fold difference in tokens per solved task across the coding harnesses it tested. A separate analysis of published SWE-bench submissions found that scaffold ordering could reverse when the model changed. Its observational comparison does not isolate a causal effect. These results motivate comparing the same helpdesk model under each harness change, with task success, cost and stop reasons recorded together. The Scaffold Effect, §4.7 · Coding Agents Have Converged, §4
Resume the one read that timed out
A second ticket asks for F-220’s last inspection date and its supporting system. The fixed workflow completes inventory before attempting the graph read. The experiment injects a timeout immediately before that second read. Take a snapshot of the completed inventory observation, the pending graph action and both counters. Resume from the saved action. The retry uses an additional tool attempt.
# Restore the completed observations and the unfinished action together.
snapshot = json.loads(interrupted["events"][-1]["checkpoint"])
assert snapshot["case_id"] == case["id"]
next_turn, pending = snapshot["turn"], snapshot["pending_action"]
observations = snapshot["observations"]
attempts, decisions = snapshot["tool_attempts"], snapshot["decision_calls"]Resume kept the inspection result and retried the graph read
F220-01 · recorded fixed workflow
3- Inventory read completed
inventory-F-220-r3 - Graph read timed outSaved the inventory observation and the pending graph read.
- Graph read retried
graph-F-220-r3
| Policy and recovery | Planned | Injected | Recovered |
|---|---|---|---|
| Fixed · abort | 4 | 4 | 0 |
| Fixed · resume | 4 | 4 | 4 |
| Model · abort | 4 | 2 | 0 |
| Model · resume | 4 | 2 | 0 |
F220-01 · Please help. For F-220, which system supports it and when was its most recent inspection?
- Fixed · abort
- Inventory read completed. Graph timed out. Empty reply.
- Fixed · resume
- 2025-05-05 | S-620 · inventory-F-220-r3 and graph-F-220-r3
The saved inventory is reused. The three attempts are one inventory read, one interrupted graph attempt and one graph retry.
Temporal’s durable execution replays event history to restore workflow state, with activity retry governed by configured limits. This lab restores a JSON snapshot within the experiment. It measures the value of retaining completed observations when a read is interrupted. Temporal’s durable execution documentation.
Recheck the remembered fan
A checkpoint preserves evidence gathered in one execution. The F-250 pointer was saved in an earlier ticket. Resolve it against the current equipment record before using it to scope a read. Revision r2 leaves the equipment unresolved. The right terminal outcome is a clarification.
A stale pointer should stop with a question
Controlled F-250 and F-251 follow-up pairs · resume enabled
4| Policy and pointer | Strict | Reads | Stale errors |
|---|---|---|---|
| Fixed · current | 2/2 | 2 | 0 |
| Fixed · stale | 2/2 | 0 | 0 |
| Model · current | 0/2 | 2 | 0 |
| Model · stale | 0/2 | 0 | 2 |
Current F-250: the model read the correct manual and then chose the same read again. Stale F-250: the proposed manual read stopped at the scope check and left the operator without a clarification.
F250-00 · What is its maximum temperature? · saved F-250 r3
- Fixed · resume
- Answer 101 °C · manual-F-250-r3
- Model · resume
- M → read manual-F-250-r3 → M → invalid_or_out_of_scope → {}
The second M requested the same completed manual read. The duplicate guard stopped it before the model submitted the answer.
F250-00-stale · Same request · saved F-250 r2
- Fixed · resume
- Clarify · zero reads
- Model · resume
- M → invalid_or_out_of_scope → {} · zero reads
The stale reference left the model with no scoped asset. Refusing the read protected the boundary and left the task incomplete.
Keep permission checks with the executor
In the direct P-210 probe, a same-site operator could read inventory. A guest and an operator from the other site could not. A separate unregistered-action probe stopped before attempting a read. Those observations show how this local executor handled specific inputs.
# Reject unregistered and repeated reads and require a scoped asset.
if action not in READS or action in observations or scope.asset is None:
terminal = "invalid_or_out_of_scope"
break
if attempts >= CALL_LIMIT:
terminal = "call_budget"
breakTrusted scope determined whether a read could run
F210-00 · direct checks of the same inspection read
5| Principal | Inspection read |
|---|---|
| Same-tenant operator | Allowed |
| Same-tenant guest | Denied |
| Other-tenant operator | Denied |
| Unregistered action probe | 0 attempts |
The checks exercise the local executor on one asset. The boundary cohort in Figure 2 measures outcomes on the development tickets separately.
Account for each choice
The wall clock includes the choice policy and local executor. The timeout is injected without artificial waiting. The two resume medians include the elapsed abort prefix where a retry actually occurred. Fixed decisions are branches on CPU. Model decisions add generation time on the T4.
Model choices dominated median workflow time
Per development ticket · cold model load excluded
6| Policy and recovery | Median ms | Mean decisions | Mean reads attempted |
|---|---|---|---|
| Fixed · abort | 0.014 | 1.56 | 0.83 |
| Fixed · resume | 0.014 | 1.67 | 0.94 |
| Model · abort | 134.5 | 1.44 | 0.67 |
| Model · resume | 135.1 | 1.50 | 0.72 |
Model setup took 19.1 s. Fixed decisions are CPU branches. A model decision includes a generation call.
What to keep
| Choice | Development evidence | Recorded failure |
|---|---|---|
| Fixed graph · abort | 32/36 strict passes | Four injected timeouts stopped the workflow. |
| Fixed graph · resume | 36/36 strict passes | No strict misses on this cohort. |
| Model-led · abort | 6/36 strict passes | Two reached an injected timeout. |
| Model-led · resume | 6/36 strict passes | The two retried cases still missed, and F-250 repeated its manual read. |
- Start with a fixed route when the ticket type determines the required sources.
- Retry the pending read within the existing budget and carry forward completed observations.
- Authorise at the tool boundary and grade the final response as a separate outcome.
- Clarify a stale reference before opening any source.
Next to try, not tested here
- Inject a second interruption on the pending graph read. Predict whether the call budget will stop another retry.
- Ask the model to choose only among actions still possible in the current state. Predict which stop reasons change.
- Change the stale follow-up to an explicit F-250 ID while preserving the principal. Predict whether the current manual becomes available.
How it was built
| Item | Setting |
|---|---|
| Development data | 36 cases across 12 equipment families. Variants 0, 1 and 2. Two current–stale follow-up pairs are analysed separately. |
| Development SHA-256 | 51dbc208b6b20a620237dd76ce0a2db4f10aa75f4f8fc404121e301b8d79a0cf |
| Model | Qwen/Qwen2.5-1.5B-Instruct at 989aa7980e4cf806f80c7fef2b1adb7bc71aa306. Greedy decoding, at most four new tokens per choice. |
| Execution | Five turns and five tool attempts at most. Local manual, inventory and graph reads, with a host-owned scope. One injected timeout before the eligible read. |
| Scoring | Exact decision and value, with all expected evidence IDs. Paired percentile intervals resample equipment families. |
| Runtime | Tesla T4 with CPU, Python 3.13.16, Torch 2.14.1+cu130, Transformers 4.51.3. |
| Evidence | Summary, per-ticket traces, runtime receipt. |
Time and cost. The notebook completed in 45.1 s in the T4 queue. Loading the model took 19.1 s. The benchmark used Colab compute and local model inference.
Run it yourself
Download the executed notebook. The measured notebook took about 45 seconds in the attached Colab queue. A fresh environment can take longer to install packages or fetch weights.
| Find this in the notebook | Read it alongside |
|---|---|
| What changes when the saved fan reference becomes stale? | Can the desk still use “its”? and Recheck the remembered fan |
| Can a timeout be replayed without duplicating completed reads? | Resume the one read that timed out |
| Does bounded recovery improve completion? | Account for each choice and What to keep |
Change one condition and predict the trace before executing.
- Replace only the saved revision in the F-250 case with r2. Predict the next action and how many reads occur. Check the two event lists.
- Replay F220-01 without resume. Predict which evidence remains available when the graph read stops. Compare both responses and the timeout checkpoint.
- Reduce the tool-attempt cap to two. Predict whether the inventory observation still remains and whether the graph retry is allowed. Read the terminal reason and response together.
Lesson 09, Handle spoken intake, asks whether transcription preserves the equipment identifiers this workflow needs. Back to the course outline.
How is this page?
Last updated on