Skip to content

Chore/smoke codex trailers 20260215#81

Merged
TonyCasey merged 9 commits intomainfrom
chore/smoke-codex-trailers-20260215
Feb 15, 2026
Merged

Chore/smoke codex trailers 20260215#81
TonyCasey merged 9 commits intomainfrom
chore/smoke-codex-trailers-20260215

Conversation

@TonyCasey
Copy link
Copy Markdown
Owner

@TonyCasey TonyCasey commented Feb 15, 2026

Summary by CodeRabbit

  • Refactor

    • Commit-msg hook fingerprint bumped to v6 and hook behavior simplified.
  • Bug Fixes

    • Hook now reliably resolves repository root and handles path escaping.
    • Windows-style working directory paths are normalized for correct hook operation.
  • Tests

    • Unit tests updated to validate the new hook version, root resolution, escaping, and Windows path normalization.

AI-Agent: OpenAI-Codex
AI-Model: gpt-5-codex
decision: JWT keeps the API stateless and scales horizontally.
AI-Agent: OpenAI-Codex
AI-Model: gpt-5-codex
AI-Agent: OpenAI-Codex
AI-Model: gpt-5-codex
AI-Agent: OpenAI-Codex
AI-Model: gpt-5-codex
AI-Agent: OpenAI-Codex
AI-Model: gpt-5-codex
decision: local CLI avoids global version drift during repo development.
AI-Agent: OpenAI-Codex
AI-Model: gpt-5-codex
decision: removing msys cwd from hook payload lets analyzer run.
AI-Agent: OpenAI-Codex
AI-Model: gpt-5-codex
AI-Decision: verify full AI trailers. decision: removing msys cwd from hook payload lets analyzer run.
AI-Confidence: medium
AI-Tags: hooks
AI-Lifecycle: project
AI-Memory-Id: ab376da3
AI-Source: heuristic
decision: omit cwd from hook JSON because git hook shells on Windows can provide MSYS-style paths (/c/...) that break execFileSync git cwd resolution.
AI-Agent: OpenAI-Codex
AI-Model: gpt-5-codex
AI-Decision: git hook shells on Windows can provide MSYS-style paths (/c/
AI-Confidence: medium
AI-Tags: hooks, tests, unit, pattern:because-clause, pattern:avoid
AI-Lifecycle: project
AI-Memory-Id: cfb0615c
AI-Source: heuristic
Copilot AI review requested due to automatic review settings February 15, 2026 23:13
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 15, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

Bumps the commit-msg hook fingerprint to v6; hook script now resolves repository root (REPO_ROOT / REPO_ROOT_ESC) and emits it as the cwd in the JSON payload. Adds Windows MSYS-style path normalization via normalizeHookCwd and applies it to hook event construction; tests updated accordingly.

Changes

Cohort / File(s) Summary
Commit-msg hook
src/hooks/commit-msg.ts
Bumped fingerprint to git-mem:commit-msg v6; add repository-root resolution (REPO_ROOT, REPO_ROOT_ESC) and include escaped repo root as "cwd" in emitted JSON; removed CWD_ESC usage.
Hook command & normalization
src/commands/hook.ts
Added and exported normalizeHookCwd(cwd, platform) to convert MSYS /C/... paths to C:/... on win32; hookCommand now normalizes input.cwd and uses the normalized value when building/emitting events.
Hook tests
tests/unit/hooks/commit-msg.test.ts
Updated expectations to git-mem:commit-msg v6; added assertions for escaped cwd occurrence and presence of git rev-parse --show-toplevel.
Hook command tests
tests/unit/commands/hook.test.ts
Export/import updated to include normalizeHookCwd; added tests verifying normalization behavior on win32 (MSYS paths) and non-win32 platforms.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Chore/smoke codex trailers 20260215' is vague and does not clearly describe the actual changes made to the pull request, which involve repository root resolution, path normalization, and hook fingerprint updates. Rename the pull request title to clearly describe the main changes, such as 'Add repository root resolution and Windows path normalization to commit-msg hook' or 'Bump commit-msg hook to v6 with root resolution and path normalization'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/smoke-codex-trailers-20260215

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the commit-msg hook installer/script and its unit tests to reflect a new hook fingerprint version and to stop passing cwd through the hook’s JSON payload (relying on process.cwd() in the hook command instead).

Changes:

  • Bump commit-msg hook fingerprint from v4 to v5 for upgrade detection.
  • Remove cwd from the commit-msg hook JSON stdin payload.
  • Update unit tests to assert the new fingerprint and absence of "cwd" in the installed hook content.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/unit/hooks/commit-msg.test.ts Updates assertions for fingerprint v5 and verifies "cwd" is not embedded in the installed hook script.
src/hooks/commit-msg.ts Bumps hook fingerprint to v5 and removes cwd serialization from the hook script payload.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/hooks/commit-msg.ts`:
- Around line 47-52: The hook only sends "commit_msg_path" so the handler falls
back to process.cwd() and may operate on the wrong repo; update the commit-msg
hook to compute the repository root (e.g. REPO_ROOT=$(git rev-parse
--show-toplevel 2>/dev/null || pwd)), escape it like COMMIT_MSG_FILE_ESC (create
REPO_ROOT_ESC), and include "cwd": "REPO_ROOT_ESC" in the JSON payload sent to
the commit-msg handler so loadConfig() and gitClient.diffStagedNames() receive
the correct repo context.

Comment thread src/hooks/commit-msg.ts Outdated
decision: include explicit repo root cwd in commit-msg hook payload for stable config/git context, while normalizing /c/... paths on Windows to avoid spawnSync git ENOENT.
AI-Agent: OpenAI-Codex
AI-Model: gpt-5-codex
AI-Convention: spawnSync git ENOENT
AI-Confidence: low
AI-Tags: hooks, commands, tests, unit, pattern:avoid
AI-Lifecycle: project
AI-Memory-Id: 1dc9b177
AI-Source: heuristic
@TonyCasey TonyCasey merged commit 9a7c36b into main Feb 15, 2026
3 checks passed
@TonyCasey TonyCasey deleted the chore/smoke-codex-trailers-20260215 branch February 15, 2026 23:27
@TonyCasey TonyCasey restored the chore/smoke-codex-trailers-20260215 branch February 16, 2026 00:15
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.

2 participants