Repository navigation
Add a /btw side question command - #1555
yablokolabs wants to merge 2 commits into
Conversation
Asking something small mid-task used to put the question and answer in the conversation for every later turn to carry. `/btw` forks the session's last settled run, answers in one tool-less model call, and drops the result, so the transcript stays the work itself. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
Nice shape for a feature PR: clear scope, a dedicated Concerns that would need resolving before this is portable as-is:
Given the PR touches freebuff-specific catalog/BYOK surface that's adjacent to (if not inside) paths the mirror restricts, and the size/complexity here, this needs a maintainer who knows the private catalog internals to validate before it's portable. Solid work, just needs that review pass. |
The side question hardcoded costMode 'free', so a user who picked their own provider still sent the fork through the free-mode admission path a normal send avoids. Match the send path, spell out the mid-turn run-state staleness where the state is read, and cover the BYOK branch in the test. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
@codebuff-team thanks for the review, Follow-up on the four points, pushed as 4845ff6. Catalog internals. Stale
BYOK test. Added: the new case asserts the connection reaches Verification: |
What
/btw <question>answers a question about the current session without touching it. One model call, no tools, the answer rendered inline, and the run state dropped.Why
A quick question in the middle of a task ("why is this flag off?", "what does this function do?") used to go through the normal turn path, so the question and the answer stayed in the conversation for every later turn to carry. Claude Code's
/btwdoes the opposite: fork the context, answer once, throw the fork away. This is the same idea on the SDK every other turn already runs on.How
cli/src/commands/btw.tsbuilds a tool-less agent definition (toolNames: []) on the model the current freebuff selection runs, and callsclient.runwithpreviousRunset to the session's last settled run state andmaxAgentSteps: 1. The returned run state is discarded, so the session and the transcript stay as they were.cli/src/commands/command-registry.tsregisters the command freebuff-only, next to/modeland/reasoning, because the side agent is built from the freebuff catalog. A missing question prints usage. No run yet explains that a message comes first. Failures print inline instead of throwing out of the input handler.cli/src/data/slash-commands.tsadds it to the freebuff menu.Tests
bun test --preload ./cli/test/setup-agents-artifact.ts cli/src/commands/__tests__/btw.test.ts(4 passing): one call with no tools and one step,previousRunpassed through, run errors surfaced, an empty answer rejected, and no client asking for/login.freebuff-command-aliases.test.tsnow also asserts/btwexists in Freebuff mode and is absent in Codebuff mode.Limits
client.runevery turn uses, withpreviousRunand an inline agent.