Skip to content

Commit 02f3d75

Browse files
committed
fix: Fixed an issue where Firecrawl search restrictions required the use of an API key.
fix: Fixed OpenAI Responses multi-turn history serializes assistant content as input_text (issues 169)
1 parent f8ef396 commit 02f3d75

6 files changed

Lines changed: 38 additions & 16 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "neo-chat",
33
"description": "An omni AI chat application with a clean UI and excellent performance.",
44
"private": true,
5-
"version": "2.2.0",
5+
"version": "2.2.1",
66
"license": "MIT",
77
"packageManager": "pnpm@10.30.3",
88
"type": "module",

src/__tests__/history.test.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,32 @@ describe("history converters", () => {
3535
"Use sqlite for local storage.",
3636
);
3737
});
38+
39+
it("uses Responses input text for users and output text for assistants", () => {
40+
const input = prepareOpenAIResponsesInput([
41+
{
42+
id: "user_1",
43+
role: "user",
44+
content: "hello test",
45+
timestamp: 1,
46+
},
47+
{
48+
id: "assistant_1",
49+
role: "model",
50+
content: "Hello! Test received.",
51+
timestamp: 2,
52+
},
53+
]);
54+
55+
expect(input).toEqual([
56+
{
57+
role: "user",
58+
content: [{ type: "input_text", text: "hello test" }],
59+
},
60+
{
61+
role: "assistant",
62+
content: [{ type: "output_text", text: "Hello! Test received." }],
63+
},
64+
]);
65+
});
3866
});

src/__tests__/searchCompatibility.test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,22 +68,23 @@ describe("search compatibility", () => {
6868
});
6969
});
7070

71-
it("requires a key for hosted Firecrawl but allows configured self-hosted Firecrawl", () => {
71+
it("allows Firecrawl search without a key while accepting an optional key", () => {
7272
expect(
7373
getSearchCompatibility({
7474
searchProvider: "firecrawl",
7575
searchConfig: { apiKey: "" },
7676
modelProviderType: "OpenAI",
7777
}),
78-
).toMatchObject({
79-
enabled: false,
80-
reason: "missing_search_api_key",
78+
).toEqual({
79+
enabled: true,
80+
mode: "external",
81+
provider: "firecrawl",
8182
});
8283

8384
expect(
8485
getSearchCompatibility({
8586
searchProvider: "firecrawl",
86-
searchConfig: { apiKey: "", baseUrl: "https://firecrawl.example" },
87+
searchConfig: { apiKey: "firecrawl-key" },
8788
modelProviderType: "OpenAI",
8889
}),
8990
).toEqual({

src/components/settings/AboutSettings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ExternalLink, GitBranch, Globe2, Package, Scale } from "lucide-react";
44
import { useTranslations } from "next-intl";
55
import { Logo } from "../ui/Icons";
66
import { PRODUCT_COPYRIGHT, PRODUCT_NAME } from "@/lib/product";
7-
import { version } from '../../../package.json'
7+
import { version } from "../../../package.json";
88

99
const PROJECT_NAME = PRODUCT_NAME;
1010
const PROJECT_VERSION = version;

src/lib/settings/searchRag.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,7 @@ export const getSearchCompatibility = ({
174174
}
175175

176176
if (searchProvider === "firecrawl") {
177-
return searchConfig?.baseUrl?.trim() || hasSearchApiKey(searchConfig)
178-
? { enabled: true, mode: "external", provider: searchProvider }
179-
: {
180-
enabled: false,
181-
mode: "unavailable",
182-
provider: searchProvider,
183-
reason: "missing_search_api_key",
184-
};
177+
return { enabled: true, mode: "external", provider: searchProvider };
185178
}
186179

187180
return hasSearchApiKey(searchConfig)

src/lib/utils/history.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export function prepareOpenAIResponsesInput(messages: Message[]) {
171171
if (msg.content) {
172172
result.push({
173173
role: "assistant",
174-
content: [{ type: "input_text", text: msg.content }],
174+
content: [{ type: "output_text", text: msg.content }],
175175
});
176176
}
177177

0 commit comments

Comments
 (0)