Skip to content

fix: getConfig() in configureSession() + peer dep ranges#1310

Merged
threepointone merged 2 commits intomainfrom
fix-1308-1309
Apr 15, 2026
Merged

fix: getConfig() in configureSession() + peer dep ranges#1310
threepointone merged 2 commits intomainfrom
fix-1308-1309

Conversation

@threepointone
Copy link
Copy Markdown
Contributor

@threepointone threepointone commented Apr 15, 2026

Summary

Fixes #1309 and #1308.

getConfig() inside configureSession() throws "no such table: assistant_config" (#1309)

  • Added _ensureConfigTable() lazy init to Think so _configGet/_configSet/_configDelete ensure the assistant_config table exists before querying it. These methods bypass Session/AgentSessionProvider entirely (they use this.sql directly), so they need their own table guard.
  • Calling baseSession.getHistory() before configureSession() (as suggested in the issue) would break context blocks — it triggers Session._ensureReady() which sets _ready = true before any .withContext() calls are made, silently discarding them.
  • Added ThinkConfigInSessionAgent test agent and 3 tests covering: first start with no config, reading stored config during configureSession(), and fallback behavior.

Incorrect peer dependency ranges on published packages (#1308)

  • The source already has correct wide ranges (e.g. >=0.8.7 <1.0.0), but changesets' updateInternalDependencies: "patch" was rewriting them to tight ^0.x.y ranges at publish time. In pre-1.0 semver, ^0.10.1 = <0.11.0, so agents@0.11.0 falls outside.
  • Changed updateInternalDependencies from "patch" to "minor" in .changeset/config.json to prevent future range overwrites.
  • Added changeset to trigger patch releases for @cloudflare/ai-chat, hono-agents, and @cloudflare/voice so the correct ranges get published.

Test plan

  • All 232 Think tests pass (including 3 new tests for getConfig() inside configureSession())
  • npm run check passes (sherif, export checks, oxfmt, oxlint, typecheck across 73 projects)
  • npm run build passes

Made with Cursor


Open with Devin

Lazy-create the assistant_config table before any config queries to prevent "no such table" errors when getConfig() is called (e.g. inside configureSession()). Added a #configTableReady flag and _ensureConfigTable() and call it from _configSet/_configGet/_configDelete in think.ts.

Add ThinkConfigInSessionAgent, corresponding tests, and update wrangler/test exports to reproduce and validate GH-1309 behavior.

Add changesets: fix-config-in-configure-session (patch for @cloudflare/think) and fix-peer-dep-ranges (patches for several packages) and change .changeset/config.json updateInternalDependencies from "patch" to "minor" to avoid overwriting peer-dep range fixes.
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 15, 2026

🦋 Changeset detected

Latest commit: f1d8100

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@cloudflare/think Patch
@cloudflare/ai-chat Patch
hono-agents Patch
@cloudflare/voice Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 15, 2026

Open in StackBlitz

agents

npm i https://pkg.pr.new/agents@1310

@cloudflare/ai-chat

npm i https://pkg.pr.new/@cloudflare/ai-chat@1310

@cloudflare/codemode

npm i https://pkg.pr.new/@cloudflare/codemode@1310

hono-agents

npm i https://pkg.pr.new/hono-agents@1310

@cloudflare/shell

npm i https://pkg.pr.new/@cloudflare/shell@1310

@cloudflare/think

npm i https://pkg.pr.new/@cloudflare/think@1310

@cloudflare/voice

npm i https://pkg.pr.new/@cloudflare/voice@1310

@cloudflare/worker-bundler

npm i https://pkg.pr.new/@cloudflare/worker-bundler@1310

commit: f1d8100

Add a new src/tools/sandbox.ts providing a createSandboxTools stub that returns an empty ToolSet and logs a one-time warning (not yet implemented). Update package exports in packages/think/package.json to include ./tools/sandbox (types and import) and add src/tools/sandbox.ts to the build input list in packages/think/scripts/build.ts so the stub is compiled and published. This lets code like createSandboxTools(env.SANDBOX) compile and spread harmlessly while the real implementation is pending.
@threepointone threepointone merged commit bd0346e into main Apr 15, 2026
2 checks passed
@threepointone threepointone deleted the fix-1308-1309 branch April 15, 2026 06:02
@github-actions github-actions bot mentioned this pull request Apr 15, 2026
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.

@cloudflare/think: getConfig() inside configureSession() throws "no such table: assistant_config"

1 participant