Skip to content

fix(scripts): bound dependency pin git lookups - #110570

Merged
steipete merged 5 commits into
openclaw:mainfrom
RileyJJY:jjy/fix/dependency-pins-git-timeouts
Jul 29, 2026
Merged

steipete merged 5 commits into
openclaw:mainfrom
RileyJJY:jjy/fix/dependency-pins-git-timeouts

Conversation

@RileyJJY

@RileyJJY RileyJJY commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where the dependency pin guard could hang indefinitely when Git stopped returning tracked package manifests or index-backed package JSON.

Why This Change Was Made

The dependency pin checker now applies a fixed one-minute timeout to its git ls-files and git show :... subprocesses and reports the stalled Git command. Focused tests inject a shorter timeout through the existing module boundary without adding an operator-facing environment setting.

User Impact

Developers and CI jobs get a clear dependency-pin failure instead of a stuck validation step.

Evidence

  • node scripts/run-vitest.mjs test/scripts/check-dependency-pins.test.ts — 5 tests passed, including the portable stalled-Git fixture.
  • Production-module proof exercises collectDependencyPinViolations with both a completing and stalled Git boundary:
$ node proof-dependency-pins-timeout.mjs
valid: completed=true violations=0
stalled: dependency pin guard: git ls-files -z -- *package.json timed out after 500ms.
proof-dependency-pins-timeout.mjs
import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { collectDependencyPinViolations } from "./scripts/check-dependency-pins.mjs";

const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-dependency-pins-proof-"));
const binDir = path.join(tempRoot, "bin");
await fs.mkdir(binDir);
const originalPath = process.env.PATH;

async function writeGitFixture(body) {
  if (process.platform === "win32") {
    const fixturePath = path.join(binDir, "git-fixture.mjs");
    await fs.writeFile(fixturePath, body);
    await fs.writeFile(path.join(binDir, "git.cmd"), `@echo off\r\n"${process.execPath}" "${fixturePath}" %*\r\n`);
    return;
  }
  await fs.writeFile(path.join(binDir, "git"), `#!${process.execPath}\n${body}`, { mode: 0o755 });
}

try {
  process.env.PATH = binDir;
  await writeGitFixture("process.exit(0);\n");
  const valid = collectDependencyPinViolations(tempRoot, { gitTimeoutMs: 500 });
  console.log(`valid: completed=true violations=${valid.length}`);

  await writeGitFixture('if (process.argv[2] === "ls-files") { setTimeout(() => {}, 10_000); }\nelse { process.exit(0); }\n');
  try {
    collectDependencyPinViolations(tempRoot, { gitTimeoutMs: 500 });
  } catch (error) {
    console.log(`stalled: ${error instanceof Error ? error.message : String(error)}`);
  }
} finally {
  process.env.PATH = originalPath;
  await fs.rm(tempRoot, { recursive: true, force: true });
}

AI-assisted: built with Codex

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S labels Jul 18, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Jul 18, 2026
@clawsweeper

clawsweeper Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 29, 2026, 12:45 PM ET / 16:45 UTC.

ClawSweeper review

What this changes

The PR gives the dependency-pin validation script a fixed one-minute timeout for its tracked-manifest Git lookups, reports the stalled command, and tests termination of hanging Git children.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this active PR open for maintainer review. The patch cleanly bounds the two existing Git reads used by the dependency-pin guard, preserves its fixed command arguments and sparse-index path, includes declaration coverage and SIGTERM-resistant-child regression tests, and has terminal evidence of the after-fix outcome. It is not already implemented on current main through a merged PR; the current head is mergeable but behind main, with required checks still running.

Priority: P2
Reviewed head: 2872412747878717a85a870f773771e6a35dbdfe

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, low-scope reliability repair with direct after-fix terminal proof, regression coverage, and no supported correctness or security finding.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The PR body contains after-fix terminal output from the production module for both a completing Git boundary and a deliberately stalled one, with the expected timeout error; the evidence contains no private values.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body contains after-fix terminal output from the production module for both a completing Git boundary and a deliberately stalled one, with the expected timeout error; the evidence contains no private values.
Evidence reviewed 4 items Bounded Git boundary: The PR centralizes the two existing synchronous Git calls in a helper that supplies a fixed 60-second timeout, uses SIGKILL for a child that ignores SIGTERM, and turns ETIMEDOUT into an actionable dependency-pin error.
Regression and declaration coverage: The branch updates the exported declaration for the test-only timeout injection and adds focused fixtures for stalled git ls-files and index-backed git show behavior, including cleanup of the temporary PATH override.
Real after-fix behavior proof: The PR body includes a production-module terminal run showing a normal completion and a 500ms stalled git ls-files failure with the intended command-specific timeout message; the supplied GitHub context also records the proof: sufficient label.
Findings None None.
Security None None.

How this fits together

The dependency-pin guard is a repository script used by developers and CI to inspect tracked package manifests and reject non-pinned dependencies. It calls Git to list manifest files and read index-only manifests, then returns violations or a clear process failure to the calling check.

