Skip to content

feat(codex): load Windows guidance as a platform overlay#955

Open
TyceHerrman wants to merge 1 commit into
mksglu:nextfrom
TyceHerrman:feat/940-codex-os-overlay
Open

feat(codex): load Windows guidance as a platform overlay#955
TyceHerrman wants to merge 1 commit into
mksglu:nextfrom
TyceHerrman:feat/940-codex-os-overlay

Conversation

@TyceHerrman

Copy link
Copy Markdown
Contributor

What / Why / How

Fixes #940

What

  • Move Windows-only Codex guidance out of the platform-neutral template and into a packaged AGENTS.windows.md overlay.
  • Append that overlay to every Codex SessionStart source on Windows without writing user files.
  • Update manual-copy documentation for Codex and Kimi users.

Why

The shared Codex instructions currently send PowerShell, drive-letter, and Windows path guidance to macOS and Linux sessions. Those rules are useful on Windows but irrelevant elsewhere and consume prompt space.

How

  • Load the packaged overlay only for win32 sessions.
  • Suppress duplicate injection when a legacy manually copied AGENTS.md already contains the Windows guidance.
  • Fail open when the overlay is missing or unreadable.
  • Preserve the existing architecture: context-mode does not automatically modify global or project AGENTS.md files.

Affected platforms

  • Claude Code
  • Cursor
  • VS Code Copilot (GitHub Copilot)
  • JetBrains Copilot
  • Gemini CLI
  • Qwen Code
  • OpenCode
  • KiloCode
  • Codex CLI
  • OpenClaw (Pi Agent)
  • Pi
  • Kiro
  • Antigravity
  • Zed
  • All platforms

Test plan

  • TDD regression: captured failure before adding the platform overlay implementation.
  • npx vitest run tests/adapters/codex.test.ts — 76/76 tests passed.
  • Coverage includes neutral templates, simulated Windows loading, legacy duplicate suppression, missing/unreadable overlays, and all current-platform SessionStart sources.
  • npm run build — passed, including bundle and asymmetric-drift assertions.
  • env -u CONTEXT_MODE_PLATFORM npm test — 210/210 files passed; 4,724 tests passed and 24 skipped.
  • npm run typecheck — passed.

Checklist

  • Tests added/updated (TDD: red → green)
  • npm test passes
  • npm run typecheck passes
  • Docs updated if needed (README, platform-support.md)
  • No Windows path regressions (forward slashes only)
  • Targets next branch (unless hotfix)
Cross-platform notes

CI runs on Ubuntu, macOS, and Windows. The overlay helper accepts an explicit platform for deterministic tests, while SessionStart uses the current runtime platform. Path handling uses Node path APIs and packaged file URLs; no hardcoded Windows separators are introduced.

@TyceHerrman
TyceHerrman marked this pull request as ready for review July 14, 2026 00:06
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.

1 participant