Repository navigation
fix(provider-acp-registry): prepared binary agents stay ready when the registry advances #26543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
31eabfe
8e1858f
78de6d6
ed562dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1393,6 +1393,27 @@ export const makeAcpRegistryCatalog = Effect.fn("AcpRegistryCatalog.make")(funct | |
| }; | ||
| }; | ||
|
|
||
| const hasInstalledBinaryVersion = Effect.fn("AcpRegistryCatalog.hasInstalledBinaryVersion")( | ||
| function* (agentId: string) { | ||
| const agentRoot = path.join(installsDirectory, agentId); | ||
| const versions = yield* fileSystem | ||
| .readDirectory(agentRoot) | ||
| .pipe(Effect.orElseSucceed((): Array<string> => [])); | ||
| for (const version of versions) { | ||
| for (const candidateTarget of resolveAcpRegistryPlatformTargetCandidates(platformTarget)) { | ||
| if ( | ||
| yield* fileSystem | ||
| .exists(path.join(agentRoot, version, candidateTarget)) | ||
| .pipe(Effect.orElseSucceed(() => false)) | ||
| ) { | ||
|
Comment on lines
+1405
to
+1408
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check an installed executable, not only its directory. If a user removes an older version’s executable but leaves its platform directory, this check returns
|
||
| return true; | ||
| } | ||
| } | ||
| } | ||
| return false; | ||
| }, | ||
| ); | ||
|
|
||
| const installBinary = Effect.fn("AcpRegistryCatalog.installBinary")(function* ( | ||
| agent: AcpRegistryAgent, | ||
| target: typeof AcpRegistryBinaryTarget.Type, | ||
|
|
@@ -1773,25 +1794,28 @@ export const makeAcpRegistryCatalog = Effect.fn("AcpRegistryCatalog.make")(funct | |
| const exists = yield* fileSystem | ||
| .exists(paths.executablePath) | ||
| .pipe(Effect.orElseSucceed(() => false)); | ||
| if (!exists) { | ||
| // Any prepared version keeps the agent ready; resolve installs the current one on demand. | ||
| if (!exists && !(yield* hasInstalledBinaryVersion(agent.id))) { | ||
| return { | ||
| status: "unprepared", | ||
| agentId, | ||
| version: agent.version, | ||
| distribution: "binary", | ||
| } as const; | ||
| } | ||
| yield* assertExecutableInRoot(paths.installRoot, paths.executablePath).pipe( | ||
| Effect.mapError((cause) => | ||
| isAcpRegistryError(cause) | ||
| ? cause | ||
| : new AcpRegistryError({ | ||
| reason: "install_failed", | ||
| detail: `Could not validate cached ACP Registry agent ${agent.id}.`, | ||
| cause, | ||
| }), | ||
| ), | ||
| ); | ||
| if (exists) { | ||
| yield* assertExecutableInRoot(paths.installRoot, paths.executablePath).pipe( | ||
| Effect.mapError((cause) => | ||
| isAcpRegistryError(cause) | ||
| ? cause | ||
| : new AcpRegistryError({ | ||
| reason: "install_failed", | ||
| detail: `Could not validate cached ACP Registry agent ${agent.id}.`, | ||
| cause, | ||
| }), | ||
| ), | ||
| ); | ||
| } | ||
| return { | ||
| status: "ready", | ||
| agentId, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
Repository: pingdotgg/t3code
Length of output: 26836
Script executed:
Repository: pingdotgg/t3code
Length of output: 24745
Web query:
@effect/platform-node 4.0.5 NodeServices Path.Path implementation Windows separatorsResult:
Use a host-independent path assertion.
When this test runs on Windows,
NodeServices.layersupplies host-native path behavior. The current/tools/...assertion can fail despite a successful install. Build the expected fragment withPath.Path, or compare normalized path components.