Skip to content

Conversation

@vishalveerareddy123
Copy link

@vishalveerareddy123 vishalveerareddy123 commented Nov 11, 2025

Summary by cubic

Add Azure OpenAI support, a YouTube video summarizer, image uploads with captions, and a lightweight iOS client. Also harden SearXNG search and file processing.

  • New Features

    • Added Azure OpenAI provider ('azure-openai') for chat and embeddings with configurable endpoints, versions, and deployments.
    • YouTube summarization: new API and UI action to fetch transcripts and return a concise summary with key points.
    • File uploads now accept images and auto-caption them; embeddings are optional. Docker Compose includes a SearXNG service and wires SEARXNG_API_URL.
  • Bug Fixes

    • SearXNG: trim/validate base URL, build requests with URL API, and handle non-OK/non-JSON responses safely.
    • Robust file handling: tolerate missing/invalid extracted or embedding data in metaSearchAgent and files utils.
    • Minor UI fixes in model settings and add-provider dialog; safer uploads flow and error handling.

Written for commit 38594f2. Summary will update automatically on new commits.

Copy link
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.

1 issue found across 5 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="src/lib/searxng.ts">

<violation number="1" location="src/lib/searxng.ts:46">
`new URL(&#39;/search&#39;, baseUrl)` drops any existing path segments from the configured SearXNG URL, so instances hosted under a subpath (e.g. https://host/searxng) will now be queried at the wrong endpoint.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Ask questions if you need clarification on any suggestion

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

);
}

const url = new URL('/search', baseUrl);
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 11, 2025

Choose a reason for hiding this comment

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

