Conversation
tt-a1i
left a comment
There was a problem hiding this comment.
审查提交:c9828a489203ccfd270114a5853160a7049b6bc2。
需要修改后再合并。
具体问题
P2 — 新标签页可继承 controllerId,标签页排他性不成立 · web/ui/src/protocol/client.ts:27
Bundled actual WebClient from exact head and ran in ego-browser space 13. A same-origin window.open child inherited sessionStorage and instantiated the identical controllerId (tab-repro.json). Host authorizes pending/read and answers solely by this id, so it cannot enforce README's other-tabs-cannot-answer promise.
P2 — 批准响应丢失后会错误宣称未批准删除 · web/ui/src/app/App.tsx:109
answerConfirmation catches all request errors and renders confirmationStale text 'No deletion was approved'. Server settles approval before HTTP receipt; a response loss or timeout can leave deletion approved despite this message. Repeated requests return already-settled/409, which does not recover the original decision.
验证范围
Full production/test diff reviewed; 94 Node tests and 15 protocol UI tests pass. Actual browser identity-inheritance reproduction succeeded with bundled exact-head client. Manager expiry/abort/scope tests pass.
限制与后续
No live Pi cleanup execution or full browser confirmation flow. Response-loss finding is source-level distributed-outcome analysis, not injected network test. Added E2E test stubs pending/answer/snapshot routes and does not prove native guard binding.
Problem
The cleanup guard calls Pi confirmation for deletion of pre-existing workspace files, but the Web runtime binds extensions in print mode without an interactive UI. Its no-op response blocks the command while telling the agent to obtain a confirmation that the browser cannot provide. Refs #343.
Value
The initiating Web tab can inspect the exact protected paths and explicitly approve or deny that one cleanup request. Missing UI, expiry, cancellation and shutdown remain fail-closed and no browser-specific permission policy is persisted.
Approach
ctx.ui.confirmpath. A scoped same-process registry transports only its print-mode confirmation to the active Web runtime; a future real Pi UIContext remains authoritative. No half UIContext is installed because Pi 0.85.1 would mark every extension as having UI and incorrectly enable custom TUI components.Validation
bun run check: passed on Node 24 from checkout basef6b49ae59605b1276b8267f2886d22c03f01533c.bun run test: Node 1663 passed, 1 platform skip; Vitest 220 passed.pi listshowed one local OpenPI source at this checkout. The browser fixture uses an authenticated real Host and mocked pending records, not a live model/provider deletion. No real workspace files were deleted.Impact
select/input/custombridge or a Trust mutation. The overlapping TUI display PR fix(tui): show cleanup approval wait instead of running Bash #545 is separate; generated Web assets and README may require rebase after other open Web PRs merge. Refs feat(web): expose Pi Trust state and native approval flows #343; does not close the broader issue.