Skip to content

fix(desktop): reconcile goal arm across reconnects - #3363

Open
Sun-GLiang wants to merge 2 commits into
apache:mainfrom
Sun-GLiang:fix/3234-control-reconciliation-v2
Open

fix(desktop): reconcile goal arm across reconnects#3363
Sun-GLiang wants to merge 2 commits into
apache:mainfrom
Sun-GLiang:fix/3234-control-reconciliation-v2

Conversation

@Sun-GLiang

Copy link
Copy Markdown
Contributor

Summary

  • Add a reusable Desktop reconciled-control path that dispatches a mutation once and reconciles only through replacement-candidate reads.
  • Apply it to goal.arm, comparing canonical Goal state after a dispatched connection loss without replaying the mutation.
  • Keep uncertain Goal outcomes visible and locked in the dialog, with Chinese and English guidance.
  • Preserve the Goal pause/resume behavior already merged through feat(goal): let the user arm a Goal from the composer #3199.

Fixes #3234

Verification

  • npm test -w @maka/runtime-host — 1036 passed
  • npm test -w @maka/desktop — 995 passed
  • npm run typecheck -w @maka/desktop — passed
  • npm run format:check — passed
  • npm run lint — passed
  • npm run e2e -w @maka/desktop -- goal-dialog-budget.spec.ts — 1 passed
  • Independent review — no Critical or Important findings after fixes

Review focus

  • Mutation dispatch must happen at most once.
  • Replacement candidates must run reconciliation reads only.
  • Runtime Host compatibility epoch, wire codec, and persistence schema are unchanged.
  • Visual evidence will be attached before this Draft is marked ready.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Codex implemented the Desktop reconciliation seam, Goal integration, renderer behavior, tests, conflict resolution, and verification under user direction.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@Sun-GLiang
Sun-GLiang marked this pull request as ready for review August 21, 2026 01:51

@hqhq1025 hqhq1025 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex-assisted review performed under the maintainer-approved review workflow.

Comment thread apps/desktop/src/main/runtime-host-reconnecting-ipc-main.ts Outdated

@hqhq1025 hqhq1025 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous reconciliation-wait finding is fixed on this revision. The deadline is limited to replacement waits after a dispatched control enters reconciliation, expiry removes the waiter and returns the control-specific unavailable result, and goal.arm is not replayed. Exact-head build:test, the Desktop suite (996 tests), Desktop typecheck, lint, and format checks passed.

Codex-assisted review performed under the maintainer-approved review workflow.

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.

Reconcile a dispatched control operation instead of reporting it as failed

2 participants