ComposioHQ/composio · error · Error

Swift package resolution completed but BetterSwiftAX ${fileN

Error message

Swift package resolution completed but BetterSwiftAX ${fileName} was not found.

What it means

The patcher found the BetterSwiftAX checkout but one of the specific source files it rewrites (betterSwiftAxFallbackFiles list) is missing, meaning the upstream file was renamed, moved, or split in the resolved version.

Source

Thrown at ts/packages/cli-local-tools/scripts/build-beeper-imessage-binaries.ts:124

const patchBetterSwiftAxForCurrentSdk = async () => {
  await $`swift package resolve`.cwd(submodulePath);

  const checkoutRoot = path.join(
    submodulePath,
    '.build/checkouts/BetterSwiftAX/Sources/AccessibilityControl'
  );
  if (!(await exists(checkoutRoot))) {
    throw new Error(
      'Swift package resolution completed but the BetterSwiftAX AccessibilityControl checkout was not found.'
    );
  }

  let replacementCount = 0;
  for (const fileName of betterSwiftAxFallbackFiles) {
    const sourcePath = path.join(checkoutRoot, fileName);
    if (!(await exists(sourcePath))) {
      throw new Error(
        `Swift package resolution completed but BetterSwiftAX ${fileName} was not found.`
      );
    }

    const source = await fs.readFile(sourcePath, 'utf8');
    let fileReplacementCount = 0;
    const patched = source.replace(betterSwiftAxConstantReferencePattern, constantName => {
      fileReplacementCount += 1;
      return betterSwiftAxConstantLiteral(constantName);
    });

    if (patched !== source) {
      await fs.chmod(sourcePath, 0o644).catch(() => undefined);
      await fs.writeFile(sourcePath, patched, 'utf8');
      replacementCount += fileReplacementCount;
    }
  }

View on GitHub (pinned to 64b1b85502)

Solutions

  1. Pin BetterSwiftAX back to the last-known-good version in Package.resolved.
  2. Locate where the constants moved (grep for kAX in .build/checkouts/BetterSwiftAX) and update betterSwiftAxFallbackFiles or the path logic.
Defensive patterns

Strategy: validation

Validate before calling

for (const fileName of betterSwiftAxFallbackFiles) {
  if (!(await exists(path.join(checkoutRoot, fileName)))) throw new Error(`missing ${fileName}`);
}

Prevention

When it happens

Trigger: The resolved BetterSwiftAX revision no longer contains one of the fallback source files at the expected path inside Sources/AccessibilityControl.

Common situations: Upstream refactor renaming the file containing kAX constant fallbacks; dependency drift after an unpinned resolve.

Related errors


AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28). Data as JSON: /api/errors/6d93bf807eb5b5d6. Report an issue: GitHub.