mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-22 20:29:18 +01:00
fix(runtime): honor provider acquisition timeout defaults (#14097)
Declare provider acquisition budgets so slow Daytona creation does not hit the host’s 30-second fallback. Bound creation and setup to one deadline and preserve scoped cleanup ownership after timeout. Legacy drivers retain their original call shape. Validated by 238 provider/manifest tests, focused database and heartbeat regressions, root and standalone provider typecheck/build, and full CI. Local broad tests also expose recorded Mac baseline limitations. Greptile 5/5. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
7f3c06dac4
commit
ffa32373bc
9 files changed
+295
-77
No files matched your search
@@ -205,6 +205,13 @@ export interface PluginEnvironmentDriverDeclaration {
|
||||
displayName: string;
|
||||
/** Optional description for operator-facing docs or UI affordances. */
|
||||
description?: string;
|
||||
/**
|
||||
* Default provider budget for a fresh lease acquisition, in milliseconds.
|
||||
* The host adds RPC overhead. A valid explicit config.timeoutMs overrides
|
||||
* this default; bridgeRequestTimeoutMs can extend the resulting budget.
|
||||
* Omit to retain the worker's normal RPC timeout. This is not lease lifetime.
|
||||
*/
|
||||
defaultAcquireTimeoutMs?: number;
|
||||
/**
|
||||
* Sandbox providers must opt in before the host retains and resumes provider
|
||||
* leases across runs. Providers without this flag keep per-run acquire/release
|
||||
|
||||
@@ -276,6 +276,24 @@ describe("plugin UI slot validators", () => {
|
||||
});
|
||||
|
||||
describe("sandbox provider capability declaration validators", () => {
|
||||
it("preserves a declared acquisition budget and keeps it optional", () => {
|
||||
const parsed = pluginManifestV1Schema.parse(
|
||||
buildSandboxProviderManifest({ defaultAcquireTimeoutMs: 300_000 }),
|
||||
);
|
||||
expect(parsed.environmentDrivers?.[0]?.defaultAcquireTimeoutMs).toBe(300_000);
|
||||
const legacy = pluginManifestV1Schema.parse(buildSandboxProviderManifest({}));
|
||||
expect(legacy.environmentDrivers?.[0]?.defaultAcquireTimeoutMs).toBeUndefined();
|
||||
});
|
||||
|
||||
it.each([0, -1, 1.5, Infinity, NaN, "300000", 86_400_001])(
|
||||
"rejects an invalid acquisition budget: %s",
|
||||
(defaultAcquireTimeoutMs) => {
|
||||
expect(pluginManifestV1Schema.safeParse(
|
||||
buildSandboxProviderManifest({ defaultAcquireTimeoutMs }),
|
||||
).success).toBe(false);
|
||||
},
|
||||
);
|
||||
|
||||
it("test_manifest_accepts_sandbox_capabilities_and_rejects_unknown_capability_keys", () => {
|
||||
const parsed = pluginManifestV1Schema.parse(
|
||||
buildSandboxProviderManifest({
|
||||
|
||||
@@ -184,6 +184,7 @@ export const pluginEnvironmentDriverDeclarationSchema = z.object({
|
||||
kind: z.enum(["environment_driver", "sandbox_provider"]).optional(),
|
||||
displayName: z.string().min(1).max(100),
|
||||
description: z.string().max(500).optional(),
|
||||
defaultAcquireTimeoutMs: z.number().int().positive().max(86_400_000).optional(),
|
||||
supportsReusableLeases: z.boolean().optional(),
|
||||
sandboxCapabilities: sandboxProviderCapabilitiesSchema.optional(),
|
||||
supportsInteractiveSetup: z.boolean().optional(),
|
||||
|
||||
Reference in new issue
Block a user