6 months ago
50259dcPR #83 picked up one more review round after the prior push went green. The remaining actionable issues were a mix of mobile/schema parity and desktop state consistency: mobile strict schemas were dropping A2UI metadata, deleting a surface root via updateComponents could silently keep the old root, and a few desktop workspace paths still left the legacy `defaultEnableA2ui` boolean out of sync with resolved feature flags. This commit makes the mobile protocol accept the optional A2UI metadata fields already emitted by the server, makes root deletion actually clear the tree when the root id is targeted, and keeps `defaultEnableA2ui` aligned across workspace creation, defaults patching, and control-session merges. Constraint: Mobile and desktop clients still consume a mixed legacy/current state contract, so compatibility fields must remain synchronized until they are removed across all clients Rejected: Resolve the mobile issue by loosening schemas with passthrough everywhere | weaker than needed and loses explicit protocol-shape validation Rejected: Treat root deletion as a noop and force recreateSurface later | breaks envelope semantics and leaves stale UI on valid delete requests Rejected: Keep the denormalized A2UI boolean stale and rely only on featureFlags callers | inconsistent with existing bootstrap/persistence/runtime readers that still reference the legacy field Confidence: high Scope-risk: moderate Reversibility: clean Directive: When server A2UI payloads gain optional fields, update both notification and snapshot schemas together, and keep legacy desktop boolean mirrors derived from canonical feature flags until those mirrors are fully removed Tested: bun run typecheck Tested: bun test apps/desktop/test/workspace-settings-sync.test.ts apps/desktop/test/control-socket.test.ts apps/desktop/test/workspace-startup.test.ts test/mobile.jsonrpc-client.test.ts test/a2ui/surface.test.ts Not-tested: Full-suite rerun after this final low-surface-area follow-up push in this pass EOF && git push origin codex/a2ui-phase-3-full
Parentf11b0c9