new URL('/search', baseUrl) drops any existing path segments from the configured SearXNG URL, so instances hosted under a subpath (e.g. https://host/searxng) will now be queried at the wrong endpoint.

Prompt for AI agents
Address the following comment on src/lib/searxng.ts at line 46:

<comment>`new URL(&#39;/search&#39;, baseUrl)` drops any existing path segments from the configured SearXNG URL, so instances hosted under a subpath (e.g. https://host/searxng) will now be queried at the wrong endpoint.</comment>

<file context>
@@ -23,9 +22,29 @@ export const searchSearxng = async (
+    );
+  }
+
+  const url = new URL(&#39;/search&#39;, baseUrl);
+  url.searchParams.append(&#39;format&#39;, &#39;json&#39;);
   url.searchParams.append(&#39;q&#39;, query);
</file context>

✅ Addressed in e1e0436

Copy link
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.

Reviewed changes from recent commits (found 1 issue).

1 issue found across 1 file

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="src/lib/searxng.ts">

<violation number="1" location="src/lib/searxng.ts:51">
Using `new URL(&#39;search&#39;, normalizedBase)` appends `search` to whatever path the user configured. If the SearXNG URL already includes `/search`, this generates `.../search/search` and the request fails. Switching back to an absolute path keeps compatibility with those configurations.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

normalizedBase.pathname = `${normalizedBase.pathname}/`;
}

const url = new URL('search', normalizedBase);
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 11, 2025

Choose a reason for hiding this comment

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

Using new URL('search', normalizedBase) appends search to whatever path the user configured. If the SearXNG URL already includes /search, this generates .../search/search and the request fails. Switching back to an absolute path keeps compatibility with those configurations.

Prompt for AI agents
Address the following comment on src/lib/searxng.ts at line 51:

<comment>Using `new URL(&#39;search&#39;, normalizedBase)` appends `search` to whatever path the user configured. If the SearXNG URL already includes `/search`, this generates `.../search/search` and the request fails. Switching back to an absolute path keeps compatibility with those configurations.</comment>

<file context>
@@ -43,7 +43,12 @@ export const searchSearxng = async (
+    normalizedBase.pathname = `${normalizedBase.pathname}/`;
+  }
+
+  const url = new URL(&#39;search&#39;, normalizedBase);
   url.searchParams.append(&#39;format&#39;, &#39;json&#39;);
   url.searchParams.append(&#39;q&#39;, query);
</file context>
Fix with Cubic

Copy link
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 26 files (reviewed changes from recent commits).

Prompt for AI agents (all 5 issues)

Understand the root cause of the following 5 issues and fix them.


<file name="mobile/PerplexicaMobile/Info.plist">

<violation number="1" location="mobile/PerplexicaMobile/Info.plist:22">
Setting NSAllowsArbitraryLoads to true disables App Transport Security for the entire app, exposing all network traffic to insecure HTTP. Please remove this exemption or scope it narrowly so ATS remains enforced.</violation>
</file>

<file name="src/components/MessageInputActions/SummarizeVideo.tsx">

<violation number="1" location="src/components/MessageInputActions/SummarizeVideo.tsx:40">
Icon-only trigger button needs an accessible name. Please add an aria-label or equivalent screen-reader text so assistive technology can announce the action.</violation>
</file>

<file name="src/components/MessageInputActions/AttachSmall.tsx">

<violation number="1" location="src/components/MessageInputActions/AttachSmall.tsx:91">
The broader accept attribute now allows image types (e.g. HEIC, TIFF) that the upload API rejects because IMAGE_EXTENSIONS only includes jpg/jpeg/png/gif/bmp/webp, so users hit a 400 &quot;File type not supported&quot;. Please limit the accept list to the supported extensions (and mirror the change in the other input).</violation>
</file>

<file name="mobile/PerplexicaMobile/AppSettings.swift">

<violation number="1" location="mobile/PerplexicaMobile/AppSettings.swift:31">
UserDefaults should not be used for API secrets because it stores values unencrypted on disk; please move the API key to the Keychain or another secure storage mechanism.</violation>
</file>

<file name="src/lib/hooks/useChat.tsx">

<violation number="1" location="src/lib/hooks/useChat.tsx:551">
Reset messageAppeared to false before starting summarizeYoutubeVideo so the loading indicator displays while the summary request is pending.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 16, 2025

Choose a reason for hiding this comment

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

Setting NSAllowsArbitraryLoads to true disables App Transport Security for the entire app, exposing all network traffic to insecure HTTP. Please remove this exemption or scope it narrowly so ATS remains enforced.

Prompt for AI agents
Address the following comment on mobile/PerplexicaMobile/Info.plist at line 22:

<comment>Setting NSAllowsArbitraryLoads to true disables App Transport Security for the entire app, exposing all network traffic to insecure HTTP. Please remove this exemption or scope it narrowly so ATS remains enforced.</comment>

<file context>
@@ -0,0 +1,42 @@
+	&lt;key&gt;CFBundleVersion&lt;/key&gt;
+	&lt;string&gt;1&lt;/string&gt;
+	&lt;key&gt;LSRequiresIPhoneOS&lt;/key&gt;
+	&lt;true/&gt;
+	&lt;key&gt;UIApplicationSceneManifest&lt;/key&gt;
+	&lt;dict&gt;
</file context>
Suggested change
<true/>
<false/>
Fix with Cubic


return (
<>
<button
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 16, 2025

Choose a reason for hiding this comment

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

Icon-only trigger button needs an accessible name. Please add an aria-label or equivalent screen-reader text so assistive technology can announce the action.

Prompt for AI agents
Address the following comment on src/components/MessageInputActions/SummarizeVideo.tsx at line 40:

<comment>Icon-only trigger button needs an accessible name. Please add an aria-label or equivalent screen-reader text so assistive technology can announce the action.</comment>

<file context>
@@ -0,0 +1,118 @@
+
+  return (
+    &lt;&gt;
+      &lt;button
+        type=&quot;button&quot;
+        onClick={() =&gt; setOpen(true)}
</file context>
Fix with Cubic

onChange={handleChange}
ref={fileInputRef}
accept=".pdf,.docx,.txt"
accept=".pdf,.docx,.txt,.png,.jpg,.jpeg,.gif,.bmp,.webp,image/*"
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 16, 2025

Choose a reason for hiding this comment

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

The broader accept attribute now allows image types (e.g. HEIC, TIFF) that the upload API rejects because IMAGE_EXTENSIONS only includes jpg/jpeg/png/gif/bmp/webp, so users hit a 400 "File type not supported". Please limit the accept list to the supported extensions (and mirror the change in the other input).

Prompt for AI agents
Address the following comment on src/components/MessageInputActions/AttachSmall.tsx at line 91:

<comment>The broader accept attribute now allows image types (e.g. HEIC, TIFF) that the upload API rejects because IMAGE_EXTENSIONS only includes jpg/jpeg/png/gif/bmp/webp, so users hit a 400 &quot;File type not supported&quot;. Please limit the accept list to the supported extensions (and mirror the change in the other input).</comment>

<file context>
@@ -88,7 +88,7 @@ const AttachSmall = () =&gt; {
                     onChange={handleChange}
                     ref={fileInputRef}
-                    accept=&quot;.pdf,.docx,.txt&quot;
+                    accept=&quot;.pdf,.docx,.txt,.png,.jpg,.jpeg,.gif,.bmp,.webp,image/*&quot;
                     multiple
                     hidden
</file context>
Suggested change
accept=".pdf,.docx,.txt,.png,.jpg,.jpeg,.gif,.bmp,.webp,image/*"
accept=".pdf,.docx,.txt,.png,.jpg,.jpeg,.gif,.bmp,.webp"
Fix with Cubic


func save() {
defaults.set(baseURLString, forKey: .baseURLKey)
defaults.set(apiKey, forKey: .apiKey)
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 16, 2025

Choose a reason for hiding this comment

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

UserDefaults should not be used for API secrets because it stores values unencrypted on disk; please move the API key to the Keychain or another secure storage mechanism.

Prompt for AI agents
Address the following comment on mobile/PerplexicaMobile/AppSettings.swift at line 31:

<comment>UserDefaults should not be used for API secrets because it stores values unencrypted on disk; please move the API key to the Keychain or another secure storage mechanism.</comment>

<file context>
@@ -0,0 +1,50 @@
+
+    func save() {
+        defaults.set(baseURLString, forKey: .baseURLKey)
+        defaults.set(apiKey, forKey: .apiKey)
+        defaults.set(selectedFocusMode.rawValue, forKey: .focusMode)
+        defaults.set(selectedOptimizationMode.rawValue, forKey: .optimizationMode)
</file context>
Fix with Cubic

]);

setChatHistory((prev) => [...prev, ['human', userContent]]);
setLoading(true);
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 16, 2025

Choose a reason for hiding this comment

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

Reset messageAppeared to false before starting summarizeYoutubeVideo so the loading indicator displays while the summary request is pending.

Prompt for AI agents
Address the following comment on src/lib/hooks/useChat.tsx at line 551:

<comment>Reset messageAppeared to false before starting summarizeYoutubeVideo so the loading indicator displays while the summary request is pending.</comment>

<file context>
@@ -509,6 +511,146 @@ export const ChatProvider = ({ children }: { children: React.ReactNode }) =&gt; {
+    ]);
+
+    setChatHistory((prev) =&gt; [...prev, [&#39;human&#39;, userContent]]);
+    setLoading(true);
+
+    try {
</file context>
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant