Skip to content

Preserve originating turn metadata for yielded skill calls - #47106

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/aa629dd5f84563d558aa6a86bfbdfc356f1b98e4
Sep 21, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/aa629dd5f84563d558aa6a86bfbdfc356f1b98e4

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Preserve originating turn metadata for yielded skill calls

Why

Code Mode callbacks can retain skill tools after another turn becomes active. Looking up the active turn when a delayed skill invocation completes can lose access to the originating turn's metrics and metadata.

What changed

  • Capture and retain the originating SkillTurnMetrics when constructing skill analytics.
  • Expose turn analytics metadata through the turn extension store and carry it into skill telemetry.
  • Add optional turn metadata to TrackEventsContext and pass it from app, skill, and plugin usage call sites.

Testing

Add a regression test that yields a Code Mode cell, starts another turn, and releases both skill reads through a shared barrier. Assert that each skill_invocation event retains its originating turn_id.

## Why

Code Mode callbacks can retain skill tools after another turn becomes active. Looking up the active turn when a delayed skill invocation completes can lose access to the originating turn's metrics and metadata.

## What changed

- Capture and retain the originating `SkillTurnMetrics` when constructing skill analytics.
- Expose turn analytics metadata through the turn extension store and carry it into skill telemetry.
- Add optional turn metadata to `TrackEventsContext` and pass it from app, skill, and plugin usage call sites.

## Testing

Add a regression test that yields a Code Mode cell, starts another turn, and releases both skill reads through a shared barrier. Assert that each `skill_invocation` event retains its originating `turn_id`.

GitOrigin-RevId: aa629dd5f84563d558aa6a86bfbdfc356f1b98e4
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/aa629dd5f84563d558aa6a86bfbdfc356f1b98e4 branch from ea8e8ad to 6a601c0 Compare September 21, 2026 20:34
@copyberry
copyberry Bot merged commit 6a601c0 into main Sep 21, 2026
1 check passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/aa629dd5f84563d558aa6a86bfbdfc356f1b98e4 branch September 21, 2026 20:35
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant