Skip to content

Add new provider embdeding#953

Merged
gearnode merged 1 commit intomainfrom
add-new-provider-embdeding
Mar 31, 2026
Merged

Add new provider embdeding#953
gearnode merged 1 commit intomainfrom
add-new-provider-embdeding

Conversation

@gearnode
Copy link
Copy Markdown
Contributor

@gearnode gearnode commented Mar 28, 2026

Summary by cubic

Fixes compliance page login redirects to custom domains by making redirect host checks dynamic and validating against Trust service domains. OIDC/SAML callbacks now return users to the correct custom domain instead of falling back to the console.

  • Bug Fixes
    • Refactored pkg/saferedirect: added AllowedHostFunc, New, and StaticHosts; Validate and GetSafeRedirectURL now take context.Context.
    • pkg/server/api/api.go: builds a SafeRedirect that allows cfg.BaseURL.Host() and any host found via Trust (GetByDomainName).
    • Connect OIDC resolver/handler updated to inject the dynamic allowed-host function; SAML and Console routes use StaticHosts for base URL and OAuth provider hosts (slack.com, accounts.google.com).
    • Tests expanded for dynamic/static host checks and redirect edge cases; trust resolver validates Continue via Validate(ctx, ...).

Written for commit 419c93f. Summary will update on new commits.

@gearnode gearnode force-pushed the add-new-provider-embdeding branch from 0f113e7 to 895aacc Compare March 28, 2026 21:32
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7 issues found across 24 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="pkg/llm/openai/embedding_test.go">

<violation number="1" location="pkg/llm/openai/embedding_test.go:44">
P2: Avoid `require.NoError` inside the `httptest` handler goroutine; use a non-`FailNow` assertion there.

(Based on your team's feedback about only flagging `require`/`FailNow` misuse inside goroutines.) [FEEDBACK_USED]</violation>
</file>

<file name="pkg/llm/bedrock/provider_test.go">

<violation number="1" location="pkg/llm/bedrock/provider_test.go:54">
P1: Avoid `require.*` inside `httptest` handlers; use non-terminating assertions and return from the handler on failure.

(Based on your team's feedback about not using `FailNow`-style assertions from non-test goroutines.) [FEEDBACK_USED]</violation>

<violation number="2" location="pkg/llm/bedrock/provider_test.go:295">
P2: Check and assert the JSON decode error before accessing decoded fields to avoid panic-based test failures.</violation>
</file>

<file name="pkg/llm/ollama/provider_test.go">

<violation number="1" location="pkg/llm/ollama/provider_test.go:44">
P2: Avoid `require.*` inside `httptest` handlers; use non-`FailNow` assertions (or explicit error + return) because handlers run in separate goroutines.

(Based on your team's feedback about `require`/`FailNow` misuse inside goroutines.) [FEEDBACK_USED]</violation>
</file>

<file name="pkg/llm/anthropic/provider_test.go">

<violation number="1" location="pkg/llm/anthropic/provider_test.go:45">
P2: Avoid `require.*` inside `httptest` handlers; use non-`FailNow` assertions (or explicit error handling) because handlers run in separate goroutines.

(Based on your team's feedback about only flagging `FailNow` misuse in non-test goroutines.) [FEEDBACK_USED]</violation>
</file>

<file name="pkg/llm/perplexity/provider.go">

<violation number="1" location="pkg/llm/perplexity/provider.go:138">
P1: `buildParams` silently ignores request options like stop sequences, tools, tool choice, and response format, so caller intent is dropped for this provider.</violation>

<violation number="2" location="pkg/llm/perplexity/provider.go:154">
P1: Tool-calling conversation state is lost because `buildMessages` omits assistant tool calls and `RoleTool` messages.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread pkg/llm/bedrock/provider_test.go Outdated
Comment thread pkg/llm/perplexity/provider.go Outdated
Comment thread pkg/llm/perplexity/provider.go Outdated
Comment thread pkg/llm/openai/embedding_test.go Outdated
Comment thread pkg/llm/bedrock/provider_test.go Outdated
Comment thread pkg/llm/ollama/provider_test.go Outdated
Comment thread pkg/llm/anthropic/provider_test.go Outdated
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 issues found across 5 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="pkg/llm/ollama/provider_test.go">

<violation number="1" location="pkg/llm/ollama/provider_test.go:44">
P2: Use `require.NoError` here so the test stops before unsafe request-field type assertions when JSON decode fails.</violation>

<violation number="2" location="pkg/llm/ollama/provider_test.go:274">
P2: Keep this as `require.True` so the test aborts before calling `Flush()` on a non-flusher response writer.</violation>

<violation number="3" location="pkg/llm/ollama/provider_test.go:405">
P2: Use `require.Len` before fixed-index access to avoid panics and keep failures attributable to the actual length mismatch.</violation>
</file>

<file name="pkg/llm/anthropic/provider_test.go">

<violation number="1" location="pkg/llm/anthropic/provider_test.go:171">
P2: Use a guard when asserting `system` length before indexing `system[0]`; the current non-fatal assert can lead to panic.</violation>

<violation number="2" location="pkg/llm/anthropic/provider_test.go:178">
P2: Guard the `messages` length assertion before indexing `messages[0]` to avoid index-out-of-range panic in the test handler.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread pkg/llm/ollama/provider_test.go Outdated
Comment thread pkg/llm/ollama/provider_test.go Outdated
Comment thread pkg/llm/ollama/provider_test.go Outdated
Comment thread pkg/llm/anthropic/provider_test.go Outdated
Comment thread pkg/llm/anthropic/provider_test.go Outdated
@gearnode gearnode force-pushed the add-new-provider-embdeding branch from 2cf3946 to badbd87 Compare March 29, 2026 10:01
@gearnode gearnode requested a review from a team March 30, 2026 07:58
@gearnode gearnode added the status: needs-review Ready for review by maintainers label Mar 30, 2026
@gearnode gearnode force-pushed the add-new-provider-embdeding branch from badbd87 to d5879d9 Compare March 30, 2026 07:59
@SachaProbo SachaProbo force-pushed the add-new-provider-embdeding branch from d5879d9 to 2c4665a Compare March 30, 2026 12:31
SafeRedirect previously matched against a single static host string,
so OIDC callbacks always fell back to the console instead of
redirecting back to compliance pages on custom domains. Refactor
AllowedHost into a dynamic AllowedHostFunc and wire a trust-service
lookup into the connect handler so custom domain hosts are accepted.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
@gearnode gearnode force-pushed the add-new-provider-embdeding branch from 2c4665a to 419c93f Compare March 31, 2026 09:03
@gearnode gearnode merged commit 419c93f into main Mar 31, 2026
19 checks passed
@gearnode gearnode deleted the add-new-provider-embdeding branch March 31, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: needs-review Ready for review by maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants