app server 0 162 1 - kkamegawa/vsextensionforcodex GitHub Wiki

Codex App Server 0.162.1 Support and MXC Backend Selection

日本語

Summary

Move the extension's codex app-server integration from the 0.159.1 contract to Codex CLI 0.162.1, and let users explicitly select the MXC Windows sandbox backend for the local App Server. 0.159.1 stays the regression target because a remote App Server may still run it.

Tracking

Type Issue
Parent Issue #198
Sub-issue Issue #199: Contract baseline
Sub-issue Issue #200: MXC backend preference
Sub-issue Issue #201: Goal origin and MCP OAuth loginId
Sub-issue Issue #202: Receive-side payload changes
Sub-issue Issue #203: Integrated validation and documentation

Related closed work: Issue #149, Issue #156.

Background

The current app-server-contract.json targets 0.159.1 with 0.155.1 as the regression version. Codex CLI 0.162.1 changes the App Server protocol: goal origin, MCP OAuth loginId, MessagePhase.partial_answer, the skill path type, extended CodexErrorInfo, turn lineage, and stricter MXC policy alignment. MXC itself already existed in 0.159.1; 0.162.1 tightens how explicit and automatic selection follow managed policy.

Design

# Review finding Decision
R1 #149 and #156 are closed New parent issue with sub-issues; reference #149 and #156
R2 The original difference files are not available on this machine Regenerate schemas/0.162.1/ and reproduce the differences with compare-schemas.ps1
R3 Older server compatibility was unspecified Verify that origin and loginId still work when a 0.159.1 server ignores or omits them; regression = 0.159.1
R4 origin is sent from four paths and is optional in the schema ("missing provenance does not supply user authorization") Set/edit, pause/resume, clear, and Goal Stop all send origin: "user"; thread/goal/updated carries no origin
R5 MCP OAuth completion currently matches by server name only Store loginId from the response; complete only on an exact match; fall back to server name only when loginId is absent
R6 Message phase is not handled; turn completion uses turn/completed Upstream emits partial, commentary, and final answers as separate items with their own text, so each is shown once live and in history; no Phase contract field is needed. Covered by tests
R7 Skill paths are only used as identifiers Drop the absolute-path requirement in NormalizeSkillPath; keep empty, length, and control-character checks
R8 CodexErrorInfo is already read tolerantly Tests only
R9 No delegation path or sub-agent DTO exists Do not send parentTurnId/rootTurnId; receive-only tests
R10 supportsIndependentSpeedModes is a configRequirements/read field, not a model field The extension does not apply managed speed requirements; recorded in ADR-018, no code change
R11 No -c overrides are passed today; .cmd/.bat go through cmd /d /s /c Confirmed on 0.162.1 that -c overrides take effect. Pass features.prefer_mxc=true or windows.sandbox=mxc (bare TOML strings, no quoting) on both launch paths
R12 Managed policy (allowedWindowsSandboxImplementations, network.allowLocalBinding) is in configRequirements/read, not config/read Use both: config/read for effective values and configRequirements/read for policy; show "unknown" when unavailable

MXC options: Follow Codex config / Prefer MXC (features.prefer_mxc=true) / Require MXC (windows.sandbox="mxc"), local stdio only, applied on the next local App Server start. The extension never relaxes managed policy, never re-runs a failed command on the legacy backend, and keeps windowsSandbox/setupStart (elevated/unelevated) as the legacy setup path. The configured backend and the observed state are shown separately.

Implementation phases

  1. Contract baseline (#199): verify and install 0.162.1, generate the schema cache, update target/regression, known differences, and config/read.
  2. MXC (#200): WindowsSandboxBackendPreference, ContractVersions.Current 23 → 24, settings persistence, launch overrides, config/read diagnostics, sandbox UI, Fake App Server scenarios.
  3. Goal origin and OAuth (#201): origin on all user paths, loginId matching with fallback, Fake scenarios for present, absent, mismatched, early, and post-switch completion.
  4. Receive side (#202): partial_answer, opaque skill paths, supportsIndependentSpeedModes, receive-only tests for errors, lineage, and sub-agents.
  5. Validation and documentation (#203): builds, tests, smoke on both versions, VSIX checks, real-machine MXC acceptance, Visual Studio screenshots, English/Japanese README, setup guide, design, plan, ADR-018, and task records.

Verification

  • Schema comparison and contract surface scripts pass; smoke passes against 0.162.1 and 0.159.1.
  • Core and UI tests cover every origin path, the loginId rules, no duplicate partial answers, unknown CodexErrorInfo, relative and legacy skill paths, MXC launch arguments (direct and cmd), and no overrides for remote profiles.
  • VSIX content checks pass; MXC acceptance on real Windows (supported and unsupported environments, policy rejection, filesystem, network and loopback, PowerShell, cancellation, restart) and Visual Studio screenshots (Light, Dark, High Contrast, narrow width, keyboard) are recorded. Schema checks alone do not count as completion.
⚠️ **GitHub.com Fallback** ⚠️