Skip to content

fix(bounded-fs): treat Windows UNKNOWN and EBUSY as benign fs errors - #1436

Merged
gewenyu99 merged 1 commit into
mainfrom
posthog-self-driving/fixbounded-fs-treat-windows-unknown-1de43e
Oct 12, 2026
Merged

gewenyu99 merged 1 commit into
mainfrom
posthog-self-driving/fixbounded-fs-treat-windows-unknown-1de43e

Conversation

@posthog

@posthog posthog Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Problem

  • On Windows, fs.readFileSync can fail with UNKNOWN (libuv cannot map the OS error, for example on a locked or cloud-placeholder file) or with EBUSY.
  • safeReadFile catches the error and skips the file, so users see no failure. But reportFsError sends every code that is not in BENIGN_FS_ERROR_CODES to error tracking.
  • Result: the check_env_keys .env scan makes noise in error tracking. The noise is split across many issues because the stack traces are different, and the team spends triage time on it.

Origin

  • Error tracking: issue 1, issue 2
  • First signal: 2026-10-12
  • Inbox report: open
  • Likely cause: 820e2e5
  • Task started by: auto-start, after the report was rated P3 and ready to fix

Changes

  • Add UNKNOWN and EBUSY to BENIGN_FS_ERROR_CODES. These errors now go only to the debug log. The walk still skips the file.
   'EMFILE', // too many open files (environmental, not a wizard bug)
   'ENFILE',
+  'EBUSY', // file locked by another process (Windows)
+  'UNKNOWN', // libuv could not map the OS error (Windows locked/placeholder files)
 ]);

Note

All bounded-fs walk and read steps share this set. A real UNKNOWN from another cause is also only logged.

Test plan

  • vitest run src/shared/utils/__tests__/bounded-fs-walk.test.ts: new cases check that safeReadFile returns null for UNKNOWN and EBUSY, logs once, and does not capture an exception.
  • pnpm typecheck
  • eslint and prettier --check on the changed files
  • Full pnpm test not run locally; covered by CI.

Agent context


Created with PostHog Desktop from this inbox report.

🤖 Generated with Claude Code

safeReadFile already skips files that fail with these codes. Log them to the debug file and do not send them to error tracking.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Generated-By: PostHog Desktop
Task-Id: 1ca4d362-2cc1-4ac4-be14-31f7343e400e
@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci ai-observability
  • /wizard-ci basic-integration
  • /wizard-ci feature-flags
  • /wizard-ci mcp-analytics
  • /wizard-ci replay-vision
  • /wizard-ci revenue
  • /wizard-ci self-driving
  • /wizard-ci warehouse
  • /wizard-ci warehouse-seeded

Test an individual app:

  • /wizard-ci ai-observability/anthropic
  • /wizard-ci ai-observability/google-adk
  • /wizard-ci ai-observability/groq
Show more apps
  • /wizard-ci ai-observability/manual-capture
  • /wizard-ci ai-observability/openai
  • /wizard-ci ai-observability/openai-agents
  • /wizard-ci ai-observability/opentelemetry
  • /wizard-ci ai-observability/vercel-ai
  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/flutter
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci feature-flags/django
  • /wizard-ci feature-flags/next-js
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci replay-vision/javascript-node
  • /wizard-ci replay-vision/next-js
  • /wizard-ci replay-vision/react-vite
  • /wizard-ci revenue/stripe
  • /wizard-ci self-driving/astro
  • /wizard-ci self-driving/fastapi
  • /wizard-ci self-driving/nuxt
  • /wizard-ci self-driving/react-router
  • /wizard-ci self-driving/sveltekit
  • /wizard-ci warehouse/monorepo-env
  • /wizard-ci warehouse/multi-source-next
  • /wizard-ci warehouse/stripe-node
  • /wizard-ci warehouse/zero-source
  • /wizard-ci warehouse-seeded/next-stripe
  • /wizard-ci warehouse-seeded/next-stripe-declined

Test against a Context Mill branch:

  • /wizard-ci all context-mill:my-branch

Add context-mill:<branch> to any command above to pin the Context Mill branch. It defaults to main.

Results will be posted here when complete.

@gewenyu99
gewenyu99 marked this pull request as ready for review October 12, 2026 13:37
@gewenyu99
gewenyu99 requested a review from a team as a code owner October 12, 2026 13:37
@gewenyu99
gewenyu99 merged commit 52220a3 into main Oct 12, 2026
21 checks passed
@gewenyu99
gewenyu99 deleted the posthog-self-driving/fixbounded-fs-treat-windows-unknown-1de43e branch October 12, 2026 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant