Repository navigation
fix(web): bind first prompt to created session - #490
Conversation
tt-a1i
left a comment
There was a problem hiding this comment.
Reviewed at exact head 6bed11a. The core Session-target binding fix is correct and no P0/P1 was found, but this changes first-prompt Session identity and is therefore not on the low-risk auto-merge path.
Spec
[P2] An uncertain create response can still create a second blank Session. If the Host successfully activates a new Session but the HTTP response is lost, the catch path refreshes and resets selection while retaining workspaceDraft, then a manual retry sends a fresh creation command ID. Even if refresh observed the first Session, the next send can create another one. The existing creation-failure test models a pre-mutation throw only. Please preserve/reconcile the original creation identity, or make retries idempotently reuse it, and test post-commit response loss.
Standards
No actionable standards finding. The implementation otherwise keeps SessionManager authoritative and revalidates the receipt identity after async boundaries.
tt-a1i
left a comment
There was a problem hiding this comment.
Reviewed repaired head 582f096. Standards and Spec: the scoped P2 findings are addressed; no remaining P0/P1 or actionable small defect identified. Repository check and full-suite evidence are recorded in this review batch; targeted regressions cover the repair where applicable. This replaces my earlier findings against the old implementation. I pushed the repair, so this approval does not constitute the independent approval required after the last push. Current-head CI, current-main integration, and that independent approval remain merge gates.
# Conflicts: # web/dist/app.js
tt-a1i
left a comment
There was a problem hiding this comment.
追加修复:明确确认创建目标失活后使用新的 commandId 重试;响应丢失时继续复用原回执。SSE 重连保留业务错误提示。62项 store 测试和12项浏览器E2E通过;最终main集成check通过,完整CI正在运行。双线复审未发现P0/P1。此账户推送了修复,仍需另一维护者满足最后一次推送后的独立批准。
# Conflicts: # docs/design/README.md # tests/web/openpi-web.e2e.ts # web/dist/app.js # web/runtime/pi-runtime.ts # web/ui/src/store/web-store.ts
The first prompt for a workspace draft is now bound to the Session returned by native creation, rather than a previously selected Session. Creation returns a command-correlated Session identity; model selection and prompt admission revalidate that identity after asynchronous work. Fixes #466.
When the creation response is lost, the UI retries the same command ID and the serialized runtime returns the original receipt. Receipt replay does not activate a Session or emit a new transition. Receipts are scoped to the current Web host lifetime and bounded at 1,024 without eviction; cross-workspace reuse is rejected. This does not claim deduplication across host restarts.
Validation:
bun run checkpassed; full Node 22bun run testpassed, including 134 Vitest tests at that run. Subsequent focused replay tests passed 57 runtime/Host tests and 61 store tests, including post-activation response loss, unchanged event cursor on receipt replay, and command identity retention. Current hosted CI and post-push independent approval gate merge.