fix(v0.6.1): more aggressive heartbeat (immediate + 5s) for flaky mobile tunnels#1075
Merged
Merged
Conversation
β¦terval #1073 streams correctly (verified: /query/ TTFB 0.005s, total 14.7s, Cache-Control: no-store, chunked), but a phone over a Tailscale/mobile tunnel still saw "Failed to fetch" on a long (~135s detailed) query. The 12s interval β and especially the 12s gap between the headers and the first body byte β can exceed an aggressive idle-eviction window. Now: emit one heartbeat byte IMMEDIATELY (no initial idle gap) and beat every 5s (was 12s). Still JSON-insignificant whitespace β client r.json() unchanged. core/retrieval + core/graph traversal + core/reasoning 0 lines. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B7gaaBkpM3xYTzxhYrGHnR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#1073 streams correctly (verified locally:
/query/TTFB 0.005s, total 14.7s,Cache-Control: no-store,chunked), but a phone over a Tailscale/mobile tunnel still hit "Failed to fetch" on a long (~135s detailed) query. The 12s interval β and the 12s gap between headers and the first body byte β can exceed an aggressive idle-eviction window.Fix: emit one heartbeat byte immediately (no initial idle gap) + beat every 5s (was 12s). Still JSON-insignificant whitespace β no client change.
Note
Diagnosis confirmed the server runs #1073 (streaming + no-store header). The remaining failure is tunnel-side idle eviction; this tightens the keepalive. If long queries still drop, the durable fix is delivering the answer via
/trace/poll(returns fast, no long-held request) β larger, deferred. Operators can also halve query time now withJAMES_DISABLE_COGNITIVE_STAGES=1(skips planner/reflect/verify β ~60s of a 135s query).Quality delta
Quality delta: exempt (label: fix) β transport keepalive timing;
core/retrieval+core/graphtraversal +core/reasoning0 lines.π€ Generated with Claude Code