GeezerVison is showing github.com — fix(server): relay tracing waits for the desktop shell environment before exporting by juliusmarminge · Pull Request #42464 · pingdotgg/t3code
Conversation
Problem
The desktop app starts its backend with T3CODE_DESKTOP_SHELL_DISCOVERY_PENDING=1 when it has not yet read the user's login shell (first launch, no shell-env cache). Product analytics waits for discovery and then honors the shell's T3CODE_TELEMETRY_ENABLED, but relay tracing decided once at module load. A T3CODE_TELEMETRY_ENABLED=false in ~/.zshrc was therefore ignored: the backend exported relay spans to Axiom for the whole process, and ws.ts told browsers relay tracing was allowed.
Fix
Reuses AnalyticsService's mechanism: desktop shell discovery mutates the HostProcess.Environment record in place and drops the pending flag when it finishes.
RelayTracing.allowedFor now returns false while discovery is pending, then follows the real opt-out.
relayLayer passes isEnabled: () => allowedFor(environment, undefined) to the shared RelayTracing.layer (the gate mobile already uses), so spans and flushes are checked against the live environment. The managed policy is still applied once, when the layer is built, as it was before.
ws.ts computes relayTracingAllowed each time it builds the server config, not once per connection.
Verification
- New regression test in
apps/server/src/cloud/relayTracing.test.ts: it starts with discovery pending, then applies a shell opt-out and checks that nothing is exported. It fails on main (expected true to be false). With only the allowedFor half of the fix it also fails (expected 1 to equal +0: a span was exported), so both halves are covered.
vp test run src/cloud/relayTracing.test.ts passes, and vp run check:changed passes (format, lint, knip, typecheck, tests).
Claude Opus 5.5 via Claude Code in T3 Code.
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…fore exporting
On desktop first launch the backend starts before the login-shell
environment is known, so a ~/.zshrc T3CODE_TELEMETRY_ENABLED=false was
ignored and relay spans were exported for the whole process. The relay
exporter now rereads the host environment per span (like product
analytics), staying off while T3CODE_DESKTOP_SHELL_DISCOVERY_PENDING is
set, and ws.ts reports the same live value to browsers.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Thread transfer impact
✅ Thread transfer remains within every enforced ceiling.
ℹ️ The exact PR base did not have a successful artifact. Baseline uses the latest successful main measurement shown below.
| Provider |
Metric |
Main baseline |
This PR |
Impact |
PR ceiling |
|
| Codex |
Total thread wire |
5.0 KiB |
5.0 KiB |
0 B (0.0%) |
6.8 KiB |
✅ |
| Codex |
Thread snapshot wire |
3.8 KiB |
3.8 KiB |
0 B (0.0%) |
4.9 KiB |
✅ |
| Codex |
Live turn WebSocket wire |
1.2 KiB |
1.2 KiB |
0 B (0.0%) |
2.0 KiB |
✅ |
| Codex |
Live turn WebSocket decoded |
21.5 KiB |
21.5 KiB |
0 B (0.0%) |
24.4 KiB |
✅ |
| Codex |
Live turn messages |
1 |
1 |
0 (0.0%) |
8 |
✅ |
| Claude |
Total thread wire |
5.0 KiB |
5.0 KiB |
0 B (0.0%) |
6.8 KiB |
✅ |
| Claude |
Thread snapshot wire |
3.8 KiB |
3.8 KiB |
0 B (0.0%) |
4.9 KiB |
✅ |
| Claude |
Live turn WebSocket wire |
1.2 KiB |
1.2 KiB |
0 B (0.0%) |
2.0 KiB |
✅ |
| Claude |
Live turn WebSocket decoded |
21.9 KiB |
21.9 KiB |
0 B (0.0%) |
24.4 KiB |
✅ |
| Claude |
Live turn messages |
1 |
1 |
0 (0.0%) |
8 |
✅ |
Other scenarios
All 64 scenario measurements match main.
All 64 scenario measurements
| Provider |
Scenario |
Metric |
Main baseline |
This PR |
Impact |
PR ceiling |
|
| Codex |
short turn resume |
WebSocket decoded |
10.5 KiB |
10.5 KiB |
0 B (0.0%) |
12.7 KiB |
✅ |
| Codex |
short turn resume |
WebSocket messages |
2 |
2 |
0 (0.0%) |
2 |
✅ |
| Codex |
long turn running, cold open |
HTTP decoded |
281.7 KiB |
281.7 KiB |
0 B (0.0%) |
302.7 KiB |
✅ |
| Codex |
long turn running, cold open |
rows |
75 |
75 |
0 (0.0%) |
75 |
✅ |
| Codex |
long turn running, history page |
HTTP decoded |
92.4 KiB |
92.4 KiB |
0 B (0.0%) |
107.4 KiB |
✅ |
| Codex |
long turn running, history page |
rows |
75 |
75 |
0 (0.0%) |
75 |
✅ |
| Codex |
long turn finished, cold open |
HTTP decoded |
381.5 KiB |
381.5 KiB |
0 B (0.0%) |
410.2 KiB |
✅ |
| Codex |
long turn finished, cold open |
rows |
151 |
151 |
0 (0.0%) |
151 |
✅ |
| Codex |
long turn finished, socket cold open |
WebSocket decoded |
381.6 KiB |
381.6 KiB |
0 B (0.0%) |
410.2 KiB |
✅ |
| Codex |
long turn finished, socket cold open |
WebSocket messages |
2 |
2 |
0 (0.0%) |
2 |
✅ |
| Codex |
long turn finished, socket cold open |
rows |
151 |
151 |
0 (0.0%) |
151 |
✅ |
| Codex |
long turn finished, work page |
HTTP decoded |
186.2 KiB |
186.2 KiB |
0 B (0.0%) |
200.2 KiB |
✅ |
| Codex |
long turn finished, work page |
rows |
150 |
150 |
0 (0.0%) |
150 |
✅ |
| Codex |
idle thread resume |
WebSocket decoded |
65 B |
65 B |
0 B (0.0%) |
200 B |
✅ |
| Codex |
idle thread resume |
WebSocket messages |
1 |
1 |
0 (0.0%) |
1 |
✅ |
| Codex |
fleet shell snapshot |
HTTP decoded |
42.4 KiB |
42.4 KiB |
0 B (0.0%) |
53.7 KiB |
✅ |
| Codex |
fleet shell snapshot |
rows |
27 |
27 |
0 (0.0%) |
27 |
✅ |
| Codex |
fleet shell subscribe |
WebSocket decoded |
65 B |
65 B |
0 B (0.0%) |
200 B |
✅ |
| Codex |
fleet shell subscribe |
WebSocket messages |
1 |
1 |
0 (0.0%) |
1 |
✅ |
| Codex |
fleet shell resume check |
HTTP decoded |
18 B |
18 B |
0 B (0.0%) |
100 B |
✅ |
| Codex |
fleet shell resume check |
rows |
0 |
0 |
0 |
0 |
✅ |
| Codex |
stale shell reload |
HTTP decoded |
42.4 KiB |
42.4 KiB |
0 B (0.0%) |
53.7 KiB |
✅ |
| Codex |
stale shell reload |
rows |
27 |
27 |
0 (0.0%) |
27 |
✅ |
| Codex |
stale shell resume |
WebSocket decoded |
140 B |
140 B |
0 B (0.0%) |
400 B |
✅ |
| Codex |
stale shell resume |
WebSocket messages |
2 |
2 |
0 (0.0%) |
2 |
✅ |
| Codex |
stale todo list cold open |
HTTP decoded |
72.4 KiB |
72.4 KiB |
0 B (0.0%) |
83.0 KiB |
✅ |
| Codex |
stale todo list cold open |
rows |
75 |
75 |
0 (0.0%) |
75 |
✅ |
| Codex |
stale todo list cold open |
nodes |
2 |
2 |
0 (0.0%) |
4 |
✅ |
| Codex |
stale todo list cold open |
subagents |
2 |
2 |
0 (0.0%) |
4 |
✅ |
| Codex |
stale todo list cold open |
plans |
1 |
1 |
0 (0.0%) |
2 |
✅ |
| Codex |
stale todo list cold open |
providerTurns |
1 |
1 |
0 (0.0%) |
2 |
✅ |
| Codex |
stale todo list cold open |
checkpoints |
1 |
1 |
0 (0.0%) |
2 |
✅ |
| Claude |
short turn resume |
WebSocket decoded |
10.6 KiB |
10.6 KiB |
0 B (0.0%) |
12.7 KiB |
✅ |
| Claude |
short turn resume |
WebSocket messages |
2 |
2 |
0 (0.0%) |
2 |
✅ |
| Claude |
long turn running, cold open |
HTTP decoded |
283.3 KiB |
283.3 KiB |
0 B (0.0%) |
302.7 KiB |
✅ |
| Claude |
long turn running, cold open |
rows |
75 |
75 |
0 (0.0%) |
75 |
✅ |
| Claude |
long turn running, history page |
HTTP decoded |
93.4 KiB |
93.4 KiB |
0 B (0.0%) |
107.4 KiB |
✅ |
| Claude |
long turn running, history page |
rows |
75 |
75 |
0 (0.0%) |
75 |
✅ |
| Claude |
long turn finished, cold open |
HTTP decoded |
384.2 KiB |
384.2 KiB |
0 B (0.0%) |
410.2 KiB |
✅ |
| Claude |
long turn finished, cold open |
rows |
151 |
151 |
0 (0.0%) |
151 |
✅ |
| Claude |
long turn finished, socket cold open |
WebSocket decoded |
384.3 KiB |
384.3 KiB |
0 B (0.0%) |
410.2 KiB |
✅ |
| Claude |
long turn finished, socket cold open |
WebSocket messages |
2 |
2 |
0 (0.0%) |
2 |
✅ |
| Claude |
long turn finished, socket cold open |
rows |
151 |
151 |
0 (0.0%) |
151 |
✅ |
| Claude |
long turn finished, work page |
HTTP decoded |
188.1 KiB |
188.1 KiB |
0 B (0.0%) |
200.2 KiB |
✅ |
| Claude |
long turn finished, work page |
rows |
150 |
150 |
0 (0.0%) |
150 |
✅ |
| Claude |
idle thread resume |
WebSocket decoded |
66 B |
66 B |
0 B (0.0%) |
200 B |
✅ |
| Claude |
idle thread resume |
WebSocket messages |
1 |
1 |
0 (0.0%) |
1 |
✅ |
| Claude |
fleet shell snapshot |
HTTP decoded |
43.0 KiB |
43.0 KiB |
0 B (0.0%) |
53.7 KiB |
✅ |
| Claude |
fleet shell snapshot |
rows |
27 |
27 |
0 (0.0%) |
27 |
✅ |
| Claude |
fleet shell subscribe |
WebSocket decoded |
66 B |
66 B |
0 B (0.0%) |
200 B |
✅ |
| Claude |
fleet shell subscribe |
WebSocket messages |
1 |
1 |
0 (0.0%) |
1 |
✅ |
| Claude |
fleet shell resume check |
HTTP decoded |
18 B |
18 B |
0 B (0.0%) |
100 B |
✅ |
| Claude |
fleet shell resume check |
rows |
0 |
0 |
0 |
0 |
✅ |
| Claude |
stale shell reload |
HTTP decoded |
43.0 KiB |
43.0 KiB |
0 B (0.0%) |
53.7 KiB |
✅ |
| Claude |
stale shell reload |
rows |
27 |
27 |
0 (0.0%) |
27 |
✅ |
| Claude |
stale shell resume |
WebSocket decoded |
140 B |
140 B |
0 B (0.0%) |
400 B |
✅ |
| Claude |
stale shell resume |
WebSocket messages |
2 |
2 |
0 (0.0%) |
2 |
✅ |
| Claude |
stale todo list cold open |
HTTP decoded |
73.4 KiB |
73.4 KiB |
0 B (0.0%) |
83.0 KiB |
✅ |
| Claude |
stale todo list cold open |
rows |
75 |
75 |
0 (0.0%) |
75 |
✅ |
| Claude |
stale todo list cold open |
nodes |
2 |
2 |
0 (0.0%) |
4 |
✅ |
| Claude |
stale todo list cold open |
subagents |
2 |
2 |
0 (0.0%) |
4 |
✅ |
| Claude |
stale todo list cold open |
plans |
1 |
1 |
0 (0.0%) |
2 |
✅ |
| Claude |
stale todo list cold open |
providerTurns |
1 |
1 |
0 (0.0%) |
2 |
✅ |
| Claude |
stale todo list cold open |
checkpoints |
1 |
1 |
0 (0.0%) |
2 |
✅ |
Baseline: 30f141e · PR result: 016987c · Source CI: success
Scenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 108.5 KiB
- Claude decoded thread snapshot: 108.8 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
Relay tracing now accounts for pending desktop-shell discovery. The relay layer reevaluates eligibility for each span. Server configuration uses a previously bound host environment to compute relay tracing eligibility.
Changes: Relay tracing eligibility
| Layer / File(s) |
Summary |
Discovery-aware relay gate apps/server/src/cloud/relayTracing.ts, apps/server/src/cloud/relayTracing.test.ts |
allowedFor returns false while desktop-shell discovery is pending. relayLayer reevaluates eligibility for each span. The test checks that no fetch occurs after telemetry is set to "false". |
Server environment wiring apps/server/src/ws.ts |
layerWsRpc binds the host environment and uses it with managed policy when computing relay tracing eligibility. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: shivamhwp
Merge Risk: Minimal · up to 01698
-
Relay tracing now waits for desktop shell discovery and honors a shell-level telemetry opt-out. No merge-blocking risk was identified.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the main change: relay tracing now waits for the desktop shell environment before exporting. It also follows the conventional commit format (fix(server)). The changeset matches it: all… |
| Description check |
 |
