node5 runs a second instance in ns cursor-agent-api-n5 with its own
internal token and state PVC. Old deploy/010 stays until infra flips
node4's Kustomization path to ./deploy/node4-k3s (prune-safe sequence).
Cross-cluster mesh traffic arrives SNATed through the node2 kilo
gateway (10.4.2.1), not with the original node2 pod CIDR source —
confirmed via tcpdump on node4 kilo0. /32 on the gateway preserves the
outpost-only restriction while letting the Authentik proxy outpost
through.
Replace the local agent-cache COPY trick with a direct pinned download
from downloads.cursor.com (same package layout the official installer
uses). Optional HTTPS_PROXY build-arg covers egress-constrained build
hosts (socks5h:// works — curl honors it); CI runners with direct
egress omit it. Drop the now-unneeded agent-stage multi-stage plumbing.
Long thinking-heavy turns (multi-image vision extraction) legitimately
run >120s without emitting chunks; the idle TTL killed cursor-agent
mid-turn, surfacing to HTTP clients as an empty assistant turn.
- TURN_DEADLINE_MS (default 900s) applies while a prompt is in flight;
SESSION_TTL_MS (idle, 120s) applies between turns
- _touchTimer() re-arms on every session/update (chunks, thoughts)
- _finishTurn clears _promptInFlight and re-arms the idle TTL
Verified with the real 11-photo TTN replay that previously died with
'LLM stream returned empty assistant turn' after mid-turn TTL kills.
- normalizeToolChoice maps OpenAI tool_choice values to internal shapes
- required/named: prepend a mandatory-tool directive block; buffer text
deltas and only flush when a tool call actually arrives; on plain-text
turn, retry in-process with a nudge block (max 2 retries) instead of
emitting the violating text (streaming + non-streaming paths)
- none: prepend a no-tools directive
- unit tests for all new mapping/directive helpers (32 passing)
Verified live against cursor-agent ACP with model=auto: image+required
yields clean tool_calls chunks with no text pollution; follow-up turns
resolve parked MCP tool calls and retry on invalid observations.