Deployment, persistent state and cost 00:00:01 Run seventy-three arrives twice A worker loses its lease after step four, while the courier puts run seventy-three back on the queue. Two deliveries now refer to the same intended job. Pushing the run counter back to one would hide the incident without proving what actually happened. Long-running agents need durable state, scheduling and explicit ownership of effects. A queue or worker can retry a task after losing contact, while the previous attempt may already have committed part of the work. Model calls are only one component of runtime cost. Track the delivery attempt separately from the operation identity and committed result. The replacement worker can recover progress, inspect the ledger and continue from the first incomplete effect. 00:00:46 Set a real cost and time bound Short synchronous tasks can run within a request. Long-running or interruptible tasks need durable state and often a queue. Decide what happens when the user disconnects and who owns cancellation. A worker restart should recover a pending task without silently repeating its external effects. Disconnect a client after submitting a long-running job. Verify whether the documented contract cancels the run or allows it to resume. Persist run identity, state version, pending operations and approvals. Use concurrency control so two workers cannot both advance the same checkpoint unchecked. A resumed worker should read the committed operation ledger before deciding whether to retry a write. Two workers read checkpoint 5. A compare-and-set advance lets only one commit checkpoint 6 with the corresponding business operation. Connect model calls, tool executions, checkpoints and handoffs using a shared trace identity. Preserve safe input and outcome summaries and version identifiers. A slow task may be dominated by queue time rather than generation. Inspect spans before changing the model or prompt. Join spans from the request, retrieval, model and write. Compare their wall times and account for branches that run concurrently. Trace attempts under a stable run identity. Correlate queue time, model calls, tools, checkpoints and business outcomes to determine whether a slow or expensive task needs a different prompt, a different scheduler or a state-recovery fix. 00:02:21 Follow the lease and operation ledger Delivery can repeat if a worker loses its lease. Attach a run identity, deadline and step budget to the job. Acquire or compare the state version before advancing. Recover prior external results using the operation ledger. A trace connects both attempts to the same run. Compare queue dwell, model time and tool time before optimizing the slowest path. 00:02:44 Count deliveries or count effects? A dashboard reports two deliveries. What distinguishes a harmless retry from a duplicate business action? Several attempts can belong to one run, but the durable business ledger reveals whether the action happened once or twice. Count attempts to understand load. Count distinct committed effects to understand the business outcome. Deadlines and shared retry budgets keep a recoverable run from consuming the whole queue.