Skip to content

fix(think): isolate private config from session metadata#1372

Merged
threepointone merged 4 commits into
mainfrom
fix/think-config-table
Apr 23, 2026
Merged

fix(think): isolate private config from session metadata#1372
threepointone merged 4 commits into
mainfrom
fix/think-config-table

Conversation

@threepointone
Copy link
Copy Markdown
Contributor

Summary

  • Move Think-owned private config out of Session's shared assistant_config table into a dedicated think_config table.
  • Add a legacy migration path that copies older Think-owned keys from assistant_config(session_id, key, value) when session_id = '', plus regression coverage for that startup path.
  • Update the current-state design docs and wip plan so they reflect the implementation that actually shipped in this branch.

Test plan

  • cd packages/think && npm run test -- think-session.test.ts
  • cd packages/think && npm run build

Made with Cursor

Move Think-owned config and request metadata into a dedicated think_config table
instead of mutating Session's shared assistant_config storage. Add a legacy
migration path plus regression coverage, and update the current-state design
notes to match the implementation.

Made-with: Cursor
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 23, 2026

🦋 Changeset detected

Latest commit: 8605c1a

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

This PR includes changesets to release 1 package
Name Type
@cloudflare/think 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

@threepointone threepointone marked this pull request as ready for review April 23, 2026 15:19
devin-ai-integration[bot]

This comment was marked as resolved.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 23, 2026

Open in StackBlitz

agents

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

@cloudflare/ai-chat

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

@cloudflare/codemode

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

hono-agents

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

@cloudflare/shell

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

@cloudflare/think

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

@cloudflare/voice

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

@cloudflare/worker-bundler

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

commit: 8605c1a

Make legacy assistant_config bootstrapping insert-only so stale pre-migration
rows cannot overwrite newer think_config values after a cold start. Add
regression coverage for rerunning the migration path after configure() updates
private config.

Made-with: Cursor
devin-ai-integration[bot]

This comment was marked as resolved.

Await the test-only rerunLegacyMigrationForTest RPC so failures surface at the
call site and the assertion runs after the migration path completes.

Made-with: Cursor
Strengthen the legacy migration regression by reading the raw think_config row
instead of going back through getConfig(), which can be satisfied from the
in-memory cache after configure().

Made-with: Cursor
@threepointone threepointone merged commit 040da0f into main Apr 23, 2026
3 checks passed
@threepointone threepointone deleted the fix/think-config-table branch April 23, 2026 17:14
@github-actions github-actions Bot mentioned this pull request Apr 23, 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.

1 participant