Skip to content

Relocate and refactor session-memory example#1044

Merged
threepointone merged 1 commit intomainfrom
move-session-example
Mar 2, 2026
Merged

Relocate and refactor session-memory example#1044
threepointone merged 1 commit intomainfrom
move-session-example

Conversation

@threepointone
Copy link
Contributor

@mattzcarey fyi

Move the session-memory example from examples/experimental to experimental/session-memory and clean up surrounding example scaffolding. Refactor server API: compactMessages now accepts an Ai binding and createWorkersAI is invoked with that binding; session compaction fn updated to pass this.env.AI. Update ChatAgent.chat to accept an optional messageId and use crypto.randomUUID() when absent. Update client to pass messageId when calling chat, reset fetch state on close, and handle errors when clearing history. Add favicon, assets directory handling, new tsconfig and styles extraction, adjust wrangler schema path, and tweak example package.json deps/scripts. Update experimental README to reference the session-memory example and commit moves/renames; lockfile updated accordingly.

Move the session-memory example from examples/experimental to experimental/session-memory and clean up surrounding example scaffolding. Refactor server API: compactMessages now accepts an Ai binding and createWorkersAI is invoked with that binding; session compaction fn updated to pass this.env.AI. Update ChatAgent.chat to accept an optional messageId and use crypto.randomUUID() when absent. Update client to pass messageId when calling chat, reset fetch state on close, and handle errors when clearing history. Add favicon, assets directory handling, new tsconfig and styles extraction, adjust wrangler schema path, and tweak example package.json deps/scripts. Update experimental README to reference the session-memory example and commit moves/renames; lockfile updated accordingly.
@changeset-bot
Copy link

changeset-bot bot commented Mar 2, 2026

⚠️ No Changeset found

Latest commit: feadb4f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 2, 2026

Open in StackBlitz

npm i https://pkg.pr.new/agents@1044
npm i https://pkg.pr.new/@cloudflare/ai-chat@1044
npm i https://pkg.pr.new/@cloudflare/codemode@1044
npm i https://pkg.pr.new/hono-agents@1044

commit: f22fd9c

@threepointone threepointone merged commit eb83f35 into main Mar 2, 2026
3 checks passed
@threepointone threepointone deleted the move-session-example branch March 2, 2026 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants