Skip to content

feat: add /btw background session command#17198

Open
brendandebeasi wants to merge 3 commits intoanomalyco:devfrom
brendandebeasi:feat/btw-command
Open

feat: add /btw background session command#17198
brendandebeasi wants to merge 3 commits intoanomalyco:devfrom
brendandebeasi:feat/btw-command

Conversation

@brendandebeasi
Copy link
Copy Markdown

@brendandebeasi brendandebeasi commented Mar 12, 2026

Issue for this PR

Closes #16992
Related: #17189 (original community implementation by @kjellknapen)

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds a /btw slash command that lets users fire off lightweight background questions or append todos without interrupting the active session.

This is an alternative implementation to #17189, built on top of the existing session infrastructure with a different approach to background session management and message reporting.

Key changes:

  • /btw ask <question> — spawns a background session that inherits parent context, runs the question, and reports the result back as a system message (without polluting provider message history)
  • /btw todo <item> — appends a todo to the current session's todo list
  • /btw status — shows status of background sessions
  • Background session completion is reported back into the parent session cleanly
  • Adds regression tests for /btw behavior and synthetic assistant message serialization

How did you verify your code works?

  • bun test test/session/btw.test.ts test/session/message-v2.test.ts
  • bun typecheck
  • bun test (full suite)

Screenshots / recordings

N/A — backend/CLI command, no UI changes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Found a potential duplicate:

PR #17189: feat: Add the /btw command
#17189

This PR appears to be addressing the same feature as the current PR #17198. Both are implementing the /btw background session command. You should verify if one supersedes the other or if they're approaching the same feature differently.

Brendan DeBeasi and others added 3 commits March 20, 2026 09:15
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Some providers (e.g. xAI) enforce undocumented tool count limits.
Add limit.tools to model schema and cap activeTools in streamText
when the total exceeds the provider limit, prioritizing built-in
tools over MCP tools.
@Svtter
Copy link
Copy Markdown

Svtter commented Mar 22, 2026

Opened a rebased replacement PR with the same /btw implementation here: #18635

It rebases onto current dev, resolves the merge conflict, and fixes the async SessionStatus.get() compatibility issue that showed up after rebasing.

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.

[FEATURE]: add /btw command

2 participants