Skip to content

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

Open
sr07asthana wants to merge 4 commits into
mainfrom
sr-AGE-2167
Open

chore: persist reasoning content on events for consitent replay#705
sr07asthana wants to merge 4 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

Low Risk
Localized LLM streaming and context persistence behavior with explicit tests; no auth or data-path changes beyond what is stored on thread context vs events.

Overview
Reasoning text is now stored end-to-end for UI replay while multi-turn LLM context still relies on thinking_blocks only.

Streaming assembly in VercelAILLM concatenates reasoning deltas into accumulatedReasoning and sets reasoning_content on the final assistant message, matching what the client saw in SSE chunks. Schema comments were updated to describe that split (deltas vs assembled field).

After completion, AgentThread strips reasoning_content before appendToContext so persisted thread history does not duplicate display-only reasoning; model.message events keep reasoning_content (and continue to omit thinking_blocks for folded-stream parity). Tests cover stream output and the context vs event split.

Reviewed by Cursor Bugbot for commit 5bd78d3. 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: 5bd78d3

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

1 participant