Expand description
Session token resolution with file-backed fallback for hot-rotation.
Long-lived agent processes that embed ati as subprocesses inherit
ATI_SESSION_TOKEN at start and never see env updates. JWTs expire after
~3h, leaving the agent unable to call the proxy without a restart. The
file-backed path lets an external supervisor rotate the token atomically;
the next ati invocation picks up the new value transparently.
For a given env-var name <NAME>, resolution order (first non-empty wins):
<NAME>env var<NAME>_FILEenv var → file path- Default file path derived from
<NAME>(see [default_token_file])
Each call re-reads the file from disk — no in-process caching.
resolve_session_token is a thin wrapper for the default
ATI_SESSION_TOKEN. resolve_token takes an arbitrary env-var name so
per-provider tokens (e.g. PARCHA_TOOLS_SESSION_TOKEN) get the same
file-fallback + hot-rotation semantics — see issue #121.
Functions§
- resolve_
session_ token - Resolve the default session token (
ATI_SESSION_TOKEN). Thin wrapper aroundresolve_tokenpreserved for callers that don’t care about per-provider token selection (issue #121). - resolve_
token - Resolve a session token from env or a token file, for an arbitrary env var name. See module docs for the resolution order.