Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): project lookups stop flooding the server trace #16202

Closedt3dotgg(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromt3code/server-trace-volumeopened View on GitHub

Problem

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, and requestLane (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.ts in apps/server: 37 passed.
  • vpr typecheck in apps/server and vp lint on 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

    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. Approvability

      Verdict: Approved at bc2302e

      Macroscope'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).
    4. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      CodexLive turn WebSocket decoded20.9 KiB20.9 KiB0 B (0.0%)29.3 KiB✅
      CodexLive turn messages220 (0.0%)8✅
      ClaudeTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded21.2 KiB21.2 KiB0 B (0.0%)29.3 KiB✅
      ClaudeLive turn messages220 (0.0%)8✅

      Baseline: 21eb9a4 · PR result: bc2302e · 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.

    5. Review in Change Stack →

      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-discovered

      No 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.ts
      • apps/server/src/project/ProjectFaviconResolver.ts
      • apps/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.fnUntraced instead of named Effect.fn wrappers. 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.ts
      requestLane, peek, request, findExistingFile, and resolveRelativePathWithinRoot now use Effect.fnUntraced. Their existing lookup and resolution logic remains unchanged.

      Priority: ➖ Normal

      Estimated code review effort: 1 (Trivial) | ~4 minutes

      Change: Bug fix

      Suggested reviewers: juliusmarminge

      Merge Risk: ⚪ Minimal · up to bc230

      This 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 nameStatusExplanationResolution
      Description check⚠️ WarningThe 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 nameStatusExplanation
      Title check✅ PassedThe title clearly and concisely describes the main change: reducing server trace volume from project lookups.
      Docstring Coverage✅ PassedNo 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✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck 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.
    6. Replaced by https://github.com/pingdotgg/t3code/pull/16206, which stops the repeated favicon scans instead of hiding their spans.

Sign in to join this conversation.