﻿# Claude EnvironmentWorker: reject a terminated session before resource downloads

What the TypeScript SDK termination check establishes before skill and memory downloads, and how to distinguish terminal state from a memory-resource error.

Author: Retrivium editorial team
Updated: 2026-11-18
Canonical URL: https://retrivium.ai/journal/daily-20261118-agent-claude-environmentworker-terminated-before-download/
Language: en

## A terminated session needs an early work boundary

Anthropic TypeScript SDK sdk-v1.10.0 was published on 17 November 2026 at 18:28:05 UTC. One delivered change makes EnvironmentWorker stop a work item after retrieving a terminated session, before downloading skills or memory stores. This article, published on 18 November, examines that placement of the check. It is not a claim that stopping a session can undo effects produced before its state was read or cancel every independent process associated with it.

## Resource acquisition is already meaningful work

A worker can do expensive or sensitive preparation before the actual tool function runs. Downloading a skill package, materializing memory or contacting a storage service consumes resources and crosses access boundaries. Therefore a test that merely proves the final tool body did not execute leaves part of the lifecycle unexamined. The useful question is whether the worker recognizes the session's terminal state before beginning those preparatory activities. Archived sessions also arrive as terminated in the described API contract.

## Separate terminal state from unavailable memory

The release removes SessionMemoryError from this terminated-session path. That distinction affects both support messages and recovery automation. Missing or inaccessible memory suggests a resource problem that might justify repair; a terminated session instead tells the worker that the work should not proceed. Treating both as one failure can trigger unnecessary downloads or retries. The operational explanation should identify the state boundary that ended the task, rather than imply that replacing a memory store would restore a deliberately closed session.

## Observe the preparation sequence with harmless stubs

A proposed acceptance fixture can return a terminated session from an owned session client and attach independent counters to skill download, memory download and tool execution. The expected outcome is that preparation does not begin after the state check. A second fixture with an active session verifies that the counters are reachable and the first test did not simply disable the worker. Include the archived representation as a separate input. These are proposed tests; Retrivium has not executed them against a live Claude service.

## Do not expand the result into retroactive cancellation

Another scenario can change session state after an earlier worker observation. Its purpose is to reveal the timing window, not to assume a stronger guarantee than the implementation provides. Record when state was retrieved, when preparation started and what cancellation mechanism the application actually owns. A passing early-check test does not establish that files already downloaded are erased, that external actions are reversed or that another worker received the same state immediately. Keeping those questions separate yields a useful migration record: terminal-state handling is tested at resource acquisition, while any stronger cleanup or revocation promise requires its own evidence.

## Sources

- [Primary source 1](https://github.com/anthropics/anthropic-sdk-typescript/releases/tag/sdk-v1.10.0)
- [Primary source 2](https://github.com/anthropics/anthropic-sdk-typescript/tree/sdk-v1.10.0)

## Related reading

- [Delegation and authority](/journal/frontier-space-subagent-permission-inheritance/)
- [Request lifecycle evidence](/journal/provider-request-id-trace-context/)
