xonecas.io
53129
Pa

PAT / commit 8879121

fix: minor change to websearch tool while debugging an issue with google api

xonecas2025-12-17 8879121d7502590930b2e2b29ebc2c14dc203457 parent 2210637

5 files changed

AGENTS.md+4−0
@@ -200,3 +200,7 @@ Add tests when prompted only.
200200 - **DO** use existing utility functions from `src/lib/`
201201 - **DO** follow the App Router conventions for Next.js 16
202202 - **DO** ALWAYS keep this file up to date as changes are made in the code
203+
204+# Known issues:
205+
206+The google based websearch can randomly fail with Request Entity not found. Generating a new custom search engine ID fixes the issue. Google has ignored all efforts to report this issue to them.
TODO.md+1−1
@@ -2,7 +2,7 @@
22
33 ## BUGS:
44
5-- FIND MORE
5+- Text is being rendered behind the input message box when there is no scroll available. Making it unreadable.
66
77 ## New features:
88
app/globals.css+29−0
@@ -55,3 +55,32 @@
5555 font-size: 0.9em;
5656 }
5757 }
58+
59+@layer utilities {
60+ @keyframes spin-and-color-cycle {
61+ 0% {
62+ transform: rotate(0deg);
63+ color: rgb(239 68 68); /* red-500 */
64+ }
65+ 25% {
66+ transform: rotate(90deg);
67+ color: rgb(249 115 22); /* orange-500 */
68+ }
69+ 50% {
70+ transform: rotate(180deg);
71+ color: rgb(245 158 11); /* amber-500 */
72+ }
73+ 75% {
74+ transform: rotate(270deg);
75+ color: rgb(234 179 8); /* yellow-500 */
76+ }
77+ 100% {
78+ transform: rotate(360deg);
79+ color: rgb(239 68 68); /* red-500 */
80+ }
81+ }
82+
83+ .animate-spin-and-color-cycle {
84+ animation: spin-and-color-cycle 4s linear infinite;
85+ }
86+}
src/components/MessageInput.tsx+3−1
@@ -120,7 +120,9 @@ const MessageInput = forwardRef<MessageInputRef, MessageInputProps>(
120120 />
121121 <div className="absolute bottom-2 right-2">
122122 <BasicButton color="neutral" type="submit" disabled={isLoading}>
123- <PaperPlaneIcon className={`h-8 w-10 p-1.5 ${isLoading ? "animate-spin" : ""}`} />
123+ <PaperPlaneIcon
124+ className={`h-8 w-10 p-1.5 ${isLoading ? "animate-spin-and-color-cycle" : ""}`}
125+ />
124126 </BasicButton>
125127 </div>
126128 </form>
src/lib/ollama/websearch.ts+1−2
@@ -58,10 +58,9 @@ export async function queryWebSearch(query: string): Promise<string> {
5858
5959 const customsearch = google.customsearch("v1");
6060 const res = await customsearch.cse.list({
61- auth: apiKey,
6261 cx: cx,
6362 q: query,
64- num: 10, // Maximum number of results (1-10)
63+ auth: apiKey,
6564 });
6665
6766 if (!res.data.items || res.data.items.length === 0) {