Skip to content

copilot/copilotcli hooks: platform-dependent import tie-break and passthrough-key loss asymmetries #2622

Description

@dyoshikawa

Background

Found during PR #2621 (Part of #2401), which made copilot hooks generation and import platform-independent. Two sibling asymmetries remain:

  1. copilotcli-hooks.ts resolveImportCommand still breaks a bash+powershell tie on process.platform, so the same file imports differently per machine — the exact bug just fixed on the copilot side. Its comment ("generate always writes the platform-specific field") also contradicts its own current generate code.

  2. copilot-hooks.ts import drops passthrough keys such as cwd (generate emits them via rest spread), so cwd is lost on an import-then-regenerate round trip. copilotcli-hooks.ts already has an importPassthrough list for this — the copilot side should adopt the same mechanism.

Proposed solution

Align both adapters: deterministic bash-first tie-break in copilotcli's import (mirroring PR #2621), and an importPassthrough list on the copilot side. Round-trip tests for both.

Also noted in a comment on #2401. Recorded from the 2026-08-07 batch run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmaintainer-scrapRough notes for AI implementation. Not for human eyes.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions