Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

refactor(ai): rename thinking `signature` to `encryptedValue` to match AG-UI

Open
#1,581 0 comments 0 reactions 1 assignee View on GitHub

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

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

waiting-on: maintainer

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

  • signature holds any provider's opaque reasoning artefact, not only a signature:
    • Anthropic thinking signature.
    • Anthropic redacted_thinking data (from #1579, with redacted: true).
    • OpenAI Responses { id, encrypted_content } as JSON (packages/openai-base/src/adapters/responses-text.ts).
  • AG-UI calls this value encryptedValue: on ReasoningMessage and on REASONING_ENCRYPTED_VALUE. The wire codec already maps signature to encryptedValue (packages/ai/src/utilities/ag-ui-wire.ts) and back (encryptedValueFrom() in packages/ai/src/activities/chat/messages.ts). One value has two names, and the internal name is wrong for most of what it holds.
  • ThinkingPart.signature in packages/ai/src/types.ts has 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: ai core, ai-anthropic, openai-base, ai-byteplus, the persistence conformance kit, and the docs.
  • STEP_FINISHED.signature is part of the adapter contract. Third-party adapters emit it.

Scope

  1. Add encryptedValue?: string to ThinkingPart and ModelMessage['thinking']. Mark signature @deprecated.
  2. Read shim: wherever stored or incoming messages become UI or model messages, read encryptedValue ?? signature. Write only encryptedValue.
  3. Adapter events: accept STEP_FINISHED.encryptedValue, and keep reading STEP_FINISHED.signature. Move first-party adapters (Anthropic, OpenAI base, BytePlus) to the new name.
  4. Rename internal state, for example thinkingStepSignatures in packages/ai/src/activities/chat/stream/types.ts.
  5. 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.
  6. Changeset: minor for @tanstack/ai and 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 UIMessage with only signature loads, 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 encryptedValue goes through the AG-UI wire and back without change.
  • pnpm test:pr passes.

Related: #1579.

Dominant language
TypeScript
Stars
3.2k
Forks
361
Avg merge
1d 22h
Merged PRs (30d)
218

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TanStack/ai

All issues in TanStack/ai

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.