Skip to content

[SDK Sentinel] Stabilize OpenAI tracing span assertions - #1870

Closed
sdk-sentinel-bot wants to merge 1 commit into
temporalio:mainfrom
sdk-sentinel-forks:automation/sdk-sentinel/ci-flake/python/35038615936-1-98bac0721c02
Closed

sdk-sentinel-bot wants to merge 1 commit into
temporalio:mainfrom
sdk-sentinel-forks:automation/sdk-sentinel/ci-flake/python/35038615936-1-98bac0721c02

Conversation

@sdk-sentinel-bot

@sdk-sentinel-bot sdk-sentinel-bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Caution

This PR contains untrusted AI-generated code. Do not approve or run CI until a maintainer has reviewed the diff. SDK Sentinel verified that GitHub Actions remained approval-gated with zero executable jobs when this PR was opened.

Summary

Stabilize the OpenAI Agents tracing integration test after a main Python 3.14 failure. A [preceding equivalent suite](https://github.com/temporalio/sdk-python/actions/runs/34913775343/job/104206831444) passed the test, while the [first captured failure](https://github.com/temporalio/sdk-python/actions/runs/35031772047/job/104591666764) observed two span-start callbacks where an adjacent start/end pair was expected.

Root cause

Workflow execution may begin before the client start-workflow RPC span finishes. The test paired callbacks by list position, so valid asynchronous interleaving made it compare two start events.

Fix

Select the startWorkflow callbacks by semantic name and span identity, then retain the existing hierarchy assertions. Paired callbacks now also must share a span ID.

Validation

The unchanged exact test passed 6/6 attempts, so natural reproduction was not obtained. The candidate passed 11/11 focused attempts. The trusted baseline and fixed repository validator both passed. The originating Ubuntu matrix job remains required.

Validation status: validated-without-reproduction

  • Flake confidence: high
  • Fix confidence: high
  • Value: medium
  • Patch scope: standard — 1 changed file; 7.7 KiB
  • Local reproduction: not-reproduced — Six unchanged-checkout focused attempts passed; the CI log supplies the observed callback interleaving.
  • Regression coverage: pass-after-only — The existing exact test passed 11 candidate attempts; no new test was needed because the change strengthens its span-identity assertions.
  • Unchanged baseline (Poe lint, bridge lint, and editable build) — passed
  • Independent candidate (Poe lint, bridge lint, and editable build) — passed

Investigator-run checks

  • uv run pytest tests/contrib/openai_agents/test_openai_tracing.py::test_tracing -q — passed; 11 attempt(s). Ten post-change stress attempts and one post-format attempt passed.
  • .ci-flake-runtime/input/validate.sh — passed; 1 attempt(s). Ruff, type checks, docstyle, bridge lint, and editable bridge build passed.

Required target CI

  • Continuous Integration / build-lint-test (3.14, ubuntu-latest)

Residual risks

  • The rare callback interleaving did not occur locally.
  • A distinct Linux ARM parent-cardinality assertion in the same test remains outside this signature and candidate.

Automation provenance

If this finding should not be fixed, apply the sdk-sentinel:false-positive label and close the PR. Sentinel will suppress the finding until its affected source changes.

SDK Sentinel recurrence history

  • Unique failed CI run attempts: 2
  • First occurrence: 2026-09-15 17:17 UTC
  • Latest occurrence: 2026-09-15 22:55 UTC
  • Recent occurrences:

@sdk-sentinel-bot
sdk-sentinel-bot requested review from a team as code owners September 16, 2026 01:14

@brianstrauch brianstrauch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We're in the process of migrating this package to https://github.com/temporalio/ai-integrations. I'll accept these changes over there once the migration is complete.

brianstrauch pushed a commit to temporalio/ai-integrations that referenced this pull request Sep 17, 2026
Port the validated test stabilization from temporalio/sdk-python#1870 to the standalone OpenAI Agents integration.
brianstrauch added a commit to temporalio/ai-integrations that referenced this pull request Sep 17, 2026
Port the validated test stabilization from temporalio/sdk-python#1870 to the standalone OpenAI Agents integration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants