Skip to content

Commit 57c31b9

Browse files
author
Eunsoo Lee
committed
Merge branch 'feature/ui-ux-refresh' into ui-ux-refresh_eunsoo
2 parents af97365 + 16f776a commit 57c31b9

File tree

14 files changed

+424
-485
lines changed

14 files changed

+424
-485
lines changed

src/backend/app_kernel.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,9 +620,10 @@ async def get_plans(
620620

621621
# Use get_steps_by_plan to match the original implementation
622622
steps = await memory_store.get_steps_by_plan(plan_id=plan.id)
623-
messages = await memory_store.get_data_by_type_and_plan_id(
624-
"agent_message", plan_id=plan.id
623+
messages = await memory_store.get_data_by_type_and_session_id(
624+
"agent_message", session_id=plan.session_id
625625
)
626+
626627
plan_with_steps = PlanWithSteps(**plan.model_dump(), steps=steps)
627628
plan_with_steps.update_step_counts()
628629
return [plan_with_steps, messages]

src/backend/context/cosmos_memory_kernel.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,8 @@ async def get_data_by_type(self, data_type: str) -> List[BaseDataModel]:
443443
logging.exception(f"Failed to query data by type from Cosmos DB: {e}")
444444
return []
445445

446-
async def get_data_by_type_and_plan_id(
447-
self, data_type: str, plan_id: str
446+
async def get_data_by_type_and_session_id(
447+
self, data_type: str, session_id: str
448448
) -> List[BaseDataModel]:
449449
"""Query the Cosmos DB for documents with the matching data_type, session_id and user_id."""
450450
await self.ensure_initialized()
@@ -453,11 +453,11 @@ async def get_data_by_type_and_plan_id(
453453

454454
model_class = self.MODEL_CLASS_MAPPING.get(data_type, BaseDataModel)
455455
try:
456-
query = "SELECT * FROM c WHERE c.user_id=@user_id AND c.data_type=@data_type AND c.plan_id=@plan_id ORDER BY c._ts ASC"
456+
query = "SELECT * FROM c WHERE c.session_id=@session_id AND c.user_id=@user_id AND c.data_type=@data_type ORDER BY c._ts ASC"
457457
parameters = [
458+
{"name": "@session_id", "value": session_id},
458459
{"name": "@data_type", "value": data_type},
459460
{"name": "@user_id", "value": self.user_id},
460-
{"name": "@plan_id", "value": plan_id},
461461
]
462462
return await self.query_items(query, parameters, model_class)
463463
except Exception as e:

src/frontend_react/src/api/apiClient.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@ const fetchWithAuth = async (url: string, method: string = "GET", body: BodyInit
4444

4545
try {
4646
const apiUrl = getApiUrl();
47-
48-
const response = await fetch(`${apiUrl}${url}`, options);
47+
const finalUrl = `${apiUrl}${url}`;
48+
console.log('Final URL:', finalUrl);
49+
console.log('Request Options:', options);
50+
// Log the request details
51+
const response = await fetch(finalUrl, options);
4952
console.log('response', response);
5053

5154
if (!response.ok) {
@@ -54,7 +57,10 @@ const fetchWithAuth = async (url: string, method: string = "GET", body: BodyInit
5457
}
5558

5659
const isJson = response.headers.get('content-type')?.includes('application/json');
57-
return isJson ? await response.json() : null;
60+
const responseData = isJson ? await response.json() : null;
61+
62+
console.log('Response JSON:', responseData);
63+
return responseData;
5864
} catch (error) {
5965
console.error('API Error:', (error as Error).message);
6066
throw error;
@@ -81,7 +87,7 @@ const fetchWithoutAuth = async (url: string, method: string = "POST", body: Body
8187
const errorText = await response.text();
8288
throw new Error(errorText || 'Login failed');
8389
}
84-
90+
console.log('response', response);
8591
const isJson = response.headers.get('content-type')?.includes('application/json');
8692
return isJson ? await response.json() : null;
8793
} catch (error) {

src/frontend_react/src/api/apiService.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ export class APIService {
318318
* @param updatedAction Optional updated action
319319
* @returns Promise with response object
320320
*/
321-
async approveSteps(
321+
async stepStatus(
322322
planId: string,
323323
sessionId: string,
324324
approved: boolean,

src/frontend_react/src/components/content/HomeInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const HomeInput: React.FC<HomeInputProps> = ({
4646
const handleSubmit = async () => {
4747
if (input.trim()) {
4848
setSubmitting(true);
49-
showToast("Creating a plan..", "progress", { dismissible: false });
49+
showToast("Creating a plan..", "progress");
5050
try {
5151
const response = await TaskService.submitInputTask(input.trim());
5252

0 commit comments

Comments
 (0)