Skip to content

fix(resolver): avoid unrelated directory fd for tsconfig overrides - #16

Merged
vincentkoc merged 2 commits into
mainfrom
claude/fix-tsconfig-override-directory-fd-20260927
Sep 27, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
claude/fix-tsconfig-override-directory-fd-20260927

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What does this PR do?

Fix the directory-descriptor producer for explicit --tsconfig-override paths.

The resolver can pair an absolute override path with the filesystem-root directory descriptor. The file reader first opens the path's basename relative to that descriptor, then falls back to the absolute path and emits an internal directory-mismatch diagnostic. An explicit override must not borrow that unrelated descriptor.

  • Pass FD::INVALID for explicit overrides so the reader opens the supplied path directly. Discovered configs retain their matching directory descriptor; extends already uses FD::INVALID.
  • Remove the now-unused FdZero alias.
  • Require clean stderr in the six existing successful CLI cases, and add run/build cases with same-basename overrides and conflicting or malformed unused disk configs.
  • Adapt the owner-level fix from upstream #34980, retaining contributor credit. No resolver-cache redesign, config-policy change, or Bun.build option wiring is included.

Production delta: +4/-8, net -4 lines. Tests: +38/-18, net +20 lines. One changelog entry.

How did you verify your code works?

Baseline: the complete 12-case CLI file on the maintained a70be26b47560ede9b7646451e66e3f735195672 Darwin arm64 release produced 2 pass / 10 fail. All ten failures were the strict stderr assertions after the expected output checks; the two overlong-path controls passed. The original warning was also observed on the maintained Linux runtime in OpenClaw's Bun-backed test path and a builtin-only explicit-override probe.

Fixed native proof: built signed commit a934daaf6f1b2b2a9330930e01ce22a26d29b65d on Linux x64 with the native debug+ASAN build route in the pinned Debian 13 / LLVM 23 environment. CI=true bun bd -j2 is build-only, so the proof then executed the produced binary directly:

./build/debug/bun-debug test test/cli/run/tsconfig-override.test.ts
./build/debug/bun-debug --tsconfig-override "$PWD/tsconfig.json" \
  -e 'import("./package.json").then(() => console.log("override-probe"))'
  • Verified the actual process executable, full revision, Bun.version === "1.4.3-debug", and runtime-reported ASAN status.
  • Binary SHA-256: dd507c8718910b5231eb10b1934c172bfa207e1c7d26f06a45d15626f70eb74d.
  • Complete CLI file: 12 pass / 0 fail. Coverage includes relative/absolute paths, other working directories, monorepo aliases, extends, path-limit errors, run/build selection, and unused malformed disk configs.
  • Original override CLI-shape probe: exit 0, expected stdout, empty stderr. This is owner-contract coverage, not a repeat of the full OpenClaw QA suite.
  • Pinned Prettier and rustfmt checks passed. The binary hash and native source manifest/bytes/modes/symlink targets were unchanged after proof. No ASAN/OOM failure; the build container, scratch, and AWS lease were cleaned up.

Final-head provenance: 8931d45cda02e91c423fdf93dc35c92ae815e73d is a signed, independently reviewed changelog-order follow-up to the tested a934daaf6f1b2b2a9330930e01ce22a26d29b65d. Every non-changelog blob is identical. It avoids the changelog-only collision with observed main at 97005730feadce4a5807557124b65533a04767c4 without rebasing or importing new production changes. The final metadata-only head was not rebuilt, and the binary above is explicitly the a934daaf6f1b2b2a9330930e01ce22a26d29b65d build.

Fixed native execution is currently Linux x64; normal exact-head hosted/platform gates remain required before landing.

vincentkoc and others added 2 commits September 27, 2026 20:38
Read explicit tsconfig overrides by their absolute path instead of borrowing the directory descriptor from the resolver walk. Keep ordinary config discovery and override precedence unchanged.

Adapt the narrow FD repair from oven-sh#34980 and require clean stderr for CLI run/build override resolution, including unused malformed disk configs.

Co-authored-by: robobun <[email protected]>
@vincentkoc

vincentkoc commented Sep 27, 2026 •

Copy link
Copy Markdown
Member Author

Validation and check applicability for head 8931d45cda02e91c423fdf93dc35c92ae815e73d:

  • Applicable Format, JavaScript lint, source lint, Clippy, Miri, and lol-html test checks passed. The advisory mordant job also passed every step.
  • The optional issue/duplicate discovery job failed during environment validation, before analysis: credential inputs were empty/unavailable to those action steps. This does not establish that a repository or global secret is absent, and that job performed no code review or product test.
  • Its workflow is .github/workflows/claude-find-issues-for-pr.yml, blob 0a33f044b76c85adc9c5bc126d5ebb6e8dded982. This PR-specific applicability exception was independently reviewed against the workflow, pinned action, own failed run, and effective branch rules. No credential changes or rerun were made. CI is not being described as entirely green.
  • Source review and native Linux debug+ASAN proof remain as documented in the PR body: 12/12 CLI tests plus clean stderr for the original override-shaped probe on compiled revision a934daaf6f1b2b2a9330930e01ce22a26d29b65d; final head differs only in changelog ordering. The failed discovery integration is a separate follow-up, not part of the FD repair.

@vincentkoc
vincentkoc marked this pull request as ready for review September 27, 2026 15:12
@vincentkoc
vincentkoc merged commit 76d5d12 into main Sep 27, 2026
10 of 11 checks passed
@vincentkoc
vincentkoc deleted the claude/fix-tsconfig-override-directory-fd-20260927 branch September 27, 2026 15:13
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