Skip to content

[codex] Replace prompt plus menu PR - #194

Merged
brsbl merged 37 commits into
mainfrom
bb/pr93-replacement-prompt-menu
Jun 19, 2026
Merged

brsbl merged 37 commits into
mainfrom
bb/pr93-replacement-prompt-menu

Conversation

@brsbl

@brsbl brsbl commented Jun 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This replaces PR #93 with a clean branch from ymichael/bb:main.

  • Removes tracked .otto artifacts and keeps .otto/ ignored.
  • Adds provider-owned composer actions for skills, plan mode, and goal mode.
  • Wires the prompt action menu to provider metadata for new threads and follow-up composers.
  • Updates command insertion so Plan/Goal use provider text, including /plan and /goal , while Skills still inserts $.
  • Preserves editor focus after keyboard/compact prompt action selection and keeps provider actions available for environmentless follow-up composers.

Review Gates

  • Provider/server merge review found missing app fixture propagation; fixed by the app wiring commit.
  • Prompt menu merge review found Plan/Goal could append after an active $ token; fixed by fix(app): replace active command token for prompt actions.
  • App wiring merge review completed with no implementation issues and no architectural issues.
  • Final PR review found two P2 issues: keyboard-selected prompt actions could lose editor focus, and environmentless follow-up composers could lose provider actions. Both were fixed in fix(app): preserve prompt action metadata and focus.

Validation

Passed:

  • pnpm exec turbo run typecheck --filter=@bb/domain --filter=@bb/agent-providers --filter=@bb/server --filter=@bb/app
  • pnpm exec turbo run test --filter=@bb/domain --filter=@bb/agent-providers
  • pnpm exec turbo run test --filter=@bb/server -- src/services/threads/provider-command-typeahead.test.ts
  • pnpm exec turbo run test --filter=@bb/app -- --run src/components/promptbox/mentions/command-trigger.test.ts src/hooks/cache-owners/composer-cache-owner.test.ts
  • pnpm exec turbo run lint --filter=@bb/app
  • git diff --check

Blocked locally:

  • pnpm exec turbo run test --filter=@bb/app -- --run src/components/promptbox/PromptBoxInternal.test.tsx
  • pnpm exec turbo run test --filter=@bb/app -- --run src/hooks/useThreadCreationOptions.test.tsx

Both fail before test import because Vitest cannot resolve jsdom. This checkout already has multiple @vitest-environment jsdom app tests and @bb/app does not declare jsdom directly.

@brsbl
brsbl marked this pull request as ready for review June 17, 2026 19:18
@brsbl
brsbl merged commit dc9a367 into main Jun 19, 2026
6 checks passed
@brsbl
brsbl deleted the bb/pr93-replacement-prompt-menu branch June 19, 2026 10:23
ymichael added a commit that referenced this pull request Sep 29, 2026
Plan, Goal, Automation, and Plugin rows now put their command or prompt at
the start of the draft, replacing a leading command pill. Core applies the
rule to Plan/Goal; Automations and BB Guide apply it with composer.replace.
This removes experimental_applyCommand, the Plugin prompt action in core,
and the cursor-based replacement and dedupe logic from #194.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
ymichael added a commit that referenced this pull request Sep 29, 2026
… plugins (#4502)

## Human comments

## What was wrong

After #4474, plugins could write composer picker settings but could not
reactively read them. The Automation and Plugin creation rows were also
hard-coded in the core `+` menu, so the plugins that own those features
could not contribute them. The menu's command rows edited the draft
relative to the cursor (replacing a preceding action or a half-typed
command, skipping duplicates), which plugins cannot reproduce because
they cannot see the cursor.

## What changed

- Added `composer.selection: ComposerSelection | null`, with stable
snapshots and subscriptions in `useComposer` and `useComposers`. It
reports the thread (including handoff) and new-thread pickers, and the
read-only pickers of queued-message and sent-message editors: the
thread's provider with the queued message's or the thread composer's
settings. Composers without pickers return null. `setSelection` retains
partial updates.
- Plan, Goal, Automation, and Plugin rows now put their command or
prompt at the start of the draft, replacing a leading command pill;
clicking the same row again changes nothing. Commands work anywhere in a
message, but Automation and Plugin are sentence starters and `/goal` is
passed to Codex as text, so the start is the only position that matters.
This removes the cursor-based replacement and duplicate logic from #194;
a half-typed `/pl` is no longer replaced. Skills still inserts its
trigger at the cursor because it opens the skills picker.
- Moved the Automation row into the Automations plugin and Plugin
creation into default-enabled BB Guide. Both insert their sentence
("Create a new bb automation to" / "Create a new bb plugin that") with
the existing `composer.replace`; there is no new composer method. Core
applies the same rule to its provider-declared Plan/Goal rows. Explicit
menu-row icons now take precedence over plugin branding, so both rows
keep their original icons.
- Both rows appear in the same composers as on main, including the
sent-message editor: plugin `+` menu rows are exempt from its
customization suppression, while actions, banners, send-menu rows, and
rich text remain suppressed there.
- Removed the `/automation` macro from core: it is no longer offered in
slash autocomplete, converted on paste, or expanded to the automation
sentence on send (along with the legacy `/loop` alias). Core no longer
knows about Automations. An unsent local draft that already holds an
`/automation` pill now sends it as literal text.
- Bumped the SDK to 0.6.2 for `selection`. Automations and BB Guide
require SDK 0.6.0 for `replace`. Updated the Plugin Guide, authoring
references, and API audit. These are client-local changes; no database,
server/daemon wire, or CLI changes.

## How you verified

- `pnpm exec turbo run test --filter=@bb/app` on the promptbox, plugin,
embedded-chat, thread-detail, and lib suites plus useCommandSuggestions:
1931 passed. Covers the prefix rule (existing text, later pills
shifting, replacing a leading command, repeated clicks), core/plugin row
order and icons in new-thread, thread, and queued-message composers,
menu rows re-rendering on selection changes, queued and sent-message
selections (including a bottom handoff), and plus-menu rows under
suppression.
- Turbo tests for client-core (277), the SDK (361), Plugin Guide (82),
Automations (135), and BB Guide (7) passed, including new unit tests for
the two plugins' draft transforms.
- Turbo lint/typecheck for the app, client-core, SDK, Automations, BB
Guide, and Plugin Guide passed with no errors. The SDK version check
passes.
- Embedded chat's queued host has no test harness and is covered by
typecheck only. This version has not yet been checked in the app.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

> AGENT GENERATED

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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