Skip to content

feat(core, tracing): add a span representing a turn#13424

Merged
owenlin0 merged 3 commits intomainfrom
owen/app_server_tracing_pt3
Mar 4, 2026
Merged

feat(core, tracing): add a span representing a turn#13424
owenlin0 merged 3 commits intomainfrom
owen/app_server_tracing_pt3

Conversation

@owenlin0
Copy link
Copy Markdown
Collaborator

@owenlin0 owenlin0 commented Mar 4, 2026

This is PR 3 of the app-server tracing rollout.

PRs #13285 and #13368 gave us inbound request spans in app-server and propagated trace context through Submission. This change finishes the next piece in core: when a request actually starts a turn, we now create a core-owned long-lived span that stays open for the real lifetime of the turn.

What changed:

  • Session::spawn_task can now optionally create a long-lived turn span and run the spawned task inside it
  • turn/start uses that path, so normal turn execution stays under a single core-owned span after the async handoff
  • review/start uses the same pattern
  • added a unit test that verifies the spawned turn task inherits the submission dispatch trace ancestry

Why
The app-server request span is intentionally short-lived. Once work crosses into core, we still want one span that covers the actual execution window until completion or interruption. This keeps that ownership where it belongs: in the layer that owns the runtime lifecycle.

@owenlin0
Copy link
Copy Markdown
Collaborator Author

owenlin0 commented Mar 4, 2026

@codex review

@owenlin0 owenlin0 marked this pull request as ready for review March 4, 2026 04:08
@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Keep them coming!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@owenlin0 owenlin0 requested review from jif-oai and pakrym-oai March 4, 2026 17:51
Copy link
Copy Markdown
Collaborator

@pakrym-oai pakrym-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move task name to the SessionTask trait

@owenlin0 owenlin0 force-pushed the owen/app_server_tracing_pt3 branch from 945e32b to 609c6f2 Compare March 4, 2026 18:28
@owenlin0 owenlin0 enabled auto-merge (squash) March 4, 2026 18:30
@owenlin0 owenlin0 disabled auto-merge March 4, 2026 19:09
@owenlin0 owenlin0 merged commit 27724f6 into main Mar 4, 2026
49 of 52 checks passed
@owenlin0 owenlin0 deleted the owen/app_server_tracing_pt3 branch March 4, 2026 19:09
@github-actions github-actions bot locked and limited conversation to collaborators Mar 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants