Recovering an AI Agent’s Transaction Observation After a Timeout A developer published a recovery pattern for AI agents whose transaction observation wait times out, using PriorSeal's TypeScript SDK to persist the transaction hash, chain ID, authorization ID and observation jobId so a restarted process can resume polling an existing job. The example's waitForObservationJob() call only polls a pre-existing observation job and never creates an authorization, signs, or broadcasts a transaction, and the writeup stresses that a timeout alone should never trigger a new trade. It also warns that a completed observation job does not by itself prove a trade succeeded or complied with its authorization, and that recovering historical evidence does not extend an authorization window. An agent submits a transaction, receives a transaction hash, and starts waiting for execution evidence. Then the client’s wait expires. What should the application preserve, and how can it continue observing the original transaction after a restart? Here is a small recovery example using PriorSeal’s TypeScript SDK. Save the original transaction hash, chain ID, and authorization ID when they become available. When observeExecution returns an observationJob , persist its jobId before continuing to wait. These identifiers let a restarted process locate the original operation. Store them in durable storage appropriate for your deployment. If the initial observation response was lost before a job ID was saved, the example below cannot resolve that missing identity. Reconcile the original operation using its known transaction and authorization references. A timeout alone should never trigger a new trade. This example requires an observation job that already exists. It only polls that job; it does not create an authorization, sign a transaction, or broadcast one. Use Node.js 22 or later: npm install priorseal-sdk npm install --save-dev tsx Save this as resume-observation.mts : js import { createPriorSealClient, PriorSealApiError, } from 'priorseal-sdk'; const jobId = process.env.PRIORSEAL JOB ID?.trim ; if jobId { throw new Error 'Set PRIORSEAL JOB ID to an existing observation job' ; } const priorseal = createPriorSealClient { baseUrl: 'https://priorseal.xyz', } ; try { const job = await priorseal.waitForObservationJob jobId, { timeoutMs: 30 000, pollIntervalMs: 2 000, } ; console.log JSON.stringify { jobId: job.jobId, jobState: job.state, observation: job.observation, result: job.result, error: job.error, }, null, 2 ; } catch error { if error instanceof PriorSealApiError && error.code === 'OBSERVATION WAIT TIMEOUT' { console.error 'Wait expired. Preserve this job ID for another observation attempt:', jobId, ; process.exitCode = 2; } else { throw error; } } Run it with your saved job ID: PRIORSEAL JOB ID='your-existing-job-id' npx tsx resume-observation.mts The polling interval and wait duration are example settings. If the wait expires again, preserve the same job ID. Schedule another observation attempt according to your application’s recovery policy. waitForObservationJob returns when the job reaches COMPLETED , UNDETERMINED , or FAILED . Those are observation-job states. Your application must inspect the execution observation, available result, receipt, and error separately. A completed observation job does not by itself establish that a trade succeeded or complied with its authorization. A receipt may also require independent verification against trusted issuer keys and additional chain-state checks. Keep pending, reverted, reorged, and uncertain execution states explicit in your records. Recovering historical evidence does not extend an authorization window. If the business needs a new transaction, the executor must apply the relevant submission-time policy and obtain valid authorization for that action. The recovery worker above has a narrower responsibility: continue investigating an existing operation. Before deploying an agent, check that: Which part of your agent’s recovery state currently exists only in memory?