Skip to content

test(temporal): cover chat spans across cache eviction - #1058

Merged
Abhijeet Prasad (AbhiPrasad) merged 1 commit into
mainfrom
abhi/sdk-781-preserve-braintrust-spans-after-temporal-workflow-cache
Nov 3, 2026
Merged

Abhijeet Prasad (AbhiPrasad) merged 1 commit into
mainfrom
abhi/sdk-781-preserve-braintrust-spans-after-temporal-workflow-cache

Conversation

@AbhiPrasad

Copy link
Copy Markdown
Member

🤖 This text was AI-generated.

Cache eviction could lose the original Braintrust span for a long-running Pydantic AI chat. Before the fix in PR #1054, replay created multiple workflow spans for the same chat:

first message -> cache eviction -> replay -> duplicate workflow spans

Add a two-turn chat regression for both Temporal durability APIs. Force cache eviction, stop the worker while the chat waits, and resume it on a fresh worker:

workflow span
└─ chat_session (same IDs and start time after restart)
   ├─ first agent run
   └─ second agent run

Check that open spans remain unfinished during eviction and retain their input, metadata, and parent relationships when the chat completes. Share the durability API cases with the existing subagent regression.

Refs: https://linear.app/braintrustdata/issue/SDK-781
Refs: #1054

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T17:24:41.570770Z e5df89b New commits
ℹ️ About Codex in GitHub

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

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Base automatically changed from abhi/temporal-subagent-spans-2610819b to main November 3, 2026 17:20
> 🤖 **This text was AI-generated.**

Cache eviction could lose the original Braintrust span for a long-running
Pydantic AI chat. Before the fix in PR #1054, replay created multiple
workflow spans for the same chat:

```text
first message -> cache eviction -> replay -> duplicate workflow spans
```

Add a two-turn chat regression for both Temporal durability APIs. Force
cache eviction, stop the worker while the chat waits, and resume it on a
fresh worker:

```text
workflow span
└─ chat_session (same IDs and start time after restart)
   ├─ first agent run
   └─ second agent run
```

Check that open spans remain unfinished during eviction and retain their
input, metadata, and parent relationships when the chat completes. Share
the durability API cases with the existing subagent regression.

Refs: https://linear.app/braintrustdata/issue/SDK-781
Refs: #1054
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) force-pushed the abhi/sdk-781-preserve-braintrust-spans-after-temporal-workflow-cache branch from 8eb46fa to e5df89b Compare November 3, 2026 17:21

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e5df89be09

ℹ️ 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 (@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 (@codex) address that feedback".

@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) merged commit 5e20057 into main Nov 3, 2026
98 checks passed
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) deleted the abhi/sdk-781-preserve-braintrust-spans-after-temporal-workflow-cache branch November 3, 2026 18:18
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.

2 participants