Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(test): isolate module cache and honor connector scope

Steven Enamakel15f58ae3088b
diff --git a/.github/workflows/test-reusable.yml b/.github/workflows/test-reusable.yml
index abce240dc4..e647bd7c40 100644
--- a/.github/workflows/test-reusable.yml
+++ b/.github/workflows/test-reusable.yml
@@ -187,11 +187,12 @@ jobs:
set -euo pipefail
# Container HOME may be a runner-owned bind mount with mode 0755.
- # TinyBus refuses module paths beneath it, so point both its search
- # path and dirs::cache_dir at one private, per-job directory.
- export XDG_DATA_HOME="$(mktemp -d /tmp/openhuman-core-xdg.XXXXXX)"
+ # Keep TinyBus search paths and dirs::cache_dir private and separate:
+ # the cache itself must not also be scanned as a module search path.
+ export XDG_DATA_HOME="$(mktemp -d /tmp/openhuman-core-data.XXXXXX)"
chmod 700 "$XDG_DATA_HOME"
- export XDG_CACHE_HOME="$XDG_DATA_HOME"
+ export XDG_CACHE_HOME="$(mktemp -d /tmp/openhuman-core-cache.XXXXXX)"
+ chmod 700 "$XDG_CACHE_HOME"
integration_test_targets() {
find tests -maxdepth 1 -type f -name '*.rs' -print |
diff --git a/app/test/e2e/specs/composio-github-tools-tags.spec.ts b/app/test/e2e/specs/composio-github-tools-tags.spec.ts
index 43298fb94c..469626b73d 100644
--- a/app/test/e2e/specs/composio-github-tools-tags.spec.ts
+++ b/app/test/e2e/specs/composio-github-tools-tags.spec.ts
@@ -44,14 +44,16 @@ function makeTool(name: string, description = '') {
}
const STARS_TOOLS = [
- makeTool('GITHUB_LIST_REPOSITORIES_STARRED_BY_THE_AUTHENTICATED_USER', 'List starred repos'),
- makeTool('GITHUB_LIST_STARGAZERS', 'List stargazers'),
- makeTool('GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER', 'Star a repo'),
+ // Use actions in TinyConnectors' curated GitHub catalog. Backend listings
+ // apply the user's scope policy, which intentionally hides uncurated slugs.
+ makeTool('GITHUB_LIST_REPOSITORIES_FOR_THE_AUTHENTICATED_USER', 'List repositories'),
+ makeTool('GITHUB_GET_A_REPOSITORY', 'Get a repository'),
+ makeTool('GITHUB_LIST_REPOSITORY_COLLABORATORS', 'List repository collaborators'),
];
const REPOS_TOOLS = [
- makeTool('GITHUB_LIST_REPOSITORIES_FOR_THE_AUTHENTICATED_USER', 'List repos'),
- makeTool('GITHUB_CREATE_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER', 'Create a repo'),
+ makeTool('GITHUB_SEARCH_REPOSITORIES', 'Search repositories'),
+ makeTool('GITHUB_LIST_REPOSITORY_ISSUES', 'List repository issues'),
];
// ── Seed helper ───────────────────────────────────────────────────────────────
@@ -109,10 +111,10 @@ describe('Composio GitHub tools — tags query param flow', () => {
expect(tools.length).toBe(STARS_TOOLS.length);
const names = tools.map(t => t.function.name);
- expect(names).toContain('GITHUB_LIST_REPOSITORIES_STARRED_BY_THE_AUTHENTICATED_USER');
- expect(names).toContain('GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER');
+ expect(names).toContain('GITHUB_LIST_REPOSITORIES_FOR_THE_AUTHENTICATED_USER');
+ expect(names).toContain('GITHUB_GET_A_REPOSITORY');
// repos-only tool must not appear
- expect(names).not.toContain('GITHUB_LIST_REPOSITORIES_FOR_THE_AUTHENTICATED_USER');
+ expect(names).not.toContain('GITHUB_SEARCH_REPOSITORIES');
// Verify the mock received the correct query params.
const log = getRequestLog() as Array<{ method: string; url: string }>;
@@ -152,8 +154,8 @@ describe('Composio GitHub tools — tags query param flow', () => {
expect(tools.length).toBe(expectedCount);
// Both tag sets should be present.
- expect(names).toContain('GITHUB_LIST_REPOSITORIES_STARRED_BY_THE_AUTHENTICATED_USER');
- expect(names).toContain('GITHUB_LIST_REPOSITORIES_FOR_THE_AUTHENTICATED_USER');
+ expect(names).toContain('GITHUB_GET_A_REPOSITORY');
+ expect(names).toContain('GITHUB_SEARCH_REPOSITORIES');
// Verify the mock URL carries both tags (comma-separated).
const log = getRequestLog() as Array<{ method: string; url: string }>;
@@ -209,7 +211,7 @@ describe('Composio GitHub tools — tags query param flow', () => {
expect(toolsHit).toBeDefined();
expect(toolsHit!.url).not.toContain('tags=');
// Stars tools must not appear in the gmail response.
- expect(names).not.toContain('GITHUB_LIST_REPOSITORIES_STARRED_BY_THE_AUTHENTICATED_USER');
+ expect(names).not.toContain('GITHUB_LIST_REPOSITORIES_FOR_THE_AUTHENTICATED_USER');
console.log(`${LOG_PREFIX} GT.3: PASSED — mock URL: ${toolsHit!.url}`);
});
@@ -229,7 +231,7 @@ describe('Composio GitHub tools — tags query param flow', () => {
{ name: 'tokio', full_name: 'tokio-rs/tokio', stargazers_count: 24000 },
];
setMockBehavior(
- 'composioExecuteResponse_GITHUB_LIST_REPOSITORIES_STARRED_BY_THE_AUTHENTICATED_USER',
+ 'composioExecuteResponse_GITHUB_LIST_REPOSITORIES_FOR_THE_AUTHENTICATED_USER',
JSON.stringify({ repositories: STARRED_REPOS })
);
@@ -241,10 +243,9 @@ describe('Composio GitHub tools — tags query param flow', () => {
const listedPayload = listed.result as any;
const tools = listedPayload?.result?.tools ?? listedPayload?.tools ?? [];
const selectedAction = tools.find(
- (tool: any) =>
- tool.function?.name === 'GITHUB_LIST_REPOSITORIES_STARRED_BY_THE_AUTHENTICATED_USER'
+ (tool: any) => tool.function?.name === 'GITHUB_LIST_REPOSITORIES_FOR_THE_AUTHENTICATED_USER'
)?.function?.name;
- expect(selectedAction).toBe('GITHUB_LIST_REPOSITORIES_STARRED_BY_THE_AUTHENTICATED_USER');
+ expect(selectedAction).toBe('GITHUB_LIST_REPOSITORIES_FOR_THE_AUTHENTICATED_USER');
const executed = await callOpenhumanRpc('openhuman.composio_execute', {
tool: selectedAction,
diff --git a/scripts/__tests__/hosted-json-rpc-enumeration.test.mjs b/scripts/__tests__/hosted-json-rpc-enumeration.test.mjs
index 28a2d7cdba..2e1a58d0ac 100644
--- a/scripts/__tests__/hosted-json-rpc-enumeration.test.mjs
+++ b/scripts/__tests__/hosted-json-rpc-enumeration.test.mjs
@@ -50,8 +50,8 @@ if [[ "$*" == *"--test json_rpc_e2e"* ]]; then
echo EXECUTED-JSON-RPC
fi
if [[ "$*" == *"test -p openhuman --lib"* ]]; then
- [[ -n "\${XDG_CACHE_HOME:-}" && "$XDG_CACHE_HOME" == "\${XDG_DATA_HOME:-}" && -d "$XDG_CACHE_HOME" ]] || {
- echo "core tests need a private XDG cache alongside their private XDG data directory" >&2
+ [[ -n "\${XDG_CACHE_HOME:-}" && -n "\${XDG_DATA_HOME:-}" && "$XDG_CACHE_HOME" != "$XDG_DATA_HOME" && -d "$XDG_CACHE_HOME" && -d "$XDG_DATA_HOME" ]] || {
+ echo "core tests need separate private XDG cache and data directories" >&2
exit 13
}
echo PRIVATE-XDG-CACHE
diff --git a/scripts/__tests__/rust-e2e-enumeration.test.mjs b/scripts/__tests__/rust-e2e-enumeration.test.mjs
index 550c0fa74d..e5aa771281 100644
--- a/scripts/__tests__/rust-e2e-enumeration.test.mjs
+++ b/scripts/__tests__/rust-e2e-enumeration.test.mjs
@@ -53,14 +53,17 @@ test("Rust E2E keeps module cache paths out of a shared runner home", (t) => {
output.trim().split("\n").map((line) => line.split("=", 2)),
);
assert.ok(values.DATA, output);
- assert.equal(values.CACHE, values.DATA, output);
+ assert.ok(values.CACHE && values.CACHE !== values.DATA, output);
assert.equal(values.CREATED_DATA, values.DATA, output);
- assert.equal(values.CREATED_CACHE, "", output);
+ assert.equal(values.CREATED_CACHE, values.CACHE, output);
assert.equal(fs.statSync(values.DATA).mode & 0o777, 0o700);
+ assert.equal(fs.statSync(values.CACHE).mode & 0o777, 0o700);
assert.ok(!values.DATA.startsWith(home), output);
} finally {
const createdData = output?.match(/^CREATED_DATA=(.*)$/m)?.[1];
+ const createdCache = output?.match(/^CREATED_CACHE=(.*)$/m)?.[1];
if (createdData) fs.rmSync(createdData, { recursive: true, force: true });
+ if (createdCache) fs.rmSync(createdCache, { recursive: true, force: true });
fs.rmSync(home, { recursive: true, force: true });
}
});
diff --git a/scripts/test-rust-e2e.sh b/scripts/test-rust-e2e.sh
index c49c23df4b..0814c4125e 100755
--- a/scripts/test-rust-e2e.sh
+++ b/scripts/test-rust-e2e.sh
@@ -133,17 +133,13 @@ if [ -z "${XDG_DATA_HOME:-}" ]; then
CREATED_XDG_DATA_HOME="$XDG_DATA_HOME"
fi
-# dirs::cache_dir uses XDG_CACHE_HOME rather than XDG_DATA_HOME. Keep the
-# release cache under the same private root when this runner created it, so
-# TinyBus never falls back to the runner-owned $HOME/.cache mount.
+# dirs::cache_dir uses XDG_CACHE_HOME rather than XDG_DATA_HOME. Give it a
+# separate private root: the release cache must not also be scanned as a
+# TinyBus module search path.
if [ -z "${XDG_CACHE_HOME:-}" ]; then
- if [ -n "$CREATED_XDG_DATA_HOME" ]; then
- XDG_CACHE_HOME="$XDG_DATA_HOME"
- else
- XDG_CACHE_HOME="$(mktemp -d "${TMPDIR:-/tmp}/openhuman-rust-e2e-cache.XXXXXX")"
- chmod 700 "$XDG_CACHE_HOME"
- CREATED_XDG_CACHE_HOME="$XDG_CACHE_HOME"
- fi
+ XDG_CACHE_HOME="$(mktemp -d "${TMPDIR:-/tmp}/openhuman-rust-e2e-cache.XXXXXX")"
+ chmod 700 "$XDG_CACHE_HOME"
+ CREATED_XDG_CACHE_HOME="$XDG_CACHE_HOME"
export XDG_CACHE_HOME
fi