Merge pull request #4141 from nesquena/stage-4139
Some checks failed
Release & Docker / release (push) Has been cancelled

Release NI (v0.51.396): longer timeout for full-history session loads (#4139)
This commit is contained in:
nesquena-hermes
2026-06-13 13:53:12 -07:00
committed by GitHub
3 changed files with 21 additions and 1 deletions

View File

@@ -3,6 +3,12 @@
## [Unreleased]
## [v0.51.396] — 2026-06-13 — Release NI (longer timeout for full-history session loads, #4139)
### Fixed
- **Full-history session loads now use an extended client timeout.** Actions that intentionally fetch the entire transcript (fork/export/start-jump helpers) can legitimately take longer than the default API timeout on very large sessions; the WebUI now gives that path up to 120 seconds instead of showing a premature "Request timed out" toast while the backend is still working. (#4139)
## [v0.51.395] — 2026-06-13 — Release NH (push source filters into agent session scans, #3930)
### Fixed

View File

@@ -2470,7 +2470,7 @@ async function _ensureAllMessagesLoaded() {
_loadingOlder = true;
try {
const sid = S.session.session_id;
const data = await api(`/api/session?session_id=${encodeURIComponent(sid)}&messages=1&resolve_model=0`);
const data = await api(`/api/session?session_id=${encodeURIComponent(sid)}&messages=1&resolve_model=0`, {timeoutMs:120000});
// Guard: api() may have redirected (401) and returned undefined.
if (!data || !data.session) return;
// Session may have been switched while we awaited. Bail rather than

View File

@@ -160,6 +160,20 @@ def test_ensure_all_resets_oldest_idx_to_zero():
)
def test_ensure_all_messages_uses_extended_timeout_for_full_history_load():
"""Full-history loads for fork/export/start-jump can legitimately exceed the API default timeout."""
body = _function_body(SESSIONS_JS, "_ensureAllMessagesLoaded")
full_history_call = re.search(
r"api\((?P<url>`[^`]*messages=1&resolve_model=0[^`]*`)\s*,\s*\{(?P<opts>[^}]*)\}\s*\)",
body,
re.S,
)
assert full_history_call, "_ensureAllMessagesLoaded must pass options to the full-history api() call"
timeout_match = re.search(r"timeoutMs\s*:\s*(\d+)", full_history_call.group("opts"))
assert timeout_match, "Full-history api() call must specify timeoutMs"
assert int(timeout_match.group(1)) >= 120000
# ---------------------------------------------------------------------------
# Short-session / full-transcript behaviour preserved
# ---------------------------------------------------------------------------