6 months ago
e1c1360PR #83 picked up one final batch of review follow-ups after the earlier A2UI resume/type fixes landed. The remaining issues all traced to consistency gaps in state management and environment wiring: resolved workspace defaults were not keeping the legacy A2UI boolean in sync, deleted A2UI tombstones could still let the surface map grow past the intended cap, web desktop service enablement looked at process env instead of the merged server env, and browser-mode desktop state dropped feature-flag overrides on normalization. This commit tightens those paths together: resolved workspace defaults now keep `defaultEnableA2ui` aligned, A2UI overflow pruning removes deleted tombstones before creating new surfaces, `startAgentServer` enables web desktop service from the merged `opts.env`, and `WebDesktopService` round-trips desktop feature flag overrides through saved state. Constraint: Browser desktop mode and restored desktop/session state must preserve the same feature-flag semantics as native desktop paths Rejected: Fix only the workspace-default sync and leave the other three comments for later | would keep the PR review queue open and leave real runtime/state inconsistencies behind Rejected: Suppress deleted A2UI tombstones only at serialization time | does not actually keep in-memory session state bounded Confidence: high Scope-risk: moderate Reversibility: clean Directive: Any code path that resolves or persists desktop/session state must keep legacy compatibility booleans and canonical feature-flag objects in sync until the legacy fields are removed Tested: bun run typecheck Tested: bun test apps/desktop/test/workspace-settings-sync.test.ts test/a2ui/surfaceManager.test.ts test/server.test.ts test/webDesktopRoutes.test.ts Tested: bun test --max-concurrency 1 Not-tested: GitHub Actions rerun after this commit (push will retrigger CI) EOF && git push origin codex/a2ui-phase-3-full
Parentc1f4dd3