Skip to content

feat(autoclaw2): git-identity guard - stop forcing GIT_AUTHOR=zwork into agent shells - #12

Merged
fotedev merged 1 commit into
mainfrom
feat/autoclaw2-git-identity-guard
Oct 30, 2026
Merged

fotedev merged 1 commit into
mainfrom
feat/autoclaw2-git-identity-guard

Conversation

@fotedev

@fotedev fotedev commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner
  • tools/ensure_autoclaw2_git_identity.ps1: idempotent de-injection of the four GIT_AUTHOR_/GIT_COMMITTER_="zwork" fallback lines in resources/app/dist/main.cjs (safeEnvironment()), which override the user's .gitconfig and make every agent commit authored zwork <zwork@local>.
    • Timestamped backup, node --check gate before swap, post-patch verification, -CheckOnly mode; resolves the install root without %LOCALAPPDATA% (agent shells may not carry it).
  • src/windows/launch_autoclaw2_clone.ps1: non-fatal preflight hook so every clone launch re-applies the patch automatically after AutoClaw2 updates.

Summary by CodeRabbit

  • Bug Fixes
    • The launcher now checks AutoClaw2’s Git identity settings before opening the app and removes matching local overrides when needed.
    • If the check is missing, encounters an error, or cannot complete successfully, the launcher displays a warning. These issues do not prevent AutoClaw2 from launching.

@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

The change adds a PowerShell guard that checks and can remove matching Git identity assignments in AutoClaw2’s main.cjs. The launcher runs the guard before profile creation. Missing guard scripts and guard failures produce warnings but do not stop the launch.

Changes: AutoClaw2 Git Identity Guard

Layer / File(s) Summary
Guard parameters and bundle checks
tools/ensure_autoclaw2_git_identity.ps1
The script accepts an install root and check-only mode. It checks for the bundle and matching identity assignments, then returns status codes based on the results.
Patch and verify the bundle
tools/ensure_autoclaw2_git_identity.ps1
When four matching assignments are found, the script backs up the bundle and writes a temporary patched file. It checks syntax when Node is available, replaces the original, and verifies that the assignments are removed.
Optional launcher guard
src/windows/launch_autoclaw2_clone.ps1
The launcher runs the guard after the executable preflight and before profile creation. It warns if the script is missing or fails, then continues launch.

Priority: Not assessed

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Launcher as AutoClaw2 launcher
  participant Guard as Git identity guard
  participant Bundle as main.cjs
  participant Node as Node.js
  Launcher->>Guard: Run with the install directory
  Guard->>Bundle: Check matching assignments
  Guard->>Bundle: Write patched bundle after backup
  Guard->>Node: Check patched syntax when available
  Guard-->>Launcher: Return status code
  Launcher-->>Launcher: Warn on failure and continue launch
Loading
Merge Risk: Moderate · up to a3eb2

The guard can report success or fail silently while agent commits still use the zwork identity, and a clone that is already running is not forced to restart after patching. Tighten layout detection, fail closed when no syntax checker is available, and surface guard results before relying on this to fix the commit identity.

Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@fotedev
fotedev merged commit 22ade6a into main Oct 30, 2026
2 of 4 checks passed
@fotedev
fotedev deleted the feat/autoclaw2-git-identity-guard branch October 30, 2026 02:55
@fotedev fotedev mentioned this pull request Oct 30, 2026
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