Skip to content

feat: add /btw background session command#17194

Closed
brendandebeasi wants to merge 10 commits intoanomalyco:devfrom
brendandebeasi:feat/btw-command
Closed

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

Conversation

@brendandebeasi
Copy link

@brendandebeasi brendandebeasi commented Mar 12, 2026

Issue for this PR

Closes #16992

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.

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

adamdotdevin and others added 10 commits March 11, 2026 19:30
processor.ts already has a branded ProviderID from Provider.Model,
and fromError's ctx.providerID is already typed as ProviderID — no
need to double-wrap with .make().
Use typed local variable instead of inline cast for Provider.sort.
…after

model.json is read with ProviderID/ModelID in the generic, removing
the need for .make() when returning the result.
…) calls

Parse external SDK data through branded Zod schemas (Session.Info,
MessageV2.Info, MessageV2.Part) at the import boundary. This replaces
manual SessionID.make/MessageID.make/PartID.make wrapping with a single
.parse() call per entity, which both validates and brands in one step.
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>
@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Mar 12, 2026
@github-actions
Copy link
Contributor

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

The search found one potentially related PR:

This PR appears related as it also addresses background session/subagent functionality, which may overlap with the /btw background session command feature being added in PR #17194.

However, since PR #13261 appears to be closed/merged and focuses on "background subagents" specifically, while PR #17194 introduces a new /btw command with specific flows (ask, todo, status), they may be addressing related but distinct features. You should review PR #13261 to confirm whether they're truly duplicates or complementary work.

@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Mar 12, 2026
@github-actions
Copy link
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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

3 participants