fix: only send auth header when API key is set, show agent panel by default with localStorage persistence
This commit is contained in:
@@ -80,8 +80,9 @@ Only propose actions you can actually execute. Be specific and actionable."""
|
|||||||
temperature = self.config.get("temperature", 0.7)
|
temperature = self.config.get("temperature", 0.7)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
headers = {}
|
headers = {"Content-Type": "application/json"}
|
||||||
if self.litellm_api_key:
|
# Only add auth header if API key is set and not empty
|
||||||
|
if self.litellm_api_key and self.litellm_api_key.strip():
|
||||||
headers["Authorization"] = f"Bearer {self.litellm_api_key}"
|
headers["Authorization"] = f"Bearer {self.litellm_api_key}"
|
||||||
|
|
||||||
async with httpx.AsyncClient(timeout=60.0) as client:
|
async with httpx.AsyncClient(timeout=60.0) as client:
|
||||||
|
|||||||
@@ -11,9 +11,20 @@
|
|||||||
let loading = $state(true);
|
let loading = $state(true);
|
||||||
let showTaskModal = $state(false);
|
let showTaskModal = $state(false);
|
||||||
let editingTask = $state(null);
|
let editingTask = $state(null);
|
||||||
let showAgentPanel = $state(false);
|
let showAgentPanel = $state(
|
||||||
|
typeof localStorage !== 'undefined'
|
||||||
|
? localStorage.getItem('opc_showAgentPanel') !== 'false'
|
||||||
|
: true
|
||||||
|
);
|
||||||
let unsubscribe = null;
|
let unsubscribe = null;
|
||||||
|
|
||||||
|
// Persist agent panel visibility
|
||||||
|
$effect(() => {
|
||||||
|
if (typeof localStorage !== 'undefined') {
|
||||||
|
localStorage.setItem('opc_showAgentPanel', showAgentPanel);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
async function loadData() {
|
async function loadData() {
|
||||||
loading = true;
|
loading = true;
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user