Repository navigation
Sessions on their own, and @restatedev/ai - #55
Draft
igalshilman wants to merge 3 commits into
Draft
igalshilman wants to merge 3 commits into
igalshilman wants to merge 3 commits into
Conversation
The high-level agents layer (packages/agents) is taken out of the tree. What remains is @restatedev/sessions, and a new package, @restatedev/ai: thin integrations that put a framework's own storage in a session object's database, and add what a turn needs to survive a crash and to stop on a cancellation. - @restatedev/ai has the entries /pi, /langgraph and /opencode. Each has a factory (withPi, withLangGraph, withOpenCode) whose closure gets ask, messages and the framework's own object, over the pieces it is built from: storage, keep-alive, and what stops a turn. OpenCode takes nothing from the machine unless `machine` is set, and never its credentials. - Sessions: ctx.stoppable and ctx.suspendable; one rule for how a handler ends after a cancellation; the hooks only the agents layer used are pruned. - docs/semantics.md specifies attempts, turns, cancellation and suspension as rules and assumptions with ids. Every id has a unit test that names it, or a stated reason; packages/ai/test/semantics.test.ts checks that. Its section 7 lists known limits, open decisions, and rules stated inexactly. - packages/e2e: `turns` runs the turn semantics against a real Restate server, in CI; `real-model` does the same with a model provider, by hand. - docs/agents is a design record of the removed layer. - The examples and the template's pi lesson use the factories.
The test support named every attempt's service after its object, so all attempts of a test file shared one namespace of the process-wide page cache. A killed attempt, which keeps running in the tests, could fail its last commit after a later attempt had opened the namespace, and that attempt's next commit was then refused. The test saw only a wait that never ended. Each attempt now has a namespace of its own, and a wait that never ends reports its name before the test's own time limit.
docs/README.md is the map. getting-started.md, concepts.md and sessions/* cover session objects: the database, retries, calls and sends, long work, cancellation, views, operations, testing. ai/* covers the integrations: the layers, pi, LangGraph, OpenCode, turns, tools, known limits. Each page ends with the rules of docs/semantics.md that decide what it says. Every TypeScript block is an excerpt of a type-checked file under packages/examples/docs; packages/examples/docs.test.ts checks that each block equals its source and that every link resolves.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.