flowchart LR
  A[Repository checkout] --> B[Dependency pin guard]
  B --> C[Git manifest lookup]
  C --> D[Manifest parser]
  D --> E[Pin validation]
  E --> F[Developer or CI result]
Loading

Before merge

  • Resolve merge risk (P1) - The current head is behind current main and several required checks are still running; refresh the exact merge result and require green checks for the landing head before merge.
  • Complete next step (P2) - No mechanical repair remains; a maintainer should wait for the current head's required checks and merge-result refresh, then make the normal landing decision.
Agent review details

Security

None.

PR surface

Tests +43, Other +22. Total +65 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 44 1 +43
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 40 18 +22
Total 3 84 19 +65

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: scripts/check-dependency-pins.mjs, serialized state: test/scripts/check-dependency-pins.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the fixed one-minute, non-configurable Git timeout and command-specific error, then land the PR only after its current three-way merge result and required checks are validated against main.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the fixed one-minute, non-configurable Git timeout and command-specific error, then land the PR only after its current three-way merge result and required checks are validated against main.

Do we have a high-confidence way to reproduce the issue?

Yes, by substituting a Git executable that never returns for either existing lookup; the PR's focused fixture and terminal proof exercise that boundary with a short timeout.

Is this the best way to solve the issue?

Yes. A fixed timeout at the common Git execution boundary covers both lookup paths without adding an operator setting or duplicating subprocess handling.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against cc2ba806398c.

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P2: A stalled dependency-pin guard blocks developer and CI validation, but the impact is limited to a repository maintenance check rather than the runtime product path.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body contains after-fix terminal output from the production module for both a completing Git boundary and a deliberately stalled one, with the expected timeout error; the evidence contains no private values.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body contains after-fix terminal output from the production module for both a completing Git boundary and a deliberately stalled one, with the expected timeout error; the evidence contains no private values.

Evidence

What I checked:

  • Bounded Git boundary: The PR centralizes the two existing synchronous Git calls in a helper that supplies a fixed 60-second timeout, uses SIGKILL for a child that ignores SIGTERM, and turns ETIMEDOUT into an actionable dependency-pin error. (scripts/check-dependency-pins.mjs:18, 8d3155731b87)
  • Regression and declaration coverage: The branch updates the exported declaration for the test-only timeout injection and adds focused fixtures for stalled git ls-files and index-backed git show behavior, including cleanup of the temporary PATH override. (test/scripts/check-dependency-pins.test.ts:45, 287241274787)
  • Real after-fix behavior proof: The PR body includes a production-module terminal run showing a normal completion and a 500ms stalled git ls-files failure with the intended command-specific timeout message; the supplied GitHub context also records the proof: sufficient label. (scripts/check-dependency-pins.mjs:25, 287241274787)
  • Current PR provenance and status: The repair was consolidated in commit 8d3155731b877775a74b13b1a91feb2ac5ee88e7 and the branch then merged its then-current main base in 2872412747878717a85a870f773771e6a35dbdfe; GitHub reports the current PR as mergeable but behind current main cc2ba806398cf2e743a58a262b0520a1fea5ca07, with several required checks still in progress. (scripts/check-dependency-pins.mjs:18, 287241274787)

