@devries-cameron20 / composio Mirror · read-only / commits / 74ce25812
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 19:45 UTC

fix(ci): repair CLI binary and docs sync workflows (#3568)

This PR: - patches the Peekaboo sidecar build to rewrite the resolved `swift-system` `AT_RESOLVE_BENEATH` Darwin guard before compiling on GitHub macOS runners - adds regression coverage for the `swift-system` checkout patch and includes script tests in `@composio/cli-local-tools` Vitest - switches the SDK docs sync workflow to `anthropics/claude-code-action/base-action` so push-triggered automation does not fail on unsupported event parsing - moves Claude tool restrictions to `claude_args` and quotes `$GITHUB_OUTPUT` writes so the workflow passes `actionlint` - verifies the changed package and workflow with targeted tests, build, formatting, YAML parsing, and `actionlint`

Alberto Schiabel committed Jun 15, 2026 at 15:27 UTC 74ce25812e974ee0e4fd79bbf64e17a219ac34d9
5 files changed +120 -5
.github/workflows/docs.sdk-change-sync.yml
+5 -4
@@ -47,18 +47,19 @@ jobs:
47 python/composio/ > /tmp/sdk-diff.patch
48
49 if [ ! -s /tmp/sdk-diff.patch ]; then
50 - echo "has_changes=false" >> $GITHUB_OUTPUT
50 + echo "has_changes=false" >> "$GITHUB_OUTPUT"
51 else
52 - echo "has_changes=true" >> $GITHUB_OUTPUT
52 + echo "has_changes=true" >> "$GITHUB_OUTPUT"
53 echo "$(wc -l < /tmp/sdk-diff.patch) lines of SDK changes"
54 fi
55
56 - name: Check docs for staleness
57 if: steps.diff.outputs.has_changes == 'true'
58 - uses: anthropics/claude-code-action@fbda2eb1bdc90d319b8d853f5deb53bca199a7c1 # v1.0.140
58 + uses: anthropics/claude-code-action/base-action@fbda2eb1bdc90d319b8d853f5deb53bca199a7c1 # v1.0.140
59 with:
60 anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
61 - allowed_tools: "Read,Write,Edit,Glob,Grep"
61 + claude_args: |
62 + --allowedTools "Read,Write,Edit,Glob,Grep"
63 prompt: |
64 SDK source code was just updated. Check if any documentation needs to change.
65
ts/packages/cli-local-tools/scripts/build-peekaboo-binaries.ts
+18
@@ -4,6 +4,7 @@ import { $ } from 'bun';
4 import fs from 'node:fs/promises';
5 import path from 'node:path';
6 import { fileURLToPath } from 'node:url';
7 +import { patchSwiftSystemAtResolveBeneathGuard } from './swift-system-patches';
8
9 const scriptDir = path.dirname(fileURLToPath(import.meta.url));
10 const packageRoot = path.resolve(scriptDir, '..');
@@ -172,9 +173,26 @@ const patchSwiftConfigurationForCurrentToolchain = async () => {
173 }
174 };
175
176 +const patchSwiftSystemForCurrentSdk = async () => {
177 + const checkoutRoot = path.join(cliPackagePath, '.build/checkouts/swift-system');
178 + if (!(await exists(checkoutRoot))) {
179 + throw new Error(
180 + 'Swift package resolution completed but the swift-system checkout was not found.'
181 + );
182 + }
183 +
184 + const replacementCount = await patchSwiftSystemAtResolveBeneathGuard(checkoutRoot, exists);
185 + if (replacementCount > 0) {
186 + console.log(
187 + `Patched ${replacementCount} swift-system AT_RESOLVE_BENEATH guards for the current macOS SDK.`
188 + );
189 + }
190 +};
191 +
192 const buildTarget = async (target: Target) => {
193 console.log(`Building peekaboo for ${target.platform} (${target.swiftArch})...`);
194 await patchSwiftConfigurationForCurrentToolchain();
195 + await patchSwiftSystemForCurrentSdk();
196 await $`swift build --arch ${target.swiftArch} -c release -Xswiftc -Osize -Xswiftc -wmo -Xlinker -dead_strip`.cwd(
197 cliPackagePath
198 );
ts/packages/cli-local-tools/scripts/swift-system-patches.test.ts new
+36
@@ -0,0 +1,36 @@
1 +import { describe, expect, it } from 'vitest';
2 +import { patchSwiftSystemAtResolveBeneathGuardInSource } from './swift-system-patches';
3 +
4 +describe('swift-system build patches', () => {
5 + it('narrows AT_RESOLVE_BENEATH availability to FreeBSD', () => {
6 + const source = `#if canImport(Darwin, _version: 346) || os(FreeBSD)
7 +@_alwaysEmitIntoClient
8 +internal var _AT_RESOLVE_BENEATH: CInt { AT_RESOLVE_BENEATH }
9 +#endif
10 +`;
11 +
12 + const patched = patchSwiftSystemAtResolveBeneathGuardInSource(
13 + source,
14 + 'Sources/System/Internals/Constants.swift'
15 + );
16 +
17 + expect(patched.replacementCount).toBe(1);
18 + expect(patched.source).toContain('#if os(FreeBSD)');
19 + expect(patched.source).not.toContain('canImport(Darwin, _version: 346)');
20 + });
21 +
22 + it('is idempotent for already patched sources', () => {
23 + const source = `#if os(FreeBSD)
24 +@_alwaysEmitIntoClient
25 +internal var _AT_RESOLVE_BENEATH: CInt { AT_RESOLVE_BENEATH }
26 +#endif
27 +`;
28 +
29 + const patched = patchSwiftSystemAtResolveBeneathGuardInSource(
30 + source,
31 + 'Sources/System/Internals/Constants.swift'
32 + );
33 +
34 + expect(patched).toEqual({ source, replacementCount: 0 });
35 + });
36 +});
ts/packages/cli-local-tools/scripts/swift-system-patches.ts new
+60
@@ -0,0 +1,60 @@
1 +import fs from 'node:fs/promises';
2 +import path from 'node:path';
3 +
4 +const swiftSystemAtResolveBeneathGuard = '#if canImport(Darwin, _version: 346) || os(FreeBSD)';
5 +const swiftSystemFreeBsdOnlyGuard = '#if os(FreeBSD)';
6 +
7 +// swift-system 1.7.x exposes AT_RESOLVE_BENEATH on Darwin when compiling with
8 +// Swift 6.2, but GitHub's macOS SDK currently omits the C constant.
9 +const swiftSystemAtResolveBeneathFiles = [
10 + 'Sources/System/Internals/Constants.swift',
11 + 'Sources/System/FileSystem/Stat.swift',
12 +] as const;
13 +
14 +const countOccurrences = (source: string, pattern: string): number =>
15 + source.split(pattern).length - 1;
16 +
17 +export const patchSwiftSystemAtResolveBeneathGuardInSource = (
18 + source: string,
19 + filePath: string
20 +): { source: string; replacementCount: number } => {
21 + const replacementCount = countOccurrences(source, swiftSystemAtResolveBeneathGuard);
22 + if (replacementCount > 0) {
23 + return {
24 + source: source.replaceAll(swiftSystemAtResolveBeneathGuard, swiftSystemFreeBsdOnlyGuard),
25 + replacementCount,
26 + };
27 + }
28 +
29 + if (source.includes(swiftSystemFreeBsdOnlyGuard) && source.includes('AT_RESOLVE_BENEATH')) {
30 + return { source, replacementCount: 0 };
31 + }
32 +
33 + throw new Error(`Unable to patch swift-system AT_RESOLVE_BENEATH guard in ${filePath}`);
34 +};
35 +
36 +export const patchSwiftSystemAtResolveBeneathGuard = async (
37 + checkoutRoot: string,
38 + exists: (filePath: string) => Promise<boolean>
39 +): Promise<number> => {
40 + let replacementCount = 0;
41 +
42 + for (const filePath of swiftSystemAtResolveBeneathFiles) {
43 + const sourcePath = path.join(checkoutRoot, filePath);
44 + if (!(await exists(sourcePath))) {
45 + throw new Error(
46 + `Swift package resolution completed but swift-system ${filePath} was not found.`
47 + );
48 + }
49 +
50 + const source = await fs.readFile(sourcePath, 'utf8');
51 + const patched = patchSwiftSystemAtResolveBeneathGuardInSource(source, filePath);
52 + if (patched.replacementCount === 0) continue;
53 +
54 + await fs.chmod(sourcePath, 0o644).catch(() => undefined);
55 + await fs.writeFile(sourcePath, patched.source, 'utf8');
56 + replacementCount += patched.replacementCount;
57 + }
58 +
59 + return replacementCount;
60 +};
ts/packages/cli-local-tools/vitest.config.ts
+1 -1
@@ -16,7 +16,7 @@ export default defineConfig({
16 },
17 },
18 test: {
19 - include: ['src/**/*.test.ts'],
19 + include: ['src/**/*.test.ts', 'scripts/**/*.test.ts'],
20 exclude: ['vendor/**', 'dist/**', 'node_modules/**'],
21 },
22 });