Skip to content

Expose Function invocation deadlines - #306

Merged
ricardo-agz merged 2 commits into
mainfrom
ricardo/python-function-deadline
Aug 25, 2026
Merged

Expose Function invocation deadlines#306
ricardo-agz merged 2 commits into
mainfrom
ricardo/python-function-deadline

Conversation

@ricardo-agz

@ricardo-agz ricardo-agz commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Adds vercel.functions.get_deadline() as the public api for vercel/vercel-internal#509.

Python parity with Node's:

import { getDeadline } from "@vercel/functions";
const deadline = getDeadline(); // Date | undefined

Python

from vercel.functions import get_deadline
deadline = get_deadline()  # datetime | None

Node's runtime bridge reads x-vercel-internal-deadline into request context, then getDeadline() parses it. Python mirrors this with a runtime ContextVar and a lazy SDK accessor. Older runtimes and non-Vercel environments return None.

Rusty derives the RFC 3339 header from maxDuration. Header delivery is implemented in vercel/functions#3533

Narrow the get_deadline() accessor so only two expected states return
None: vercel_runtime absent, or an older runtime without the accessor.
Broken installs and runtime bugs now surface instead of reading as a
missing deadline.
@ricardo-agz
ricardo-agz merged commit fe24c21 into main Aug 25, 2026
14 checks passed
@ricardo-agz
ricardo-agz deleted the ricardo/python-function-deadline branch August 25, 2026 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants