Skip to content

fix(server): orchestration commands join the dispatcher's trace - #65

Merged
yordis merged 1 commit into
mainfrom
yordis/fix-orchestration-command-trace-parent
Sep 28, 2026
Merged

yordis merged 1 commit into
mainfrom
yordis/fix-orchestration-command-trace-parent

Conversation

@yordis

@yordis yordis commented Sep 28, 2026 •

Copy link
Copy Markdown
Member
  • Commands sent from a client showed up in Tempo as orphan server traces, so a user action could not be followed from the client into the server's command handling.
  • The command queue ran each command on the worker's fiber, which dropped the caller's trace context at the hand-off.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@coderabbitai

coderabbitai Bot commented Sep 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 21 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: TrogonStack/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: d68a0e63-51c2-43fa-ad70-e86fb1a2cd5d

📥 Commits

Reviewing files that changed from the base of the PR and between f7bbc6c and ae5fcd0.

📒 Files selected for processing (2)
  • apps/server/src/orchestration/Layers/OrchestrationEngine.test.ts
  • apps/server/src/orchestration/Layers/OrchestrationEngine.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cursor

cursor Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Observability-only wiring around existing command processing; no changes to persistence, invariants, or dispatch semantics.

Overview
Fixes orphan server traces in Tempo by keeping orchestration command handling on the same trace as the caller that invoked dispatch.

dispatch now captures the caller's parent span when enqueueing a command. The queue worker applies Effect.withParentSpan when running each orchestration.command.* span, so async hand-off to the worker fiber no longer drops trace context.

A new test uses a recording tracer to assert the command span shares the dispatcher's traceId and lists the client.dispatch span as its parent.

Reviewed by Cursor Bugbot for commit ae5fcd0. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S labels Sep 28, 2026
@github-actions

Copy link
Copy Markdown

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 13.5 KiB 13.5 KiB +10 B (+0.1%) 15.1 KiB ✅
Codex Thread snapshot wire 7.1 KiB 7.1 KiB +3 B (+0.0%) 7.3 KiB ✅
Codex Live turn WebSocket wire 6.4 KiB 6.4 KiB +7 B (+0.1%) 7.8 KiB ✅
Codex Live turn WebSocket decoded 56.2 KiB 56.2 KiB 0 B (0.0%) 66.4 KiB ✅
Codex Live turn messages 9 9 0 (0.0%) 21 ✅
Claude Total thread wire 13.5 KiB 13.5 KiB +4 B (+0.0%) 15.1 KiB ✅
Claude Thread snapshot wire 7.1 KiB 7.1 KiB −10 B (−0.1%) 7.3 KiB ✅
Claude Live turn WebSocket wire 6.4 KiB 6.4 KiB +14 B (+0.2%) 7.8 KiB ✅
Claude Live turn WebSocket decoded 57.0 KiB 57.0 KiB 0 B (0.0%) 66.4 KiB ✅
Claude Live turn messages 9 9 0 (0.0%) 21 ✅

Baseline: 6fb9f79 · PR result: ae5fcd0 · Source CI: failure

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: 114.0 KiB
  • Claude decoded thread snapshot: 114.7 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@yordis
yordis merged commit fd47544 into main Sep 28, 2026
28 of 31 checks passed
@yordis
yordis deleted the yordis/fix-orchestration-command-trace-parent branch September 28, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant