# Helix 0.90.0: getContext returns PlatformContext

> `getContext()` now returns the canonical execution context, so request-specific fields are optional and need a presence check. Handler parameters are unaffected.

- Released: 6 Aug 2026 (2026-08-06)
- Packages: @trayai/helix-cli@0.90.0, @trayai/helix-sdk@0.90.0

## Headline changes

### Changed: `getContext()` returns `PlatformContext` instead of `TrayContext`

This is the change most likely to need an edit in your code. The members present in every execution are unchanged: `http`, `db()`, `kv()`, `files()`, `log`, `config`, `state`, `executionId`, `deploymentId`, and `traceId`. The request-specific ones are now optional, so check the field you read, for example `const ctx = getContext(); if (ctx.method !== undefined) { ctx.method; }`. That covers `input`, `method`, `path`, `headers`, `request`, `status()`, `error()`, `userId`, and `identity`. Handler parameters are untouched: a `defineFunction` handler still receives the exact `TrayContext`. Scheduled functions, added in 0.93.0, are the first trigger to depend on this: they run without a request, so the request-derived fields are absent.

Docs: https://helix.tray.ai/documentation/reference/functions/

## Other changes

### Changed

- `runWithContext` mocks mirror production for optional fields (docs: https://helix.tray.ai/documentation/reference/context/index/)
  Reading an unset optional `PlatformContext` field in a mock returns `undefined`, so presence-guard code is testable. Unset always-present fields still throw the descriptive error.
- Clearer error when `getContext()` is called outside an execution (docs: https://helix.tray.ai/documentation/reference/context/index/)

---

Canonical: https://helix.tray.ai/documentation/releases/0900/
This file: https://helix.tray.ai/documentation/releases/0900.md
The full changelog: https://helix.tray.ai/documentation/releases.md
