Skip to content

fix(web): bridge path-access approval modal to the dashboard (#1538)#1540

Merged
esengine merged 1 commit into
mainfrom
fix/web-path-approval-bridge
May 22, 2026
Merged

fix(web): bridge path-access approval modal to the dashboard (#1538)#1540
esengine merged 1 commit into
mainfrom
fix/web-path-approval-bridge

Conversation

@esengine

Copy link
Copy Markdown
Owner

Summary

When the model asked for file access outside the sandbox, the TUI opened PathConfirm but the web dashboard stayed blank — the loop hung waiting for a decision the web user couldn't make. Same shape as #832 (plan-checkpoint). This PR bridges the path-approval gate end-to-end.

  • ActiveModal (src/server/context.ts) gains a path variant carrying path / intent / toolName / sandboxRoot / allowPrefix.
  • DashboardContext.resolvePathConfirm mirrors resolveShellConfirm.
  • App.tsx broadcasts modal-up / modal-down for pendingPath, surfaces it in getActiveModal (so reconnects mid-modal repaint), and wires resolvePathConfirm to handlePathConfirmRef.
  • /api/modal/resolve accepts kind: "path" with the same run_once / always_allow / deny choices the shell modal already uses.
  • New PathModal Preact component renders the prompt with sandbox / allow-prefix rows and the three resolution buttons. chat.ts dispatches it next to ShellModal. EN + zh-CN strings added.

Audit of the other gates while I was in there

gate TUI state web bridge
run_command / run_background pendingShell
path_access pendingPath ✓ (this PR)
plan_proposed pendingPlan
plan_checkpoint pendingCheckpoint ✓ (fixed in #832)
plan_revision pendingRevision
choice pendingChoice
edit_review pendingEditReview

So after this lands every gate that blocks the assistant loop has a TUI ↔ web bridge.

Slash-command pickers (ModelPicker, ThemePicker, EditPicker, WorkspacePicker) are still TUI-only — they're user-initiated and don't block the loop, so they're not on the same critical path. Out of scope here; can ship later if web users want to drive them too.

Test plan

  • npm run typecheck (main + dashboard)
  • npm run lint
  • npm run build
  • npm run test — 3528 tests pass
  • Manual: trigger an outside-sandbox read on TUI, confirm the modal appears in both the TUI and the open web dashboard, resolve from web and watch the loop resume

Closes #1538.

When the model asked for file access outside the sandbox, the TUI
opened PathConfirm but the web dashboard stayed blank — the loop hung
waiting for a decision the web user couldn't make. Same shape as #832
(plan-checkpoint).

- `ActiveModal` gains a `path` variant carrying path / intent / toolName /
  sandboxRoot / allowPrefix.
- `DashboardContext.resolvePathConfirm` mirrors `resolveShellConfirm`.
- `App.tsx` broadcasts `modal-up` / `modal-down` for `pendingPath`,
  surfaces it in `getActiveModal` (so reconnects mid-modal repaint), and
  wires `resolvePathConfirm` to `handlePathConfirmRef`.
- `/api/modal/resolve` accepts `kind: "path"` with the same
  run_once / always_allow / deny choices the shell modal already uses.
- New `PathModal` Preact component renders the prompt with sandbox /
  allow-prefix rows and the three resolution buttons. `chat.ts` dispatches
  it next to `ShellModal`. EN + zh-CN strings added.

Audit of the other gates while I was in there:

| gate | TUI state | web bridge |
|---|---|---|
| run_command / run_background | `pendingShell` | ✓ |
| path_access | `pendingPath` | ✓ (this PR) |
| plan_proposed | `pendingPlan` | ✓ |
| plan_checkpoint | `pendingCheckpoint` | ✓ (fixed in #832) |
| plan_revision | `pendingRevision` | ✓ |
| choice | `pendingChoice` | ✓ |
| edit_review | `pendingEditReview` | ✓ |

Slash-command pickers (`ModelPicker`, `ThemePicker`, `EditPicker`,
`WorkspacePicker`) are still TUI-only — they're user-initiated and
don't block the loop, so they're not on the same critical path. Out of
scope here; can ship later if web users want to drive them too.

Closes #1538.
@esengine esengine merged commit 57a3624 into main May 22, 2026
4 checks passed
@esengine esengine deleted the fix/web-path-approval-bridge branch May 22, 2026 09:28
esengine pushed a commit that referenced this pull request May 22, 2026
…, theme) (#1524)

Localizes the remaining hardcoded CLI output strings — `reasonix mcp list / search / install` flow, `sessions` listing, `prune-sessions`, and the `/theme` slash handler — so zh-CN users see translated text instead of mixed EN/CN output.

31 new keys across `sessions` / `mcpCli` / `app` namespaces with full EN ↔ zh-CN parity. Mechanical migration — `t()` calls replace each string with the same parameters; no behavior change.

Verified clean rebase on top of the stage-1-through-4 refactor (#1530 / #1534 / #1536 / #1537) plus the path-approval bridge (#1540): typecheck + lint + 3528 tests all pass.
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.

类似#832的又一个web不询问

1 participant