Skip to content

Conversation

@hassoncs
Copy link
Contributor

@hassoncs hassoncs commented May 13, 2025

The issue was that when users added or modified custom headers, the changes were only stored in the local component state but never propagated to the main configuration object that gets saved.

The fix adds a useEffect hook that updates the main configuration whenever the custom headers change, ensuring they're properly saved when the user clicks the "Save" button.

Now users can successfully add custom headers to their OpenAI Compatible provider configurations.

Test plan:

  • Added a header confirmed it saved
  • Added header, discarded changes, confirmed header is gone

Closes: Kilo-Org/kilocode#383

Type of Change

  • 🐛 Bug Fix: Non-breaking change that fixes an issue.
  • New Feature: Non-breaking change that adds functionality.
  • 💥 Breaking Change: Fix or feature that would cause existing functionality to not work as expected.
  • ♻️ Refactor: Code change that neither fixes a bug nor adds a feature.
  • 💅 Style: Changes that do not affect the meaning of the code (white-space, formatting, etc.).
  • 📚 Documentation: Updates to documentation files.
  • ⚙️ Build/CI: Changes to the build process or CI configuration.
  • 🧹 Chore: Other changes that don't modify src or test files.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Code Quality:
    • My code adheres to the project's style guidelines.
    • There are no new linting errors or warnings (npm run lint).
    • All debug code (e.g., console.log) has been removed.
  • Testing:
    • New and/or updated tests have been added to cover my changes.
    • All tests pass locally (npm test).
    • The application builds successfully with my changes.
  • Branch Hygiene: My branch is up-to-date (rebased) with the main branch.
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Changeset: A changeset has been created using npm run changeset if this PR includes user-facing changes or dependency updates.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

image

Documentation Updates


Important

Fixes bug in OpenAICompatible.tsx to ensure custom headers are saved by updating the main configuration with a useEffect hook.

  • Behavior:
    • Fixes bug in OpenAICompatible.tsx where custom headers were not saved to the main configuration.
    • Adds useEffect hook to update openAiHeaders in the main configuration when customHeaders change.
  • Testing:
    • Confirmed headers are saved after adding.
    • Confirmed headers are discarded when changes are not saved.

This description was created by Ellipsis for 75995e11e316be2451551215feba301b6d629a47. You can customize this summary. It will automatically update as commits are pushed.

@changeset-bot
Copy link

changeset-bot bot commented May 13, 2025

🦋 Changeset detected

Latest commit: 708bcbc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
roo-cline Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels May 13, 2025
@hassoncs hassoncs force-pushed the fix-custom-headers-not-saved-383 branch from 75995e1 to ec8c5c8 Compare May 13, 2025 16:16
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels May 13, 2025
The issue was that when users added or modified custom headers, the changes were only stored in the local component state but never propagated to the main configuration object that gets saved.

The fix adds a `useEffect` hook that updates the main configuration whenever the custom headers change, ensuring they're properly saved when the user clicks the "Save" button.

Now users can successfully add custom headers to their OpenAI Compatible provider configurations.

Test plan:
- Added a header confirmed it saved
- Added header, discarded changes, confirmed header is gone
@mrubens
Copy link
Collaborator

mrubens commented May 13, 2025

Hi, thanks for taking a look! I also attempted to fix in #3415 - do you all have that in your branch yet?

@hassoncs hassoncs force-pushed the fix-custom-headers-not-saved-383 branch from ec8c5c8 to 708bcbc Compare May 13, 2025 16:18
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels May 13, 2025
@hassoncs
Copy link
Contributor Author

hassoncs commented May 13, 2025

@mrubens, ah, no it doesn't look like we have that one yet! Thank you for pointing it out 🙏 I should have checked first! Will do next time :)

@hassoncs hassoncs closed this May 13, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom Headers are not saved for OpenAI Compatible providers

2 participants