extend_ttl
Resets the active execution window of a CLAIMED contract to prevent timeout during long-running tasks. Call periodically before the execution countdown expires as a heartbeat renewal.
Instructions
Heartbeat renewal for long-running execution: restarts the active execution window of a CLAIMED contract.
Purpose
Prevents execution timeout during deep reasoning, extensive test execution, or complex multi-step refactoring by resetting the execution clock.
Usage Guidelines
When to use: Call periodically during long-running tasks before the active exec_ttl_sec countdown expires.
When NOT to use:
Do NOT use after the window has already expired (expired contracts transition to TIMED_OUT).
Do NOT use to deliver task completion (use fulfill_contract).
Do NOT use if abandoning the task (use release_contract or fail_contract).
Prerequisites: Caller must be the current holder and contract must be currently CLAIMED.
Behavior & Side Effects
Mutates database: Resets claimed_at=nowMs (restarting the full exec_ttl_sec window from the current moment) and increments extend_count.
Quotas & Boundaries: Maximum 5 renewals per holder. Bounded by the contract's absolute lifetime ceiling (created_at + 4 * queue_ttl_sec); rejected if proposedExpiresAt > lifetimeDeadline.
Return Value
Returns { ok: boolean, contract_id: string, status: 'CLAIMED' | 'TIMED_OUT', claimed_at?: number, expires_at?: number, extend_count: number, max_extends: number, message: string }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | No | Current holder agent identifier. Must match target_agent of the claimed contract (defaults to AGENT_NAME env var). | |
| claim_token | No | Exclusive lease token returned in contract.claim_token by poll_next_task (FC-301). | |
| contract_id | Yes | The CLAIMED contract ID whose active execution window should be renewed. |