fix(server): project lookups stop flooding the server trace #16202
main fromt3code/server-trace-volume·opened View on GitHubProblem#
The server trace keeps 10 rotated files of 10 MB. On a busy host they rotated every 5 to 15 minutes, so only about 2 hours of history was left when we debugged a disconnect loop. 40% of all spans (88,813 of 219,744 over 2 hours) came from five microsecond helpers: cache peeks in ProjectEnrichmentService and per-candidate favicon path checks. PR sync drives most of them, because it reads each linked project's shell about once a minute.
Change#
Untrace these helpers:
WorkspacePaths.resolveRelativePathWithinRoot(pure path math)ProjectFaviconResolver.findExistingFile(one call per favicon candidate)ProjectEnrichmentService.peek,request, andrequestLane(cache reads and a queue offer)
Their parents still record each call and its timing: ProjectEnrichmentService.getAvailable, ProjectService.hydrate/getShell, and ProjectFaviconResolver.resolvePathUncached. No behavior changes.
Scope and approval#
Requested by Theo after the bb-1 disconnect investigation. Trace volume only.
Verification#
- Measured on bb-1's real trace files (
~/.t3/userdata/logs/server.trace.ndjson*, 2 hours): these five span names were 40% of all spans. vp test run src/project/ProjectEnrichmentService.test.ts src/project/ProjectFaviconResolver.test.ts src/workspace/WorkspacePaths.test.tsinapps/server: 37 passed.vpr typecheckinapps/serverandvp linton the changed files: clean.
Model and harness: Claude Opus 5.5 (1M context) in Claude Code, running in T3 Code.
🤖 Generated with Claude Code
- 1
juliusmarminge added labelsmacroscope-review
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
Approvability#
Verdict: Approved at
bc2302eMacroscope's review found this PR approvable — This is a narrowly scoped server observability fix that removes noisy per-helper trace spans while preserving the existing cache, filesystem, queue, and path-validation behavior under traced parent operations. It introduces no product-default, API, security, billing, deployment, or static-analysis changes.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
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 20.9 KiB 20.9 KiB 0 B (0.0%) 29.3 KiB ✅ Codex Live turn messages 2 2 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.2 KiB 21.2 KiB 0 B (0.0%) 29.3 KiB ✅ Claude Live turn messages 2 2 0 (0.0%) 8 ✅ Baseline:
21eb9a4· PR result:bc2302e· Source CI: successScenario 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.
Navigate logical layers of code changes, visualize relationships, and explore their blast radius.
🧰 Additional context used
📚 Code guidelines (1)
docs/internals/effect-services.md — auto-discoveredNo actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
- Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
- Review profile: CHILL
- Plan: Team
- Run ID:
a3a8e834-4d12-4b4d-8995-04e871194535
📥 Commits
Reviewing files that changed from the base of the PR and between 21eb9a421aff7a8fbe044b1a34bb3e364fb94a68 and bc2302e8a3341542db4fc0d741b5cb701da5f6d3.
📒 Files selected for processing (3)
apps/server/src/project/ProjectEnrichmentService.tsapps/server/src/project/ProjectFaviconResolver.tsapps/server/src/workspace/WorkspacePaths.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
📝 Walkthrough
Walkthrough#
Five helper functions now use
Effect.fnUntracedinstead of namedEffect.fnwrappers. Their cache, candidate-search, and path-resolution behavior remains unchanged.Changes#
Untraced Effect wrappers
Layer / File(s) Summary Switch helper functions to untraced wrappers
apps/server/src/project/ProjectEnrichmentService.ts,apps/server/src/project/ProjectFaviconResolver.ts,apps/server/src/workspace/WorkspacePaths.tsrequestLane,peek,request,findExistingFile, andresolveRelativePathWithinRootnow useEffect.fnUntraced. Their existing lookup and resolution logic remains unchanged.Priority: ➖ Normal
Estimated code review effort: 1 (Trivial) | ~4 minutes
Change: Bug fix
Suggested reviewers:
juliusmarmingeMerge Risk: ⚪ Minimal · up to
bc230This change removes spans from five small helpers while retaining their enclosing operation spans and cache, queue, and path behavior. No concrete functional or operational regression is established, so the change is mergeable subject to normal checks.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)#
Check name Status Explanation Resolution Description check ⚠️ Warning The description explains the problem, the changes, and the reported verification. The scope section does not include a link to a triaged issue or discussion with explicit maintainer approval, and it d… Add a link to the triaged issue or discussion and identify the explicit maintainer approval, including the approval comment. If no prior approval exists, explain why this focused change qualifies for the template's obvious-bug exception. ✅ Passed checks (4 passed)
Check name Status Explanation Title check ✅ Passed The title clearly and concisely describes the main change: reducing server trace volume from project lookups. Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3… Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request. Full details: Description check
Explanation
The description explains the problem, the changes, and the reported verification. The scope section does not include a link to a triaged issue or discussion with explicit maintainer approval, and it does not explain why this change qualifies as an obvious bug fix without that approval.
- Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
- Commit to this branch
- Create a new PR
- Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment `@coderabbitai help` to get the list of available commands.Replaced by https://github.com/pingdotgg/t3code/pull/16206, which stops the repeated favicon scans instead of hiding their spans.
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes