Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix(gcp-triage): classify clink-fun's MCP stream close as self-healing

nirholas65d6c4be8e48
diff --git a/docs/ops/production-log-triage.md b/docs/ops/production-log-triage.md
index c82f33dd5..20d45372a 100644
--- a/docs/ops/production-log-triage.md
+++ b/docs/ops/production-log-triage.md
@@ -1166,6 +1166,29 @@ ERROR 502 POST /api/pump/launch-agent
---
+## 🟢 `Truncated response body. Usually implies that the request timed out...` (clink-fun ONLY): `clink-mcp-stream-timeout`
+
+- **Source:** Cloud Run itself (`run.googleapis.com/varlog/system`), on the
+ `clink-fun` service (serves https://paired.exchange). Its image
+ (`clink/web`) builds from its own repository, not this one.
+- **What it means:** `/mcp` is an MCP streamable-HTTP endpoint. A client holds
+ the connection open until Cloud Run's 300 s request timeout closes the
+ response, and Cloud Run logs every response it closes that way. Measured
+ 2026-10-11: 4 of 4 sampled lines joined by `trace` to a `GET /mcp` request
+ that ran 300.99 to 301.00 s, status 200, user agent `rokmcp-collector/0.2`.
+ MCP clients reconnect on their own, so this is not a dropped session.
+- **Resolve:** 🟢 nothing required. To confirm a line, join it to its request:
+ `gcloud logging read 'trace="<trace from the warning>" httpRequest:*' --freshness=24h --format='value(httpRequest.requestUrl,httpRequest.latency)'`.
+ Investigate only if a trace lands on a route that is not `/mcp`.
+- **Scope note:** classified **only** for `clink-fun`. The same line from any
+ other service stays `investigate`, because there it can mean a handler that
+ never finished its response.
+- **Monitor signature:** `clink-mcp-stream-timeout` in
+ [scripts/gcp-triage.mjs](../../scripts/gcp-triage.mjs), `self-healing`
+ (service-scoped via its `services` field).
+
+---
+
## The owner runbook — every fix as an exact command
Everything red/yellow above, condensed to the actions only the owner can take,
diff --git a/scripts/gcp-triage.mjs b/scripts/gcp-triage.mjs
index 5b9119ac4..c8a66bc31 100644
--- a/scripts/gcp-triage.mjs
+++ b/scripts/gcp-triage.mjs
@@ -133,6 +133,17 @@ const KNOWN_SIGNATURES = [
class: 'self-healing',
action: `cryptocurrency.cv's /api/news/stream is a Server-Sent Events feed that stays open until Cloud Run's 300 s request timeout closes it; Cloud Run then logs the cut body. Every sampled line on 2026-10-08 (12 of 12) traced to that route at 300.99-301.00 s, and EventSource clients reconnect on their own. Investigate only if a trace lands on a non-streaming route: gcloud logging read 'trace="<trace>" httpRequest:*' --freshness=24h. ${RUNBOOK} §ccv-sse-stream-timeout.`,
},
+ {
+ // clink-fun's source lives in its own repository (image
+ // us-central1-docker.pkg.dev/aerial-vehicle-466722-p5/clink/web), not this
+ // one; this entry only documents what the fleet-wide log sweep already
+ // observes about it, scoped so it never masks the same line elsewhere.
+ id: 'clink-mcp-stream-timeout',
+ match: /Truncated response body\. Usually implies that the request timed out/i,
+ services: ['clink-fun'],
+ class: 'self-healing',
+ action: `clink-fun serves an MCP streamable-HTTP endpoint at https://paired.exchange/mcp that stays open until Cloud Run's 300 s request timeout closes it; Cloud Run then logs the cut body. Every sampled trace on 2026-10-11 (4 of 4) was GET /mcp at 300.99-301.00 s, status 200, and MCP clients reconnect on their own. Investigate only if a trace lands on a non-streaming route: gcloud logging read 'trace="<trace>" httpRequest:*' --freshness=24h. ${RUNBOOK} §clink-mcp-stream-timeout.`,
+ },
{
id: 'helius-backoff',
match: /helius quota|rate.?limited|refresh deferred \(transient upstream\)/i,
diff --git a/tests/gcp-triage.test.js b/tests/gcp-triage.test.js
index 77671b2c3..75cc8ae3b 100644
--- a/tests/gcp-triage.test.js
+++ b/tests/gcp-triage.test.js
@@ -50,6 +50,15 @@ describe('gcp-triage classify', () => {
expect(classify(line, [])).toBeNull();
});
+ it('classifies a truncated body as the MCP stream timeout only on clink-fun', () => {
+ const line = 'Truncated response body. Usually implies that the request timed out or the application exited before the response was finished.';
+ const onClink = classify(line, ['clink-fun']);
+ expect(onClink?.id).toBe('clink-mcp-stream-timeout');
+ expect(onClink?.class).toBe('self-healing');
+ expect(classify(line, ['three-ws-api'])).toBeNull();
+ expect(classify(line, [])).toBeNull();
+ });
+
it('classifies a bare SIGKILL as the trellis OOM only on model-trellis', () => {
const line = 'Container terminated on signal 9.';
const onTrellis = classify(line, ['model-trellis']);