{"record":{"id":"c6e0efee3418c81b","repo":"ZhuLinsen/daily_stock_analysis","slug":"capability-unsupported-c6e0ef","errorCode":"capability_unsupported","errorMessage":"Codex App Server Agent is not supported on native Windows in this phase","messagePattern":"Codex App Server Agent is not supported on native Windows in this phase","errorType":"error_code","errorClass":"CodexAppServerError","httpStatus":null,"severity":"error","filePath":"src/agent/codex_app_server_transport.py","lineNumber":1057,"sourceCode":"                if process.poll() is None:\n                    try:\n                        process.wait(timeout=max(0.0, kill_deadline - time.monotonic()))\n                    except subprocess.TimeoutExpired:\n                        pass\n                while _process_group_alive(process_group_id) and time.monotonic() < kill_deadline:\n                    time.sleep(0.02)\n\n            if process.poll() is None or _process_group_alive(process_group_id):\n                raise CodexAppServerError(\n                    \"resource_cleanup_failed\",\n                    \"Codex App Server process group could not be reclaimed\",\n                )\n\n\ndef resolve_command(executable: str = \"codex\") -> list[str]:\n    \"\"\"Resolve the fixed App Server argv and least-privilege overrides.\"\"\"\n    if is_native_windows():\n        raise CodexAppServerError(\n            \"capability_unsupported\",\n            \"Codex App Server Agent is not supported on native Windows in this phase\",\n        )\n    resolved = shutil.which(executable)\n    if resolved is None:\n        raise CodexAppServerError(\"command_not_found\", \"Codex executable was not found\")\n    command = [resolved, \"app-server\", \"--stdio\"]\n    for override in _BASE_CONFIG_OVERRIDES:\n        command.extend([\"-c\", override])\n    return command\n\n\ndef harden_command_against_configured_mcp(\n    command: Sequence[str],\n    *,\n    timeout: float,\n    deadline: Optional[float] = None,\n    cancel_event: Optional[threading.Event] = None,","sourceCodeStart":1039,"sourceCodeEnd":1075,"githubUrl":"https://github.com/ZhuLinsen/daily_stock_analysis/blob/5159bd72e8373d215492dff122acc9d389e219c9/src/agent/codex_app_server_transport.py#L1039-L1075","documentation":"resolve_command() refuses to build the App Server argv on native Windows: is_native_windows() is true. The transport relies on POSIX facilities (process groups via setsid, os.set_blocking, select on pipes, signal semantics) that are not available on native Windows 'in this phase', so it fails fast with code 'capability_unsupported'.","triggerScenarios":"Calling resolve_command(), build_hardened_command(), or constructing CodexAppServerTransport on a Windows host (not WSL). The check happens before shutil.which, so it fires regardless of whether codex.exe exists.","commonSituations":"Developers on Windows machines trying the Codex App Server agent backend; CI on windows-latest runners; accidental platform drift when a config selects the codex backend unconditionally.","solutions":["Select a different agent backend on Windows (factory/backend selection should branch on platform)","Run under WSL2 where the POSIX assumptions hold, and point the executable at the Linux codex binary","Gate the feature: expose backend availability so UI/config can hide it on Windows rather than crashing","Track the repo's roadmap for native Windows support instead of bypassing the check"],"exampleFix":"// before: unconditional backend\ntransport = CodexAppServerTransport(resolve_command())\n\n// after: platform gate\nif is_native_windows():\n    transport = make_default_agent_backend()  # non-codex backend\nelse:\n    transport = CodexAppServerTransport(resolve_command())","handlingStrategy":"type-guard","validationCode":"from src.agent.platform import is_native_windows\n\nif is_native_windows():\n    raise RuntimeError(\"codex app-server backend requires POSIX; use WSL\")","typeGuard":"def codex_backend_available() -> bool:\n    return not is_native_windows() and shutil.which(\"codex\") is not None","tryCatchPattern":null,"preventionTips":["Advertise backend capabilities per platform","Use WSL2 for Windows dev","Branch backend choice at factory level, not at call sites"],"tags":["codex","app-server","windows","platform-support"],"backgroundTag":null,"analyzedSha":"5159bd72e8373d215492dff122acc9d389e219c9","analyzedAt":"2026-08-15T01:59:36.292Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}