block / block/buzz

Agent snapshot import: preview dialog's Import/Cancel/Escape unresponsive (0.5.14, macOS)

Open
#6,076 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
32.7k
Forks
4.3k
Avg merge
1d 13h
Merged PRs (30d)
253

Description

# Agent snapshot import: preview dialog's Import/Cancel/Escape unresponsive (0.5.14, macOS)

## Environment
- Buzz Desktop 0.5.14 (CFBundleVersion 0.5.14), macOS 15 (Darwin 25.5.0), Apple Silicon.

## Repro
1. Agents → + → Add agent → Import.
2. Choose file → select a valid `.agent.json` (buzz-agent-snapshot v1, minimal:
definition.name + profile.displayName + memory.level none).
3. The "Import agent snapshot" preview renders correctly (name, runtime,
instructions, full embedded manifest all decoded).
4. Click **Import** — nothing. No confirming phase, no `confirmError` text, no
store write. **Cancel** is equally unresponsive; **Escape** does not close
the dialog.

## Measured scoping (same session)
- The native `` manifest accordion inside the same dialog toggles
normally, and the dialog scrolls — the webview is alive.
- Clicking *outside* the dialog closes it (DismissableLayer's document-level
listener fires), and the rest of the app is fully responsive afterwards
(sidebar nav, Agent defaults dialog, Create agent flow all work).
- So: only the React-bound controls *inside this dialog instance* never fire —
`onClick` on the header buttons and the Escape handling — while native
behaviors within the same DOM subtree work.
- Reproduced with both drag-drop and Choose file; reproduced with a human
mouse and with synthetic clicks.

## Code observations at 82f7ed15
- `AgentSnapshotImportDialog` wiring looks correct
(`onClick={() => onConfirm(keepAllowlist)}` →
`handleConfirmSnapshotImport`), and the handler would surface either
`isConfirming` or `confirmError` — neither ever appears, so the click is
lost before React.
- The import preview is reached through `PersonaCatalogDialog`, which closes
itself (`onOpenChange(false)`) in the same tick that the snapshot dialog's
state is set (`importFile` in PersonaCatalogDialog.tsx) — a stacked-portal
handoff race is the prime suspect for the new dialog's content layer being
excluded from the active pointer/focus layer.
- `data-testid="agent-snapshot-import-confirm"` appears in no e2e spec — the
confirm path has no coverage, so a dead button ships green.

## Impact
Snapshot import is unusable; the workaround is manual re-creation through the
Create agent form (which works).

## Suggested fix directions
- Sequence the catalog→preview handoff (open the preview dialog only after the
catalog's close has committed), or render the preview dialog outside the
catalog's layer stack.
- Add an e2e that clicks `agent-snapshot-import-confirm` and asserts a store
write, so the regression can't ship silently again.

Contributor guide

Open the contributing guide

Research direction

Start in PersonaCatalogDialog.tsx and the AgentSnapshotImportDialog handoff, tracing the catalog close and preview state update together. Reproduce the flow, then add coverage for agent-snapshot-import-confirm and verify Import writes the snapshot, while Cancel and Escape close the dialog.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
56/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.