Skip to content

Fix thread mentions in reused worktrees - #1739

Merged
ymichael merged 1 commit into
mainfrom
bb/fix-worktree-thread-mentions-thr_h6bwcvbv8i
Aug 17, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/fix-worktree-thread-mentions-thr_h6bwcvbv8i

Conversation

@ymichael

Copy link
Copy Markdown
Collaborator

Summary

  • keep the representative reused-worktree thread available as an @-mention target
  • separate composer self-exclusion from the thread used for storage-file suggestions
  • add regression coverage for a reused worktree with exactly one thread

Root cause

The new-thread composer passed the reused worktree representative thread as currentThreadId. The mention builder correctly excludes currentThreadId, so a worktree with one thread had no thread mention candidates.

Validation

  • full @bb/app test suite: 353 files, 2,802 tests passed
  • @bb/app typecheck passed
  • @bb/app lint passed with the existing warning baseline and no errors
  • Prettier check passed

AGENT GENERATED: by GPT-5

@bb-slop-cop bb-slop-cop Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 SLOP COP 🚨 · review

I am the Slop Cop. I am reviewing this pull request for security, code quality, performance, architecture, and user behavior.

@ymichael
ymichael merged commit 6eb991d into main Aug 17, 2026
10 checks passed
@ymichael
ymichael deleted the bb/fix-worktree-thread-mentions-thr_h6bwcvbv8i branch August 17, 2026 23:08

@bb-slop-cop bb-slop-cop Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 SLOP COP 🚨 · review

Plain-English summary: This change lets a new thread mention the only existing thread when both threads use the same worktree.

Previously, the app mistook the existing thread for the new composer itself. It then removed that thread from the suggestion list.

I found no required changes.

  • Security: The change adds no unsafe input path, HTML sink, command input, permission change, or new data access.
  • Code quality: The new option correctly separates mention exclusion from thread-storage file search.
  • Performance: The change keeps the same debounced requests, query limits, cache behavior, and memoized work.
  • Browser test: I created one worktree with one thread. The new-thread composer displayed and inserted that thread mention.
  • Local checks: The focused regression test passed. The @bb/app typecheck passed.
  • CI: All required GitHub checks passed, including app, server, integration, package, and smoke tests.

The architecture scan found two optional cleanup tasks. They do not identify defects in this change.

  • NewThreadComposer duplicates the worktree representative lookup from RootComposeView. A shared helper could prevent later drift.
  • usePathSuggestions.currentThreadId now means the storage owner. A later project-wide rename could make that contract clear.

A composer-level regression test could also protect the production call site. The current test correctly protects the hook contract.

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