Skip to content

chore: persist reasoning content on events for consitent replay - #705

Merged
chiragjn merged 9 commits into
mainfrom
sr-AGE-2167
Sep 22, 2026
Merged

chiragjn merged 9 commits into
mainfrom
sr-AGE-2167

Conversation

@sr07asthana

@sr07asthana sr07asthana commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #

Changes

How was this tested?

Checklist

  • I have read the contributing guidelines
  • pnpm build, pnpm test, pnpm typecheck, pnpm lint:ci, and pnpm format:check pass locally
  • Tests added/updated where it makes sense
  • No hand-edits to generated code (packages/trueforge-sdk, .github/fern/openapi/openapi.json, docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge
  • Docs / .env.example updated if configuration or behavior changed

Note

Medium Risk
Changes the boundary between persisted thread context and client events for assistant reasoning; a mistake could leak display-only text into LLM requests or drop UI replay data, though behavior is covered by new tests.

Overview
Reasoning text replay is split from LLM context: streamed reasoning_content is now concatenated on the assembled assistant message in VercelAILLM, stored on model.message session events for UI/history replay, and stripped when assistant turns are appended to thread context so multi-turn replay still relies on thinking_blocks (with signatures).

Type/docs clarify that deltas carry fragments while the final message holds the full concat. Tests cover stream assembly and the AgentThread split (event has reasoning_content, context does not).

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

@changeset-bot

changeset-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: bc512a6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@truefoundry/trueforge-core Patch
@truefoundry/trueforge Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 40e0480. Configure here.

Comment thread .changeset/model-message-reasoning-content.md
@chiragjn
chiragjn merged commit 5b209be into main Sep 22, 2026
11 checks passed
@chiragjn
chiragjn deleted the sr-AGE-2167 branch September 22, 2026 12:35
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