Reliability
Decide how agents behave when coordination is unavailable.
Availsync is a pre-flight coordination layer. It protects runs that call it before acting, but it is not a proxy that can stop an unintegrated agent or a process that ignores its lease.
If Availsync is unavailable
The SDK and MCP server surface the failure instead of pretending the resource is safe. In enforce mode, the recommended production policy is fail-closed: stop the agent run without editing files. In observe mode, teams may choose fail-open because observe-only runs do not create protective leases.
If fail-open loses a start response
Fail-open should be used deliberately. If the API creates a claim but the network drops before the agent receives the claim id, the agent cannot finish that claim and it remains active until the lease expires. Use fail-closed for production repo edits, deploys, migrations, and other protected work.
If a run is blocked
Blocked work runs return skip_run with a reason, retry_after, and the blocking claim summary. Scheduled jobs should exit successfully with the skip reason, not retry in a tight loop.
If a lease expires
Availsync treats expired claims as inactive after expires_at. Other agents can then claim the same resource. The original agent will not be stopped by Availsync automatically, so long-running jobs must watch expires_at, extend before expiry, or stop work before the lease elapses.
If finish fails
The Node SDK calls finish in finally when a real claim exists. If finish fails, the claim still expires at expires_at. Repeated finish calls are safe through the run API.
Recommended production default
Start pilots in Observe to measure risk. When you switch important repo/deploy agents to Enforce, treat Availsync errors as fail-closed and stop the run before touching files, deploying, or booking downstream systems.
Enforce mode: fail closed
try {
await availsync.work.withClaim('repo:owner/repo', { durationMinutes: 45 }, async () => {
await runAgent();
});
} catch (error) {
console.error('Availsync unavailable or rejected the run. Stop before editing files.');
process.exit(1);
}Observe mode: optional fail open
await availsync.work.withClaim(
'repo:owner/repo',
{ durationMinutes: 45, onUnavailable: 'proceed' },
async ({ unavailable }) => {
if (unavailable) console.warn('Running unguarded in observe/pilot mode.');
await runAgent();
},
);
