Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.8k
fix(providers): pin transport policy and lift the 60s cap on Groq and Cerebras#6306
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
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
bbc5853
fix(providers): pin transport policy and lift the 60s cap on Groq and…
waleedlatif1 6594289
fix(providers): cover the option payload, drop the unused discovery c…
waleedlatif1 3e3e2b3
fix(guardrails): forward the caller's abort signal to hallucination s…
waleedlatif1 f066fef
Merge remote-tracking branch 'origin/staging' into fix/provider-trans…
waleedlatif1 a03cba0
fix(guardrails): surface a cancelled scoring run as cancellation, not…
waleedlatif1 eeb262e
fix(guardrails): return 499 on a cancelled validation instead of a fa…
waleedlatif1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2 ...kflowId]/components/panel/components/editor/components/sub-block/components/text/text.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -24,6 +24,7 @@ import { refreshTokenIfNeeded } from '@/app/api/auth/oauth/utils' | ||
| import { projectResolvedSecretModelContent } from '@/executor/utils/resolved-secret-content-projection' | ||
| import type { ResolvedSecretTraceRegistry } from '@/executor/utils/resolved-secret-trace-registry' | ||
| import { executeProviderRequest } from '@/providers' | ||
| import { isAbortError } from '@/providers/streaming-tool-loop-shared' | ||
| import { getProviderFromModel } from '@/providers/utils' | ||
| const logger = createLogger('HallucinationValidator') | ||
| @@ -68,6 +69,12 @@ export interface HallucinationValidationInput { | ||
| billingAttribution: BillingAttributionSnapshot | ||
| requestId: string | ||
| resolvedSecretTraceRegistry: ResolvedSecretTraceRegistry | ||
| /** | ||
| * The caller's cancellation signal, forwarded to the scoring model exactly as the | ||
| * agent handler forwards `ctx.abortSignal`. Without it the scoring request outlives | ||
| * a cancelled request and keeps burning a provider slot until the transport gives up. | ||
| */ | ||
| abortSignal?: AbortSignal | ||
| } | ||
| /** | ||
| @@ -176,7 +183,8 @@ async function scoreHallucinationWithLLM( | ||
| providerCredentials: HallucinationValidationInput['providerCredentials'], | ||
| workspaceId: string | undefined, | ||
| requestId: string, | ||
| resolvedSecretTraceRegistry: ResolvedSecretTraceRegistry | ||
| resolvedSecretTraceRegistry: ResolvedSecretTraceRegistry, | ||
| abortSignal: AbortSignal | undefined | ||
| ): Promise<{ score: number; reasoning: string; cost: number }> { | ||
| try { | ||
| const contextText = ragContext.join('\n\n---\n\n') | ||
| @@ -251,6 +259,7 @@ Evaluate the consistency and provide your score and reasoning in JSON format.` | ||
| bedrockSecretKey: providerCredentials?.bedrockSecretKey, | ||
| bedrockRegion: providerCredentials?.bedrockRegion, | ||
| workspaceId, | ||
| abortSignal, | ||
| }, | ||
| { resolvedSecretTraceRegistry } | ||
| ) | ||
| @@ -290,6 +299,11 @@ Evaluate the consistency and provide your score and reasoning in JSON format.` | ||
| cost, | ||
| } | ||
| } catch (error: any) { | ||
| /** | ||
| * A cancelled run is not a scoring failure. Rewrapping it would erase the | ||
| * `AbortError` name the outer handler classifies on, so it propagates as-is. | ||
| */ | ||
| if (isAbortError(error)) throw error | ||
| logger.error(`[${requestId}] Error scoring with LLM`, { | ||
| error: error.message, | ||
| }) | ||
| @@ -317,6 +331,7 @@ export async function validateHallucination( | ||
| billingAttribution, | ||
| requestId, | ||
| resolvedSecretTraceRegistry, | ||
| abortSignal, | ||
| } = input | ||
| try { | ||
| @@ -371,7 +386,8 @@ export async function validateHallucination( | ||
| providerCredentials, | ||
| workspaceId, | ||
| requestId, | ||
| providerRegistry | ||
| providerRegistry, | ||
| abortSignal | ||
waleedlatif1 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| ) | ||
| logger.info(`[${requestId}] Confidence score: ${score}`, { | ||
| @@ -392,6 +408,12 @@ export async function validateHallucination( | ||
| : `Low confidence: score ${score}/10 is below threshold ${threshold}`, | ||
| } | ||
| } catch (error: any) { | ||
| /** | ||
| * Cancellation is surfaced as cancellation, not as a guardrail verdict. Returning | ||
| * `passed: false` here would fail content on a run the caller abandoned, which is | ||
| * indistinguishable to a consumer from the model actually hallucinating. | ||
| */ | ||
| if (isAbortError(error)) throw error | ||
| logger.error(`[${requestId}] Hallucination validation error`, { | ||
| error: error.message, | ||
| }) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.