Skip to content

Commit 8a6b4f3

Browse files
committed
chore: added litellm to start scripts
1 parent df380fb commit 8a6b4f3

File tree

13 files changed

+53
-99
lines changed

13 files changed

+53
-99
lines changed

src/client/app/api/integrations/connected/route.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export const GET = withAuth(async function GET(request, { authHeader }) {
1212
// This reuses the same backend endpoint but we will filter on the client
1313
const response = await fetch(`${appServerUrl}/integrations/sources`, {
1414
method: "GET",
15-
headers: { "Content-Type": "application/json", ...authHeader }
15+
headers: { "Content-Type": "application/json", ...authHeader },
16+
cache: "no-store" // Prevent Next.js from caching this server-side fetch
1617
})
1718

1819
const data = await response.json()

src/client/app/api/memories/route.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export const GET = withAuth(async function GET(request, { authHeader }) {
1212
try {
1313
const response = await fetch(backendUrl.toString(), {
1414
method: "GET",
15-
headers: { "Content-Type": "application/json", ...authHeader }
15+
headers: { "Content-Type": "application/json", ...authHeader },
16+
cache: "no-store" // Prevent Next.js from caching this server-side fetch
1617
})
1718

1819
const data = await response.json()
@@ -45,4 +46,4 @@ export const POST = withAuth(async function POST(request, { authHeader }) {
4546
console.error("API Error in /api/memories (POST):", error)
4647
return NextResponse.json({ error: error.message }, { status: 500 })
4748
}
48-
})
49+
})

src/client/app/api/settings/integrations/route.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ export const GET = withAuth(async function GET(request, { authHeader }) {
1010
try {
1111
const response = await fetch(`${appServerUrl}/integrations/sources`, {
1212
method: "GET",
13-
headers: { "Content-Type": "application/json", ...authHeader }
13+
headers: { "Content-Type": "application/json", ...authHeader },
14+
cache: "no-store" // Prevent Next.js from caching this server-side fetch
1415
})
1516

1617
const data = await response.json()

src/client/app/api/user/data/route.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ export const GET = withAuth(async function GET(request, { authHeader }) {
1111
try {
1212
const response = await fetch(`${appServerUrl}/api/get-user-data`, {
1313
method: "POST",
14-
headers: { "Content-Type": "application/json", ...authHeader }
14+
headers: { "Content-Type": "application/json", ...authHeader },
15+
cache: "no-store" // Prevent Next.js from caching this server-side fetch
1516
})
1617

1718
const data = await response.json()

src/client/app/integrations/page.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,7 @@ const IntegrationsPage = () => {
931931
})
932932
toast.success(`Successfully connected to ${capitalized}!`)
933933
setSparkleTrigger((c) => c + 1)
934+
fetchIntegrations()
934935
window.history.replaceState({}, document.title, "/integrations")
935936
} else if (error && !composioStatus) {
936937
// Avoid showing generic error on composio callback

src/client/app/tasks/page.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,7 @@ Description: ${event.description || "No description."}`
530530
fetch(
531531
`/api/tasks/delete`,
532532
{
533+
// prettier-ignore
533534
method: "POST",
534535
body: JSON.stringify(
535536
{
@@ -570,22 +571,19 @@ Description: ${event.description || "No description."}`
570571
handleAction(
571572
() =>
572573
fetch(
573-
`/api/tasks/answer-clarifications`,
574+
"/api/tasks/rerun",
574575
{
575576
method: "POST",
576-
body: JSON.stringify(
577-
{
578-
taskId,
579-
answers
580-
}
581-
),
582577
headers: {
583578
"Content-Type":
584579
"application/json"
585-
}
580+
},
581+
body: JSON.stringify(
582+
{ taskId }
583+
)
586584
}
587585
),
588-
"Answers submitted."
586+
"Task re-run initiated."
589587
)
590588
}
591589
onArchiveTask={(taskId) =>

src/client/components/Sidebar.js

Lines changed: 3 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ const UserProfileSection = ({ isCollapsed, user }) => {
3434
const { isPro, plan } = usePlan()
3535
useClickOutside(userMenuRef, () => setUserMenuOpen(false))
3636

37-
// FIX: Removed the redundant and conflicting declaration of 'isPro'.
38-
// The 'isPro' constant from the usePlan() hook is the correct one to use.
3937
const planName = isPro ? "Pro" : "Basic"
4038

4139
const dashboardUrl = process.env.NEXT_PUBLIC_LANDING_PAGE_URL
@@ -74,8 +72,8 @@ const UserProfileSection = ({ isCollapsed, user }) => {
7472
exit={{ opacity: 0, width: 0 }}
7573
className="overflow-hidden whitespace-nowrap"
7674
>
77-
<p className="font-semibold text-sm text-white">
78-
{user?.name || "User"}
75+
<p className="font-semibold text-sm text-white truncate">
76+
{user?.given_name || user?.name || "User"}
7977
</p>
8078
<span
8179
className={cn(
@@ -233,12 +231,9 @@ const SidebarContent = ({
233231
user
234232
}) => {
235233
const pathname = usePathname()
236-
const [userDetails, setUserDetails] = useState(null)
237234
const [isHelpMenuOpen, setHelpMenuOpen] = useState(false)
238235
const [isVideoModalOpen, setVideoModalOpen] = useState(false)
239-
const [isUserMenuOpen, setUserMenuOpen] = useState(false)
240236
const router = useRouter()
241-
const userMenuRef = useRef(null)
242237

243238
// CHANGED: Use the environment variable for the namespace
244239
const { isPro } = usePlan()
@@ -504,73 +499,7 @@ const SidebarContent = ({
504499
</span>
505500
)}
506501
</a>
507-
<div
508-
className={cn(
509-
"flex items-center justify-between bg-neutral-800/40 border border-neutral-700/80 rounded-lg p-1.5",
510-
isCollapsed && "flex-col gap-2"
511-
)}
512-
>
513-
<Link
514-
href="/settings"
515-
className={cn(
516-
"flex items-center gap-2 p-1 rounded-md hover:bg-neutral-800/80 flex-grow",
517-
isCollapsed ? "w-full justify-center" : ""
518-
)}
519-
>
520-
{userDetails?.picture ? (
521-
<img
522-
src={userDetails.picture}
523-
alt="User"
524-
className="w-7 h-7 rounded-full flex-shrink-0"
525-
/>
526-
) : (
527-
<div className="w-7 h-7 rounded-full bg-neutral-700 flex items-center justify-center flex-shrink-0">
528-
<IconUser size={16} />
529-
</div>
530-
)}
531-
{!isCollapsed && (
532-
<span className="font-semibold text-sm text-white whitespace-nowrap">
533-
{userDetails?.given_name || "User"}
534-
</span>
535-
)}
536-
</Link>
537-
{!isCollapsed && (
538-
<div className="relative" ref={userMenuRef}>
539-
<button
540-
onClick={() => setUserMenuOpen(!isUserMenuOpen)}
541-
className="p-2 rounded-md hover:bg-neutral-700 text-neutral-400 hover:text-white"
542-
>
543-
<IconDots size={16} />
544-
</button>
545-
<AnimatePresence>
546-
{isUserMenuOpen && (
547-
<motion.div
548-
initial={{
549-
opacity: 0,
550-
y: 10,
551-
scale: 0.95
552-
}}
553-
animate={{ opacity: 1, y: 0, scale: 1 }}
554-
exit={{
555-
opacity: 0,
556-
y: 10,
557-
scale: 0.95
558-
}}
559-
className="absolute bottom-full right-0 mb-2 w-40 bg-neutral-900/80 backdrop-blur-md border border-neutral-700 rounded-lg shadow-lg p-1 z-50"
560-
>
561-
<Link
562-
href="/auth/logout"
563-
className="w-full flex items-center gap-2 text-left px-3 py-2 text-sm rounded-md text-red-400 hover:bg-red-500/20 hover:text-red-300 transition-colors"
564-
>
565-
<IconLogout size={16} />
566-
<span>Logout</span>
567-
</Link>
568-
</motion.div>
569-
)}
570-
</AnimatePresence>
571-
</div>
572-
)}
573-
</div>
502+
<UserProfileSection isCollapsed={isCollapsed} user={user} />
574503
</div>
575504
</div>
576505
)

src/client/components/tasks/TaskDetailsPanel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ const TaskDetailsPanel = ({
275275
onClick={() =>
276276
onDelete(task.task_id)
277277
}
278-
icon={<IconTrash size={16} />}
278+
icon={<IconTrash size={16} />} // prettier-ignore
279279
className="text-neutral-400 hover:bg-red-500/20 hover:text-red-400"
280280
>
281281
Delete

src/server/main/chat/routes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ async def event_stream_generator():
7474
try:
7575
async for event in generate_chat_llm_stream(
7676
user_id,
77+
clean_history_for_llm,
7778
user_context,
7879
db_manager=mongo_manager
7980
):

src/server/workers/tasks.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from main.tasks.prompts import TASK_CREATION_PROMPT
2020
from mcp_hub.memory.utils import initialize_embedding_model, initialize_agents, cud_memory
2121
from mcp_hub.tasks.prompts import RESOURCE_MANAGER_SYSTEM_PROMPT
22-
from main.llm import run_agent as run_main_agent
22+
from main.llm import run_agent as run_main_agent, LLMProviderDownError
2323
from main.db import MongoManager
2424
from workers.celery_app import celery_app
2525
from workers.planner.llm import get_planner_agent # noqa: E501
@@ -206,10 +206,9 @@ async def async_orchestrate_swarm_task(task_id: str, user_id: str):
206206
if not goal:
207207
raise ValueError("Swarm task is missing a goal to extract items from.")
208208

209-
messages = [{'role': 'user', 'content': goal}]
210-
211209
extractor_response_str = ""
212-
for chunk in run_main_agent_with_fallback(system_message=ITEM_EXTRACTOR_SYSTEM_PROMPT, function_list=[], messages=messages):
210+
messages = [{'role': 'user', 'content': goal}]
211+
for chunk in run_main_agent(system_message=ITEM_EXTRACTOR_SYSTEM_PROMPT, function_list=[], messages=messages):
213212
if isinstance(chunk, list) and chunk:
214213
last_message = chunk[-1]
215214
if last_message.get("role") == "assistant" and isinstance(last_message.get("content"), str):
@@ -544,7 +543,7 @@ async def run_context_research(user_id: str, task_description: str, original_con
544543
messages = [{'role': 'user', 'content': user_prompt}]
545544

546545
final_response_str = ""
547-
for chunk in run_main_agent_with_fallback(system_message=system_prompt, function_list=tools_config, messages=messages):
546+
for chunk in run_main_agent(system_message=system_prompt, function_list=tools_config, messages=messages):
548547
if isinstance(chunk, list) and chunk and chunk[-1].get("role") == "assistant":
549548
final_response_str = chunk[-1].get("content", "")
550549

0 commit comments

Comments
 (0)