You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "Jacky040124 (via GitHub)" <gi...@apache.org> on 2026/10/19 23:03:48 UTC

[PR] fix(desktop): reject whitespace-only Tavily API keys [maka]

Jacky040124 opened a new pull request, #6180:
URL: https://github.com/apache/maka/pull/6180

   ## Summary
   
   A Tavily API key made only of whitespace could be saved. The settings page then showed a configured key, but `queryTavily` trims the key and failed with "Configure a Tavily API key before using web search."
   
   - Main process (`runtime-host-settings-ipc-main.ts`): trim the Tavily key before storing it, and delete the credential when the trimmed key is empty. The JEV key a few lines above already works this way. Config import goes through the same function, so it is covered too.
   - Renderer (`web-search-settings-page.tsx`): `saveDraftKey`, the Save button and the Test button check `draftKey.trim()`, so whitespace alone cannot be submitted or tested.
   
   Not changed: a whitespace key already stored in the vault before this fix still shows as configured until the user clears it. Handling that would need a migration, so I left it out of this small fix.
   
   Fixes #6179
   
   ## Verification
   
   - Extended the Tavily IPC round-trip test in `runtime-host-settings-ipc-main.test.ts`: a key with surrounding whitespace is stored trimmed, and a whitespace-only key deletes the credential. With only the main-process change reverted, this test fails (14/15); with it, 15/15 pass.
   - `npm run build`, then the web-search and settings suites in `dist/main` (`runtime-host-settings-ipc-main`, `web-search-credentials`, `runtime-host-config-ipc-main`, `runtime-host-reconnecting-ipc-main`, `settings-ipc-helpers`): 58/58 pass.
   - `npm run lint`, `npm run format:check`, `npm run typecheck`, `npx knip --workspace apps/desktop` pass.
   - Not run: there are no renderer tests for this page, and I did not take a screenshot. The renderer change only makes the buttons disabled for a whitespace-only draft; it is covered by typecheck and lint.
   
   ## AI use
   
   - [ ] No generative tool made a substantive contribution
   - [x] Generative tooling made a substantive contribution
   
   Tool(s) and scope: I found the bug while reading the code. Claude Code drafted the fix and test and ran the checks listed above. The commit carries a `Generated-by` trailer.
   
   ## Checklist
   
   - [x] Tests cover the change and fail without it
   - [x] Lint, format, typecheck and the affected suites pass locally
   
   Does this PR entail a change in behavior?
   
   - [x] Yes — described under Summary above
   - [ ] No
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(desktop): reject whitespace-only Tavily API keys [maka]

Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han commented on PR #6180:
URL: https://github.com/apache/maka/pull/6180#issuecomment-6312461697

   Thanks for fixing whitespace-only Tavily credentials and for the regression coverage. The reviewed head `4c0542f6cff2291b7a8a49ef4b7e942a4e09f421` is unchanged, its test checks pass, and it merges cleanly with current main. I am proceeding with the merge at Astro-Han's explicit request.
   
   > **Automated review notice:** This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(desktop): reject whitespace-only Tavily API keys [maka]

Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han merged PR #6180:
URL: https://github.com/apache/maka/pull/6180


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org