-
Notifications
You must be signed in to change notification settings - Fork 864
Expose web search sidecar enabled status #2033
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
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -221,6 +221,18 @@ describe("sidecar-settings remaining vision controls", () => { | |||||||||||||||||||||||||||||||
| expect(config.visionSidecar).toEqual({ ...FULL_VISION, enabled: false }); | ||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| test("GET and PUT expose the effective web-search enabled state", async () => { | ||||||||||||||||||||||||||||||||
| const unset = await getSidecarSettings(emptyConfig()); | ||||||||||||||||||||||||||||||||
| expect((await unset.json() as { webSearch: { enabled: boolean } }).webSearch.enabled).toBe(true); | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| const config = emptyConfig({ webSearchSidecar: { enabled: false } }); | ||||||||||||||||||||||||||||||||
| const disabled = await getSidecarSettings(config); | ||||||||||||||||||||||||||||||||
| expect((await disabled.json() as { webSearch: { enabled: boolean } }).webSearch.enabled).toBe(false); | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| const response = await putSidecarSettings(config, { webSearch: { streamRoutedModelOutput: true } }); | ||||||||||||||||||||||||||||||||
| expect((await response.json() as { webSearch: { enabled: boolean } }).webSearch.enabled).toBe(false); | ||||||||||||||||||||||||||||||||
|
Comment on lines
+232
to
+233
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win Make the partial PUT test prove that an update occurred.
Proposed test improvement const response = await putSidecarSettings(config, { webSearch: { streamRoutedModelOutput: true } });
- expect((await response.json() as { webSearch: { enabled: boolean } }).webSearch.enabled).toBe(false);
+ const putBody = await response.json() as {
+ webSearch: { enabled: boolean; streamRoutedModelOutput: boolean };
+ };
+ expect(putBody.webSearch.enabled).toBe(false);
+ expect(putBody.webSearch.streamRoutedModelOutput).toBe(true);
+
+ const afterPut = await getSidecarSettings(config);
+ const getBody = await afterPut.json() as {
+ webSearch: { enabled: boolean; streamRoutedModelOutput: boolean };
+ };
+ expect(getBody.webSearch.enabled).toBe(false);
+ expect(getBody.webSearch.streamRoutedModelOutput).toBe(true);📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| test("timeoutMs validation reuses the runtime bounds rather than a second contract", async () => { | ||||||||||||||||||||||||||||||||
| expect(resolveVisionTimeoutMs(undefined)).toBe(DEFAULT_VISION_TIMEOUT_MS); | ||||||||||||||||||||||||||||||||
| expect(resolveVisionTimeoutMs(MIN_VISION_TIMEOUT_MS)).toBe(MIN_VISION_TIMEOUT_MS); | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: lidge-jun/opencodex
Length of output: 50376
🏁 Script executed:
Repository: lidge-jun/opencodex
Length of output: 50376
🏁 Script executed:
Repository: lidge-jun/opencodex
Length of output: 50376
🏁 Script executed:
Repository: lidge-jun/opencodex
Length of output: 50375
🏁 Script executed:
Repository: lidge-jun/opencodex
Length of output: 50375
🏁 Script executed:
Repository: lidge-jun/opencodex
Length of output: 16849
Document
webSearch.enabledas a configuration togglews.enabled !== falseis correct for the settings response. Runtime availability is checked separately byplanWebSearch, which fails closed when no usable sidecar exists. Updatesrc/types.ts:1222and the test name attests/sidecar-settings-vision-controls.test.ts:224to state thatenableddoes not indicate runtime availability.🤖 Prompt for AI Agents
Source: Path instructions