Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Allow sharing URL with selected log
Vasek Mlejnskyf1782ce0edeb
diff --git a/components/AgentContext.tsx b/components/AgentContext.tsxindex abf194190..12f37529a 100644--- a/components/AgentContext.tsx+++ b/components/AgentContext.tsx@@ -1,6 +1,8 @@import {useState,+ useEffect,} from 'react'+import { useRouter } from 'next/router'import clsx from 'clsx'import {SystemContext,@@ -15,13 +17,24 @@ export interface Props {function AgentContext({context,- onSelected: onOpened,+ onSelected,}: Props) {+ const router = useRouter()const [opened, setOpened] = useState<number>()+ useEffect(function selectLogBasedOnURLQuery() {+ const selectedLog = router.query.selectedLog as string+ if (selectedLog) {+ const idx = parseInt(selectedLog)+ setOpened(idx)+ onSelected(context[idx])+ }+ }, [router, context, onSelected])+function open(idx: number) {setOpened(idx)- onOpened(context[idx])+ onSelected(context[idx])+ router.push(`/log/${router.query.logFileID}?selectedLog=${idx}`, undefined, { shallow: true })}function close(idx: number) {diff --git a/components/AgentFunctions.tsx b/components/AgentFunctions.tsxindex 171284c28..8da9d91bd 100644--- a/components/AgentFunctions.tsx+++ b/components/AgentFunctions.tsx@@ -47,8 +47,6 @@ function AgentFunctions({})}- console.log('functions', functions)-return (<div className="flex-1 flex flex-col space-y-2 max-w-full w-full overflow-hidden"><h2 className="mb-2 font-medium text-sm text-gray-500">Functions</h2>diff --git a/components/DashboardHome.tsx b/components/DashboardHome.tsxindex fb28cf225..6b0f20946 100644--- a/components/DashboardHome.tsx+++ b/components/DashboardHome.tsx@@ -25,8 +25,6 @@ function DashboardHome({const selectedAgentInstanceID = router.query.projectID as string | undefinedconst selectedLogFileID = router.query.fileID as string | undefined- console.log({ router })-async function signOut() {await supabaseClient.auth.signOut()posthog?.reset(true)diff --git a/pages/log/[logFileID].tsx b/pages/log/[logFileID].tsxindex ad3fe4685..5eb955756 100644--- a/pages/log/[logFileID].tsx+++ b/pages/log/[logFileID].tsx@@ -125,7 +125,7 @@ export interface Props {function LogFile({ logFile }: Props) {const [isResizing, setIsResizing] = useState(false)- const [sizes, setSizes] = useState([50, 50])+ const [sizes, setSizes] = useState([30, 70])const [selectedContext, setSelectedContext] = useState<SystemContext | UserContext | AssistantContext>()return (