Skip to content

Bound worktree helper Git processes - #1551

Open
Chris0Jeky wants to merge 3 commits into
mainfrom
fix/bounded-worktree-git-timeout
Open

Bound worktree helper Git processes#1551
Chris0Jeky wants to merge 3 commits into
mainfrom
fix/bounded-worktree-git-timeout

Conversation

@Chris0Jeky

Copy link
Copy Markdown
Owner

Follow-up to #1498

Summary

  • bound both text and raw-blob Git commands in the issue-worktree helper
  • disable interactive credential prompts and report cleanup failures distinctly
  • terminate, reap, and drain timed-out Windows Git process trees before returning
  • extend the existing 28-case harness with a real stalled remote-helper root and child
  • record the durable transport failure and update canonical worktree guidance

Exact evidence

  • base: 076f10f7e6b34ddb9e9e44adb520d498e79888bf
  • head: 85d404281302a5f34da2a8a38e11bace94a1d320
  • powershell -File scripts/git/Test-New-CodexIssueWorktree.ps1: 28/28 passed
  • focused -Case refresh-remote-base: 1/1 passed in 18.3 seconds
  • PowerShell parsers: 4/4 passed
  • failure-ledger renderer tests: 11/11 passed; JSONL 31 rows; rendered row unique
  • docs, Golden Principles, and GitHub-operations governance: passed
  • git diff --check: passed
  • DCO: 2/2 commits
  • exact fixture-process scan after the suite: zero survivors

Two independent fresh-context reviews found no CRITICAL/HIGH defect. Their actionable timeout, cleanup, and documentation findings are fixed in this head.

Compatibility and docs

Default behavior changes only for the repository's worktree helper: each helper-owned Git process now has a 45-second deadline and non-interactive credential posture. The timeout is configurable from 1 to 300 seconds for controlled tests or measured exceptional environments. STATUS, TESTING_GUIDE, WORKTREE_AGENT_PROTOCOL, CODEX_AUTONOMY_RUNBOOK, and the rendered failure ledger are synchronized.

Residual risk

Windows tree termination still validates PID plus start time before invoking PID-based taskkill /T; a narrow same-user PID-reuse race remains. Fully eliminating that namespace race requires a substantially broader suspended-launch plus Job Object design. The limitation is explicit in the protocol and was classified non-blocking by both reviewers.

Signed-off-by: Chris0Jeky <jeky.tck@gmail.com>
Signed-off-by: Chris0Jeky <jeky.tck@gmail.com>
@Chris0Jeky

Copy link
Copy Markdown
Owner Author

Exact-head independent review mapping for 85d404281302a5f34da2a8a38e11bace94a1d320 against 076f10f7e6b34ddb9e9e44adb520d498e79888bf:

  • Compatibility review: no CRITICAL/HIGH. Fixed its MEDIUM load-sensitive 2-second fixture deadline by using 5 seconds with a 30-second natural-exit control; fixed its LOW protocol wording.
  • Process-safety review: no CRITICAL/HIGH. Fixed the MEDIUM path that could leave a timed-out taskkill.exe alive by boundedly terminating, reaping, and draining it; fixed the test cleanup to kill through the identity-checked Process object.
  • Remaining non-blocking residual: Windows taskkill /PID has a narrow PID/start-time TOCTOU. The protocol now states that same-user namespace boundary explicitly; fully closing it requires a substantially broader suspended-launch plus Job Object design.

Both reviewers confirmed the current head bounds text/blob drains and reports unproven cleanup as failure. No manual Codex review was requested; the ready-for-review event owns connector review.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 85d4042813

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/git/New-CodexIssueWorktree.ps1
Comment thread scripts/git/New-CodexIssueWorktree.ps1
Comment thread scripts/git/New-CodexIssueWorktree.ps1
@Chris0Jeky Chris0Jeky moved this from Pending to Review in Taskdeck Execution Jul 31, 2026
Signed-off-by: Chris0Jeky <jeky.tck@gmail.com>
@Chris0Jeky

Copy link
Copy Markdown
Owner Author

Exact-head fix/re-review checkpoint for 1268de102c5dfff120669d331fefdfff1ffc86c2 against base 076f10f7e6b34ddb9e9e44adb520d498e79888bf:

  • Connector P1 confirmed: a timed-out git worktree add could leave a partial registration. Fixed with exact registration/HEAD validation and clean-only partial cleanup.
  • Fresh review then found one HIGH work-loss edge: a post-checkout hook could dirty a reviewed artifact before timing out, after which generic artifact neutralization could delete it. Fixed by requiring a completely clean status on the not-yet-successful add path; any tracked, untracked, or ignored state is preserved with its registration.
  • Regression evidence: focused git-add-failure 1/1 passed; full Test-New-CodexIssueWorktree.ps1 28/28 passed in 125.1s; git diff --check passed.
  • Fresh-context re-review: no remaining CRITICAL/HIGH; the work-loss finding is closed.
  • All three connector threads were replied to and resolved. The SSH prompt limitation is now stated accurately and tracked in agent-harness#191. The Job Object/process-group residual is tracked in agent-harness#185 and FE-11: Add frontend lint baseline and enforce lint in CI #191.

Required exact-head CI is still running; this is not a merge claim.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1268de102c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/git/New-CodexIssueWorktree.ps1
Comment thread scripts/git/New-CodexIssueWorktree.ps1
Comment thread scripts/git/New-CodexIssueWorktree.ps1
@Chris0Jeky

Copy link
Copy Markdown
Owner Author

PARKED after review round 2. The late exact-head connector pass confirmed one HIGH data-loss blocker: index flags can hide modified bytes from partial-worktree cleanup. The blocker and acceptance criteria are tracked in #1553; two availability/retry findings were dispositioned to agent-harness#191. Per the bounded review pipeline, no third public fix round will be pushed to this PR. Exact head 1268de10 remains CI-green but is not merge-eligible.

@Chris0Jeky Chris0Jeky moved this from Review to Blocked in Taskdeck Execution Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Blocked

Development

Successfully merging this pull request may close these issues.

1 participant