Skip to content

Add same-thread context clearing - #2500

Open
MateoCerquetella wants to merge 1 commit into
get-bb:mainfrom
MateoCerquetella:feature/thread-context-clear
Open

Add same-thread context clearing#2500
MateoCerquetella wants to merge 1 commit into
get-bb:mainfrom
MateoCerquetella:feature/thread-context-clear

Conversation

@MateoCerquetella

Copy link
Copy Markdown
Contributor

Human comments

What was wrong

BB had no same-thread provider-context boundary. Clearing context required a handoff, which split one piece of work across BB threads, while provider-session lookup always resumed the latest historical provider identity.

What changed

  • Add a built-in /clear command that releases an idle runtime and records a visible Context cleared boundary without changing the BB thread, workspace, history, or sticky execution settings.
  • Make provider-session lookup ignore identities before the latest clear boundary so the next prompt starts a fresh provider conversation.
  • Serialize clears against prompt sends and reject active, starting, stopping, or interaction-blocked threads.
  • Add the public API, SDK threads.clearContext, bb thread clear, guide, and bb-cli skill surfaces.
  • Reuse the existing release-only thread.stop wire command; HOST_DAEMON_PROTOCOL_VERSION does not change.

How you verified

  • pnpm exec turbo run typecheck --filter=@bb/domain --filter=@bb/db --filter=@bb/server --filter=@bb/sdk --filter=@bb/cli --filter=@bb/thread-view --filter=@bb/app --filter=@bb/server-contract --filter=@bb/templates
  • pnpm exec turbo run lint --filter=@bb/domain --filter=@bb/db --filter=@bb/server --filter=@bb/sdk --filter=@bb/cli --filter=@bb/thread-view --filter=@bb/app --filter=@bb/server-contract --filter=@bb/templates
  • Focused domain, DB, server, CLI, SDK, composer, thread-view, and template tests, including active-thread rejection, repeated clears, already-released runtimes, and send/clear races.

AGENT GENERATED

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