Skip to content

fix: port shared review and ACP lifecycle fixes - #2903

Open
guantw wants to merge 5 commits into
GCWing:mainfrom
guantw:fix/backport-review-acp-fixes
Open

fix: port shared review and ACP lifecycle fixes#2903
guantw wants to merge 5 commits into
GCWing:mainfrom
guantw:fix/backport-review-acp-fixes

Conversation

@guantw

@guantw guantw commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Port four shared bug fixes from the HarmonyOS downstream repository to current upstream main:

  • GitCode PR #154: switch the review canvas snapshot synchronously during workspace activation, before the target review tab opens.
  • GitCode PR #157: preserve user action-bar expand/collapse choices during streaming by restoring persisted state only when the review session location changes.
  • GitCode PR #161: route the Other group checkbox through remediation selection, excluding completed items.
  • GitCode PR #165: settle failed ACP prompts and terminated transports while preserving partial output, final responses, cancellation, and same-session retries.

Type and Areas

Type: Bug fixes and regression tests.

Areas: Web UI review canvas, review action state, remediation selection, and ACP client lifecycle.

Motivation / Impact

All four triggering paths remained in upstream main at 14e4d9583659c4401932755c6344da3272596cef: canvas switching ran in a React effect, persisted review restoration depended on the streaming session object, ungrouped selection returned early, and ACP prompt errors could leave the update reader waiting. Each fix applies to shared behavior and is absent from that baseline.

The ports retain upstream module names, session subscription APIs, and non-HarmonyOS test behavior. HarmonyOS provisioning, Node compatibility, unrelated downstream browser-tab behavior, packaging, and device changes are excluded.

Verification

  • pnpm --dir src/web-ui run gen:types: passed (39 binding-export tests).
  • pnpm --dir src/web-ui run test:run src/app/scenes/session/AuxPane.workspace-switch.test.tsx src/flow_chat/components/btw/BtwSessionPanel.review-action.test.tsx src/flow_chat/components/btw/DeepReviewActionBar.test.tsx src/flow_chat/store/deepReviewActionBarStore.test.ts src/flow_chat/deep-review/action-bar/RemediationSelectionPanel.test.tsx src/app/services/sessionSceneLifecycle.test.ts src/flow_chat/services/sessionActivation.test.ts src/flow_chat/services/storeSync.test.ts src/app/stores/sceneStore.test.ts: passed, 139 tests across 9 files.
  • Negative control: all three added frontend regressions fail against the original main implementations, then pass with the ported implementations. The comparison restored the final source files byte-for-byte.
  • pnpm run check:web: passed, including TypeScript, canvas SDK, typography, Appearance, theme color, and theme visual contract checks.
  • cargo test --locked -p openbitfun-acp --no-default-features --features client,openbitfun-core/git --lib client::prompt::tests: passed, 7 tests on Windows x64.
  • The client-only Rust command first exposed an existing main feature-closure error: the worktree tool imports service::worktree, which requires Core git. The focused command explicitly selects that feature; no dependency manifests or unrelated Core code are changed.
  • pnpm run fmt:rs and git diff origin/main --check: passed.

Reviewer Notes

AI-assisted; testing level: automated unit/component and static checks, without application or device end-to-end validation. The UI changes affect behavior rather than visual styling; component tests cover their interactions.

No persisted-data shape or ACP wire protocol changes. The transport-closure marker is local to the client incoming queue and is never sent to an agent. Remote workspace, remote control, Peer Device Mode, and Detached Dispatch were not exercised end to end.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

Swap agent canvas snapshots synchronously during workspace activation before opening the target review tab. Deduplicate repeated workspace notifications and cover the ordering with a regression test.

(cherry picked from commit 80da126)
Restore persisted review actions only when the session location changes, and use the latest session data when the load completes. Keep local expand actions from being overwritten by streaming updates and cover the behavior with a regression test.

(cherry picked from commit 6acfe70)
Allow the ungrouped remediation checkbox to reach the group selection store and include ungrouped in the selection callback types. Cover partial selection, select-all, deselection, and exclusion of completed items in the review action bar regression test.

(cherry picked from commit 9b6c945)
Track prompt responses separately from session updates so protocol errors settle active turns and allow retries. Surface transport termination after queued frames are dispatched, preserving partial output and final responses.

Add focused client regression tests for errors, retry, cancellation, and connection closure, and document the test entry point.

(cherry picked from commit 05c234b2a5aaca344f2dfdd5b43c4ed2342863f2)
Rename the client-local transport closure notification to the OpenBitFun prefix in both its declaration and injected payload. Keep transport termination dispatch consistent and satisfy the product identity audit.
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