Skip to content

Preserve provider metadata in Prompt.fromResponseParts#6442

Draft
coyaSONG wants to merge 1 commit into
Effect-TS:v3from
coyaSONG:agent/fix-response-part-metadata
Draft

Preserve provider metadata in Prompt.fromResponseParts#6442
coyaSONG wants to merge 1 commit into
Effect-TS:v3from
coyaSONG:agent/fix-response-part-metadata

Conversation

@coyaSONG

@coyaSONG coyaSONG commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve response part metadata as prompt provider options for text, reasoning, tool-call, and tool-result parts
  • accumulate metadata across streamed text and reasoning parts
  • add regression coverage for streaming and non-streaming conversions, plus the required patch changeset

Problem

Prompt.fromResponseParts rebuilt prompt parts without carrying over response metadata. Follow-up requests therefore lost provider data such as Google thought signatures and Anthropic or Bedrock reasoning signatures.

Assistance

The implementation, tests, validation, and PR text were prepared with OpenAI Codex assistance.

Validation

  • pnpm test run packages/ai/ai/test/Prompt.test.ts
  • pnpm lint-fix
  • pnpm check
  • pnpm build
  • pnpm docgen

Fixes #5954

@github-project-automation github-project-automation Bot moved this to Discussion Ongoing in PR Backlog Jul 17, 2026
@changeset-bot

changeset-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9768ada

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

This PR includes changesets to release 1 package
Name Type
@effect/ai 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

@IMax153 IMax153 added the 3.0 Used for issues, pull requests, etc. that are relevant for the `v3` branch targeting Effect v3. label Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.0 Used for issues, pull requests, etc. that are relevant for the `v3` branch targeting Effect v3.

Projects

Status: Discussion Ongoing

Development

Successfully merging this pull request may close these issues.

2 participants