Skip to content

fix(desktop): keep clarify/connection cards open for /btw and /bg side tasks - #127051

Merged
austinpickett merged 3 commits into
NousResearch:mainfrom
austinpickett:bb/126188-btw-keeps-clarify
Sep 29, 2026
Merged

austinpickett merged 3 commits into
NousResearch:mainfrom
austinpickett:bb/126188-btw-keeps-clarify

Conversation

@austinpickett

Copy link
Copy Markdown
Collaborator

Root cause

useComposerSubmit auto-skips a parked clarify card (skipClarifyRequest → clarify.respond {answer: ''}) and a parked connection card (skipConnectionRequest → connection.respond {settled_by: 'continue'}) for any non-empty draft. /btw (and /bg / /background) never speak into the blocked turn — they fork a side question / separate session — yet sending one resolved the pending card with an empty answer.

Fix

  • isSideTaskSlashCommand(text) in lib/desktop-slash-commands.ts: resolves the command through the slash registry (aliases + catalog) and returns true for side-task actions btw and background (/btw, /bg, /background, any case, bare or with args).
  • use-composer-submit.ts: both auto-skips are bypassed for side-task commands. With attachments the draft is not routed as a slash command, so it keeps the ordinary-message behavior. Other slash commands (e.g. /status) and plain replies still skip the card as before.
  • Test: fixed a TS2352 cast in the contributor's gateway mock so desktop typecheck passes.

Validation (in worktree, apps/desktop)

  • npx vitest run --project ui src/app/chat/composer/hooks/use-composer-submit.test.tsx src/lib/desktop-slash-commands.test.ts src/store/connection-request.test.ts → 77 passed.
  • Red check: the same composer suite with use-composer-submit.ts restored from origin/main → 10 failed. Each of the 5 side-task drafts × the clarify and connection cards fails: the clarify gets {answer: ''}, or the connection gets settled_by: 'continue'.
  • npm run typecheck → exit 0, no TS errors.
  • npx eslint + npx prettier --check on the 3 changed files → clean.
  • Not run: a live Desktop manual check.

Supersedes #126220. Based on #126220 by @charan-rathore: the two cherry-picked commits keep their authorship, and the follow-up commit carries a co-author trailer. This PR adds the /bg//background siblings, resolves commands through the registry instead of a regex, adds the attachment guard, and fixes the typecheck.

Fixes #126188

charan-rathore and others added 3 commits September 28, 2026 19:41
Generalize the /btw exemption to every registry action that runs beside
the live turn (/btw, /bg, /background) via isSideTaskSlashCommand, keep
the ordinary-message behavior when attachments ride along, and fix the
gateway mock cast so desktop typecheck passes.

Fixes NousResearch#126188

Co-authored-by: Charan Rathore <[email protected]>
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/desktop Electron desktop app (apps/desktop/*) labels Sep 28, 2026
@austinpickett
austinpickett enabled auto-merge (rebase) September 29, 2026 01:03
@austinpickett
austinpickett merged commit bbdf0a3 into NousResearch:main Sep 29, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

desktop: /btw while clarify is pending makes clarify resolve with empty user_response

3 participants