refactor(ai): rename thinking `signature` to `encryptedValue` to match AG-UI
Maintainers usually reply within 1 day
@jherr is already working on this.
Since Oct 1, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- ai, backend-api-design, documentation
Research direction
Start with packages/ai/src/types.ts and the TODO on ThinkingPart.signature, then trace the wire mappings in packages/ai/src/utilities/ag-ui-wire.ts and packages/ai/src/activities/chat/messages.ts. Review adapter events and thinkingStepSignatures in packages/ai/src/activities/chat/stream/types.ts, plus the named Anthropic, OpenAI base, BytePlus, persistence, and documentation files. Done means both names are read during the deprecation window, only encryptedValue is written, compatibility checks pass, and pnpm test:pr succeeds.
Written by the indexing model from the issue text.
Description
Task
Rename the thinking field signature to encryptedValue, so the internal types use the same name as AG-UI. Keep reading signature from stored messages and from adapter events during a deprecation window.
Why
signatureholds any provider's opaque reasoning artefact, not only a signature:- Anthropic thinking signature.
- Anthropic
redacted_thinkingdata (from #1579, withredacted: true). - OpenAI Responses
{ id, encrypted_content }as JSON (packages/openai-base/src/adapters/responses-text.ts).
- AG-UI calls this value
encryptedValue: onReasoningMessageand onREASONING_ENCRYPTED_VALUE. The wire codec already mapssignaturetoencryptedValue(packages/ai/src/utilities/ag-ui-wire.ts) and back (encryptedValueFrom()inpackages/ai/src/activities/chat/messages.ts). One value has two names, and the internal name is wrong for most of what it holds. ThinkingPart.signatureinpackages/ai/src/types.tshas a TODO that points here.
Why this was not done in #1579
- It breaks user code that reads
part.signature, not only stored data. It needs a deprecated alias, so it is a minor, not a patch. - It touches about 60 sites:
aicore,ai-anthropic,openai-base,ai-byteplus, the persistence conformance kit, and the docs. STEP_FINISHED.signatureis part of the adapter contract. Third-party adapters emit it.
Scope
- Add
encryptedValue?: stringtoThinkingPartandModelMessage['thinking']. Marksignature@deprecated. - Read shim: wherever stored or incoming messages become UI or model messages, read
encryptedValue ?? signature. Write onlyencryptedValue. - Adapter events: accept
STEP_FINISHED.encryptedValue, and keep readingSTEP_FINISHED.signature. Move first-party adapters (Anthropic, OpenAI base, BytePlus) to the new name. - Rename internal state, for example
thinkingStepSignaturesinpackages/ai/src/activities/chat/stream/types.ts. - Update the docs that name
signature(docs/chat/thinking-content.md,docs/migration/ag-ui-compliance.md,docs/adapters/byteplus.md) and add a migration note. - Changeset: minor for
@tanstack/aiand the adapters it touches.
Out of scope: removing signature. Do that in a later minor, after the window.
Version skew
A server must read both names before any client writes only encryptedValue. A new client that sends only encryptedValue to an old server loses the bytes, and Claude can reject the next turn. Read both names in one release, then write only the new name.
Verification
- A stored
UIMessagewith onlysignatureloads, and the next Anthropic request sends the same bytes back. Do this for a normal thinking block and for a redacted one. - A message with
encryptedValuegoes through the AG-UI wire and back without change. pnpm test:prpasses.
Related: #1579.
- Dominant language
- TypeScript
- Stars
- 3.2k
- Forks
- 361
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 218
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from TanStack/ai
-
ai-openrouter: malformed Chat Completions tool arguments execute as an empty objectPossibly taken @tombeckenham claimed this 1 day ago. Openhas-pr waiting-on: maintainer
TanStack/ai#1689 · 1 assignee ·
Maintainers usually reply within 1 day
-
StreamProcessor discards metadata from REASONING_MESSAGE_STARTPossibly taken @tombeckenham claimed this 1 day ago. Openwaiting-on: maintainer
TanStack/ai#1667 · 1 assignee ·
Maintainers usually reply within 1 day
-
Ollama chat adapter does not forward the request abort signal to the ollama SDKPossibly taken @tombeckenham claimed this 3 days ago. Openwaiting-on: maintainer
TanStack/ai#1644 · 1 assignee ·
Maintainers usually reply within 1 day
-
Async persistence restored before attach() never rejoins an in-flight runPossibly taken @tombeckenham claimed this 4 days ago. Openwaiting-on: maintainer
TanStack/ai#1639 · 1 assignee ·
Maintainers usually reply within 1 day
-
`ai-opencode`: `RUN_FINISHED` never arrives when an adapter teardown step does not settlePossibly taken @tombeckenham claimed this 4 days ago. Openwaiting-on: maintainer
TanStack/ai#1638 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
supadata-ai/mcp#27 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
capricorn86/happy-dom#2485 ·
Maintainers usually reply within 2 days
-
优化导入 OCR 模型选择文件的按钮样式Open
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
siyuan-note/siyuan#20430 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Albert-Weasker/niubigeo#194 ·
Maintainers usually reply within 1 day