Repository navigation
fix(provider): make readiness probe timeouts configurable #33275
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
715bcd7
ff740f4
0ccc8aa
1190b59
700ec55
bf76606
0ea88cb
9bf8325
ea86f06
eee5f6f
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 |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| import { resolveProviderProbeTimeoutMs } from "@t3tools/provider-core/server/snapshotProbe"; | ||
| import { | ||
| AcpRegistryListProvidersResult, | ||
| AcpRegistryOperationError, | ||
|
|
@@ -42,8 +43,7 @@ const MAX_ID_LENGTH = 128; | |
| const MAX_NAME_LENGTH = 160; | ||
| const MAX_DESCRIPTION_LENGTH = 1_024; | ||
| const MAX_COMMAND_LINE_LENGTH = 2_048; | ||
| const PROBE_TIMEOUT_SECONDS = 60; | ||
| const PROBE_TIMEOUT = `${PROBE_TIMEOUT_SECONDS} seconds`; | ||
| const PROBE_TIMEOUT_MS = 60_000; | ||
| const COMMAND_ADVERTISEMENT_GRACE = "500 millis"; | ||
| const PROBE_SESSION_DELETE_TIMEOUT = "5 seconds"; | ||
|
|
||
|
|
@@ -332,6 +332,11 @@ export const probeAcpRegistryConfiguration = Effect.fn("AcpRegistryProbe.probeCo | |
| | SecureRandom.SecureRandom | ||
| > { | ||
| const catalog = yield* AcpRegistrySupport.AcpRegistryCatalog; | ||
| const probeTimeoutMs = resolveProviderProbeTimeoutMs( | ||
| "acp_registry", | ||
| PROBE_TIMEOUT_MS, | ||
| input.environment, | ||
| ); | ||
| const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; | ||
| const random = yield* SecureRandom.SecureRandom; | ||
| const pty = yield* Effect.serviceOption(PtyAdapter.PtyAdapter); | ||
|
|
@@ -444,12 +449,12 @@ export const probeAcpRegistryConfiguration = Effect.fn("AcpRegistryProbe.probeCo | |
| }).pipe( | ||
| Effect.scoped, | ||
| Effect.timeoutOrElse({ | ||
| duration: PROBE_TIMEOUT, | ||
| duration: probeTimeoutMs, | ||
|
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. Keep package installation outside the probe override.
|
||
| orElse: () => | ||
| Effect.fail( | ||
| new AcpRegistryOperationError({ | ||
| reason: "probe_failed", | ||
| message: `The ACP agent did not resolve and create a test session within ${PROBE_TIMEOUT_SECONDS} seconds. Package installation or agent startup may be slow; this check retries on the next provider refresh.`, | ||
| message: `The ACP agent did not resolve and create a test session within ${probeTimeoutMs / 1_000} seconds. Package installation or agent startup may be slow; this check retries on the next provider refresh.`, | ||
| }), | ||
| ), | ||
| }), | ||
|
|
||
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.
Preserve discovery time for short overrides.
For any valid override of 250 ms or less, subtracting the fixed margin puts the discovery deadline at or before
spawnedAtMs. Even if initialization finishes quickly, model and skill discovery never run, and the provider reports a missing model catalog. Scale the margin for short budgets.