@devries-cameron20 / t3code Mirror · read-only / commits / 812cb68b7d
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

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

Synced Nov 22, 10:45 UTC

fix(provider-acp-registry): install agents with large archive listings (#25545)

Co-authored-by: maria-rcks <maria@kuuro.net>

kareemsetl committed Oct 30, 2026 at 16:16 UTC 812cb68b7d2164ef8c87dcec8bb7ce73cdeb6975
2 files changed +21 -5
packages/provider-acp-registry/src/server/AcpRegistrySupport.test.ts
+9 -1
@@ -698,7 +698,7 @@ describe("AcpRegistrySupport", () => {
698 },
699 );
700
701 - it.effect("installs a tar archive containing a root directory entry", () => {
701 + it.effect("installs a tar archive with a root entry and a listing larger than 1 MiB", () => {
702 const downloadUrl = "https://registry.test/agent.tar.gz";
703 const agent = makeAgent({
704 binary: { "linux-x86_64": { archive: downloadUrl, cmd: "./agent" } },
@@ -709,6 +709,14 @@ describe("AcpRegistrySupport", () => {
709 const source = `${cacheDir}/source`;
710 yield* fileSystem.makeDirectory(source);
711 yield* fileSystem.writeFileString(`${source}/agent`, "#!/bin/sh\necho managed\n");
712 + // 5,000 long names list past the generic 1 MiB command output cap.
713 + const entries = `${source}/entries`;
714 + yield* fileSystem.makeDirectory(entries);
715 + yield* Effect.forEach(
716 + Array.from({ length: 5_000 }, (_, index) => index),
717 + (index) => fileSystem.writeFileString(`${entries}/${index}-${"e".repeat(240)}`, ""),
718 + { concurrency: 16 },
719 + );
720 const archivePath = `${cacheDir}/agent.tar.gz`;
721 const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
722 const tar = yield* spawner.spawn(
packages/provider-acp-registry/src/server/AcpRegistrySupport.ts
+12 -4
@@ -51,6 +51,9 @@ const ACP_REGISTRY_URL = "https://cdn.agentclientprotocol.com/registry/v1/latest
51
52 const MAX_REGISTRY_BYTES = 1024 * 1024;
53 const MAX_ARCHIVE_BYTES = 1024 * 1024 * 1024;
54 +const MAX_COMMAND_OUTPUT_BYTES = 1024 * 1024;
55 +// Archive listings can exceed the output of package-manager commands.
56 +const MAX_ARCHIVE_LISTING_BYTES = 64 * 1024 * 1024;
57 const MAX_PACKAGE_MANIFEST_BYTES = 1024 * 1024;
58 // Older clients omit the limit and validate responses against a 20-agent cap.
59 const DEFAULT_SEARCH_LIMIT = 20;
@@ -916,6 +919,7 @@ export const makeAcpRegistryCatalog = Effect.fn("AcpRegistryCatalog.make")(funct
919 readonly env?: NodeJS.ProcessEnv;
920 readonly timeout?: Duration.Input;
921 readonly truncatedOutputReason?: AcpRegistryErrorReason;
922 + readonly maxStdoutBytes?: number;
923 } = {},
924 ) {
925 const collect = Effect.gen(function* () {
@@ -934,8 +938,11 @@ export const makeAcpRegistryCatalog = Effect.fn("AcpRegistryCatalog.make")(funct
938 yield* Effect.addFinalizer(() => child.kill().pipe(Effect.ignore));
939 const [stdout, stderr, exitCode] = yield* Effect.all(
940 [
937 - collectUint8StreamText({ stream: child.stdout, maxBytes: 1024 * 1024 }),
938 - collectUint8StreamText({ stream: child.stderr, maxBytes: 1024 * 1024 }),
941 + collectUint8StreamText({
942 + stream: child.stdout,
943 + maxBytes: options.maxStdoutBytes ?? MAX_COMMAND_OUTPUT_BYTES,
944 + }),
945 + collectUint8StreamText({ stream: child.stderr, maxBytes: MAX_COMMAND_OUTPUT_BYTES }),
946 child.exitCode,
947 ],
948 { concurrency: "unbounded" },
@@ -1532,10 +1539,11 @@ export const makeAcpRegistryCatalog = Effect.fn("AcpRegistryCatalog.make")(funct
1539 : platform === "win32"
1540 ? ["-tf", archivePath]
1541 : undefined;
1542 + const listingOptions = { maxStdoutBytes: MAX_ARCHIVE_LISTING_BYTES };
1543 const entries =
1544 listArgs === undefined
1537 - ? yield* runCommand("unzip", ["-Z1", archivePath])
1538 - : yield* runCommand(tarCommand, listArgs);
1545 + ? yield* runCommand("unzip", ["-Z1", archivePath], listingOptions)
1546 + : yield* runCommand(tarCommand, listArgs, listingOptions);
1547 if (!validateArchiveEntries(entries)) {
1548 return yield* new AcpRegistryError({
1549 reason: "archive_invalid",