Likely related people:

  • steipete: Authored the branch commit that finalized the timeout behavior, SIGTERM-resistant-child handling, declaration contract, and focused tests. (role: current repair author; confidence: high; commits: 8d3155731b87, 287241274787; files: scripts/check-dependency-pins.mjs, scripts/check-dependency-pins.d.mts, test/scripts/check-dependency-pins.test.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (7 earlier review cycles)
  • reviewed 2026-07-18T08:43:14.151Z sha 0c905113a73bcc579611c040fc1765390dd41525 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-20T06:51:11.886Z sha b8b5ff00433b7d522223127abc01bcd38107b38f :: found issues before merge. :: [P2] Make the fake Git executable resolvable on Windows
  • reviewed 2026-07-20T14:42:49.198Z sha 24248f237c9adcfc820788674768215c71253a25 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-20T15:25:33.537Z sha 24248f237c9adcfc820788674768215c71253a25 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-25T18:42:36.545Z sha ca0e6bbd1d31ade53aa784d9b20ee7103d1b7106 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-28T08:17:02.145Z sha fded35d :: needs maintainer review before merge. :: none
  • reviewed 2026-07-29T16:36:38.731Z sha 8d31557 :: needs maintainer review before merge. :: none

@RileyJJY
RileyJJY force-pushed the jjy/fix/dependency-pins-git-timeouts branch from 0c90511 to b8b5ff0 Compare July 20, 2026 06:47
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 20, 2026
@RileyJJY

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 20, 2026
@RileyJJY
RileyJJY force-pushed the jjy/fix/dependency-pins-git-timeouts branch 4 times, most recently from 959f554 to ca0e6bb Compare July 24, 2026 03:16
@RileyJJY
RileyJJY force-pushed the jjy/fix/dependency-pins-git-timeouts branch from ca0e6bb to fded35d Compare July 28, 2026 08:12
Bound both dependency-pin Git subprocesses and terminate SIGTERM-resistant children. Preserve sparse-index reads, Windows-native Git, exact timeout errors, and script declaration contracts.

Co-authored-by: RileyJJY <[email protected]>
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jul 29, 2026
@steipete
steipete merged commit 34b72d1 into openclaw:main Jul 29, 2026
105 of 107 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

vincentkoc added a commit to ZengWen-DT/openclaw that referenced this pull request Jul 29, 2026
* origin/main: (446 commits)
  fix(daemon): refuse duplicate launchd gateway managers (openclaw#97285)
  fix(memory-lancedb): share the recall cooldown with the auto-recall prompt-build hook (openclaw#112927)
  fix(test): isolate plugin install fixtures (openclaw#116008)
  fix(feishu): guard Object.assign against prototype pollution in webhook payload merge (openclaw#111729)
  fix(sms): isolate validated webhook quotas per sender (openclaw#104862)
  fix(sessions): recover deleted chats without endless retries (openclaw#115974)
  fix(restart): log errors from restart hook callbacks instead of swallowing (openclaw#108847)
  feat(ui): enable tool-loop detection from Labs (openclaw#115983)
  fix(telegram): catch unhandled rejections in webhook and ingress worker shutdown (openclaw#100998)
  fix(memory): keep rollbacks compatible after recall metadata upgrade (openclaw#116003)
  fix(ui): derive cron timezone suggestions (openclaw#115973)
  fix(scripts): bound dependency pin git lookups (openclaw#110570)
  fix(skills): preserve configless workshop apply upgrades (openclaw#115982)
  fix(gateway): cancel unread cron webhook bodies before SSRF release (openclaw#111236)
  fix(voice-call): pin Twilio webhook verification to the configured public path (openclaw#112800)
  fix(memory): make legacy session backfill rollback re-applicable (openclaw#116004)
  fix(security): fence external hook job name in isolated-agent prompts (openclaw#112501)
  fix(channels): mark durable webhook acceptance on Zalo, Google Chat, SMS, Feishu, Nextcloud Talk, and Synology Chat (openclaw#115586)
  fix(test): restore stdin TTY descriptors (openclaw#115985)
  fix(plugins): remove incorrect modifying hook timeout fallback in getClaimingHookTimeoutMs (openclaw#107996)
  ...

# Conflicts:
#	extensions/openai/realtime-quicksilver-wire.ts
vincentkoc added a commit to nvtoroy/openclaw that referenced this pull request Jul 29, 2026
* origin/main: (683 commits)
  fix(discord): bound webhook send body reads (openclaw#109076)
  fix(ui): preserve initials for missing user avatars (openclaw#115976)
  feat(ui): add provider icons to coding catalogs (openclaw#115956)
  fix(daemon): refuse duplicate launchd gateway managers (openclaw#97285)
  fix(memory-lancedb): share the recall cooldown with the auto-recall prompt-build hook (openclaw#112927)
  fix(test): isolate plugin install fixtures (openclaw#116008)
  fix(feishu): guard Object.assign against prototype pollution in webhook payload merge (openclaw#111729)
  fix(sms): isolate validated webhook quotas per sender (openclaw#104862)
  fix(sessions): recover deleted chats without endless retries (openclaw#115974)
  fix(restart): log errors from restart hook callbacks instead of swallowing (openclaw#108847)
  feat(ui): enable tool-loop detection from Labs (openclaw#115983)
  fix(telegram): catch unhandled rejections in webhook and ingress worker shutdown (openclaw#100998)
  fix(memory): keep rollbacks compatible after recall metadata upgrade (openclaw#116003)
  fix(ui): derive cron timezone suggestions (openclaw#115973)
  fix(scripts): bound dependency pin git lookups (openclaw#110570)
  fix(skills): preserve configless workshop apply upgrades (openclaw#115982)
  fix(gateway): cancel unread cron webhook bodies before SSRF release (openclaw#111236)
  fix(voice-call): pin Twilio webhook verification to the configured public path (openclaw#112800)
  fix(memory): make legacy session backfill rollback re-applicable (openclaw#116004)
  fix(security): fence external hook job name in isolated-agent prompts (openclaw#112501)
  ...

# Conflicts:
#	CHANGELOG.md
#	src/agents/tool-search-catalog.ts
#	src/agents/tool-search.test-support.ts
#	src/agents/tool-search.ts
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 30, 2026
* fix(scripts): bound dependency pin git lookups

* fix(scripts): address dependency pin review

* Update dependency pin helper types

* fix(scripts): terminate stalled dependency pin Git commands

Bound both dependency-pin Git subprocesses and terminate SIGTERM-resistant children. Preserve sparse-index reads, Windows-native Git, exact timeout errors, and script declaration contracts.

Co-authored-by: RileyJJY <[email protected]>

---------

Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. scripts Repository scripts size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants