Deployed 4bcc15df with MkDocs version: 1.6.1

This commit is contained in:
2026-11-29 23:50:33 +00:00
parent 2ea99e27f1
commit c14c48df8c
11 changed files with 347 additions and 240 deletions
+20 -17
View File
@@ -2836,7 +2836,7 @@ generally never touch this directly, but it explains behaviour you might observe
<tr>
<td>Auth/input timeout</td>
<td><strong>600s</strong> (10 min)</td>
<td>Sessions still authenticating or awaiting a prompt use this longer window instead of the TTL</td>
<td>A remote session that still logs in, a prompt included, can stay idle for the larger of the TTL and this value</td>
</tr>
<tr>
<td>Cleanup sweep</td>
@@ -2847,10 +2847,9 @@ generally never touch this directly, but it explains behaviour you might observe
</table>
<div class="admonition note">
<p class="admonition-title">Auth is never rushed</p>
<p>A remote session that is still <code>authenticating</code> or waiting on <code>pending_input</code> is
<strong>not</strong> subject to the short 300s TTL. It gets the full 600s auth window. This gives
you time to enter an interactive code without the remote session vanishing
mid-prompt.</p>
<p>A remote session that is still <code>authenticating</code> or waiting on <code>pending_input</code> can stay
idle for the larger of <code>session_ttl</code> and 600s. This gives you time to enter an interactive
code without the remote session vanishing mid-prompt.</p>
</div>
<p>The TTL and max-session limits are read from server config:</p>
<div class="language-yaml highlight"><span class="filename">unshackle.yaml (server)</span><pre><span></span><code><span id="__span-6-1"><a id="__codelineno-6-1" name="__codelineno-6-1" href="#__codelineno-6-1"></a><span class="nt">serve</span><span class="p">:</span>
@@ -3058,8 +3057,8 @@ layer.</p>
channel carries it, or the client polls while its own requests run. A call that no client fetches within 10 seconds
fails then, because no client is listening. A fetched call waits 60 seconds for its answer.
The call leaves the auth status as it was. An answer never marks the remote session as client-authenticated.</li>
<li><code>AUTH_INPUT_TIMEOUT = 600.0</code> seconds. This is also the TTL granted to
<code>AUTHENTICATING</code> sessions in the store. A remote session that waits on a prompt stays <code>AUTHENTICATING</code>.</li>
<li><code>AUTH_INPUT_TIMEOUT = 600.0</code> seconds. An <code>AUTHENTICATING</code> remote session expires in the store after
the larger of <code>session_ttl</code> and this value. A remote session that waits on a prompt stays <code>AUTHENTICATING</code>.</li>
</ul>
<p><code>GET /api/session/{id}/prompt</code> returns one of:</p>
<div class="language-json highlight"><pre><span></span><code><span id="__span-8-1"><a id="__codelineno-8-1" name="__codelineno-8-1" href="#__codelineno-8-1"></a><span class="p">{</span><span class="w"> </span><span class="nt">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"authenticated"</span><span class="w"> </span><span class="p">}</span>
@@ -3156,16 +3155,20 @@ request finds the remote session gone.</p>
take effect without recreating the store.</li>
<li><strong><code>create()</code></strong> evicts the least-recently-accessed remote session of the API key that holds the most when at capacity,
then stores a complete <code>SessionEntry</code> from the fields of the <code>create</code> handler and publishes the <code>create</code> event.</li>
<li><strong><code>get()</code></strong> refreshes <code>last_accessed</code> through <code>touch()</code>. It returns <code>None</code> (and
deletes the entry) if an authenticated remote session has been idle longer than the
TTL. Remote sessions in <code>AUTHENTICATING</code> are exempt from TTL expiry.</li>
<li><strong><code>cleanup_expired()</code></strong> runs every 60s: authenticated remote sessions expire at
<code>ttl</code>, in-flight-auth remote sessions expire at <code>AUTH_INPUT_TIMEOUT</code>. The removal of
a remote session cancels its <code>InputBridge</code> and deletes its cache directory (pruning
empty parent dirs up to, but not including, the cache root).</li>
<li>The server calls <strong><code>cancel_all_bridges()</code></strong> on shutdown. It ends each open remote session, which
unblocks any waiting auth threads, and deletes the cache directory of each one. The server then waits up
to 5 seconds for each login that still runs, and deletes its cache directory again when it ends.</li>
<li><strong>Expiry.</strong> <code>get()</code> and <code>cleanup_expired()</code> use one rule. A remote session that no request holds
expires when it is idle for longer than <code>ttl</code>. While its login runs (<code>AUTHENTICATING</code>), the limit is
the larger of <code>ttl</code> and <code>AUTH_INPUT_TIMEOUT</code>.</li>
<li><strong><code>get()</code></strong> refreshes <code>last_accessed</code> through <code>touch()</code>. It returns <code>None</code> and
deletes the entry when the remote session has expired.</li>
<li><strong><code>cleanup_expired()</code></strong> runs every 60s and removes each expired remote session.</li>
<li><strong>Removal.</strong> Eviction, expiry and <code>delete()</code> end the remote session the same way: they cancel its
<code>InputBridge</code>, close its channel, send the <code>delete</code> dashboard event, schedule a staged service reload
and delete its cache directory (pruning empty parent dirs up to, but not including, the cache root).</li>
<li><strong><code>track_login(task)</code></strong> keeps each login task of <code>session/create</code> until it ends.</li>
<li>The server calls <strong><code>close()</code></strong> on shutdown. It ends each open remote session, which
unblocks any waiting auth threads, and deletes the cache directory of each one. It sends no dashboard event
and schedules no reload. It then waits up to 5 seconds for each login that still runs, and stops the sweep.
A login that ends after the shutdown deletes its cache directory again.</li>
</ul>
<p><code>SessionEntry</code> fields:</p>
<table>