ImprovedDevelopers

Playcode SDK 0.7: an agent keeps its reasoning from one run to the next

@playcode/sdk 0.7 (npm) is out, and 0.7.1 is the latest. New Cloud apps start on it. In an older app, ask the agent to update the SDK: it reads the upgrade steps in the SDK's changelog first.

  • The next run keeps the model's reasoning. A model's turn now carries its private parts, Claude's thinking and Gemini's thought signatures, sealed as replay. The next run of a conversation sends them back where the model's maker accepts them, so the model keeps its reasoning and the prompt cache reads the repeated part. Before, every new run dropped them.
  • Keep each message whole in your store. A store that keeps only the fields it knows drops replay, and the next run goes without the thinking. agentStoreContract checks it. Pages never receive replay.
  • A long conversation stays inside its limit. The SDK measures each call before it goes out, Claude's earlier thinking included. It clears old tool results first, then a brief stands in for the older part. A call that still does not fit is not sent, and the run ends with the new finish: "context-limit".
  • A brief has room to think. Its request carries the run's thinking and up to 16,384 output tokens, or the model's own cap when lower, so a model that always thinks no longer spends its room before it writes the brief.
  • Fewer writes to your database. With the new optional appendRunMessages, a store writes each step once: 142 KB for a 50-step test run, against 7 MB without it.

What goes back to which model: Private parts.

Try it: Update my app's Playcode SDK to the latest version.