Lease Work Runner (server/request-lease-work.ts)

agent-device · packages/daemon/src/server/request-lease-work.ts · typescript · MIT
infra, tag:lease, tag:request, tag:protection

Executes admitted requests under lease protection to prevent premature lease expiry

// Source: https://github.com/callstack/agent-device | License: MIT | Copyright 2026 Callstack
// Provided via justclaw.it.com; keep this notice with the code.
import { isRequestCanceled } from '@agent-device/host-kit/request';
import { isHumanControlMutation } from '../core/daemon-command-registry.ts';
import type { LeaseRegistry } from '../resources/lease-registry.ts';
import type { DaemonRequest } from '../core/daemon-request.ts';

/**
 * Runs one admitted request's work under the protection of its lease.
 *
 * A lease renews when a request is admitted and never again while that request
 * works, so the slowest command in a session used to expire the very lease that
 * was paying for the device and tear the session down underneath the client still
 * waiting for its result. The pass def

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key