The description follows the repository template. It has Problem, Change, Verification, and a clear explanation of the root cause (relay tracing decided once at module load, ignoring a T3CODE_TELEMETRY… |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title names the main change: relay tracing now waits for the desktop shell environment before exporting. It also follows the conventional commit format (fix(server)). The changeset matches it: allowedFor returns false while T3CODE_DESKTOP_SHELL_DISCOVERY_PENDING is set, and the relay layer reads the live environment per span.
Full details: Description check
-
Explanation
The description follows the repository template. It has Problem, Change, Verification, and a clear explanation of the root cause (relay tracing decided once at module load, ignoring a T3CODE_TELEMETRY_ENABLED=false set in the login shell). Verification gives focused test commands, the regression test's failure on main, and the observed results. The Scope section is weak: it does not link an issue that shows the bug, and it does not say why no issue is needed. The author also did not state whether an agent was used with a clear model and harness line; the footer names Claude Opus 5.5 via Claude Code, which satisfies that part.
Resolution
Optional: add a Scope note that links the issue for the bug, or states why no issue is needed for this small fix. The description is otherwise complete.
Finishing Touches
-
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between bd3e495 and 016987c.
Files selected for processing: 3
-
apps/server/src/cloud/relayTracing.test.ts
apps/server/src/cloud/relayTracing.ts
apps/server/src/ws.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
lidge-jun
added a commit
to goat-si/goat
that referenced
this pull request
Nov 26, 2026
* fix(server): MCP tool analytics send only closed error codes and delivery values
Port of upstream 7e269e044b (pingdotgg/t3code#42397).
* fix(desktop): Windows desktop applies the saved user telemetry choice
Port of upstream 3ba003be06 (pingdotgg/t3code#42376).
* fix(server): relay-delivered webhook runs no longer export their spans to the relay
Port of upstream 30f141e2e7 (pingdotgg/t3code#42450). The run a webhook starts is local work whose spans carry workspace paths.
* fix(server): relay tracing waits for the desktop login shell before exporting
Adapted from upstream 49ef156624 (pingdotgg/t3code#42464); GOAT resolves relay tracing once at startup.
* fix(mobile): analytics uses its own random device id
Port of upstream 482e197fae (pingdotgg/t3code#42394). The hashed analytics device id no longer reuses the relay device id, so the two cannot be linked.
* fix(relay): traces no longer record callers' IP addresses or user agents
Port of upstream 4eccb0ecfc (pingdotgg/t3code#42380).
* fix(connect): relay traces leave out the operator's own resource attributes
From upstream dc7b8802b8 (pingdotgg/t3code#42356). GOAT already drops request addresses, query strings, log events and stack frames from relay spans through its allowlist; this adds the part it was missing: the relay exporter no longer reads OTEL_RESOURCE_ATTRIBUTES or the operator's service.instance.id.
* fix(desktop): a saved Windows telemetry opt-out beats an inherited opt-in
* fix(shared): blank Windows telemetry values no longer hide a saved opt-out
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:S
10-29 changed lines (additions + deletions).
vouch:trusted
Author is trusted by repo permissions or the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|