Skip to content

[CLEANUP] Remove Memory sections from UI following v1alpha2 API migration #752

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

tanuj-rai
Copy link

@tanuj-rai tanuj-rai commented Aug 14, 2025

This PR removes all memory-related functionality from the UI as part of the v1alpha2 API migration.

1. Memory Pages/Routes:
-Removed memory listing page (/memories)
-Removed memory creation page (/memories/new)

2. Agent Creation / Edit Forms:
-Removed memory selection section from ui/src/app/agents/new/page.tsx
-Removed memory references from ui/src/components/AgentDetailsSidebar.tsx
-Cleaned up imports

3. Agent Display Components:
-Cleaned up AgentDetailsSidebar

4. Navigation & Routing:
-Removed memory navigation items

5. Types & Interfaces:
-Removed MemoryResponse, CreateMemoryRequest, and UpdateMemoryRequest types
-Deleted API client methods for memory

Fixes: issue #738

Who can review:
@ashleywang1 @peterj

@tanuj-rai tanuj-rai requested a review from peterj as a code owner August 14, 2025 12:55
Copy link
Contributor

@ashleywang1 ashleywang1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! To fix the DCO issue, see the instructions here. Also, since this is from a fork, go to your repo's Settings and add an env variable called OPENAI_API_KEY with an openai key so that the e2e tests will pass.

@tanuj-rai tanuj-rai force-pushed the feat/remove-memory-ui branch from 9647425 to e1c0f32 Compare August 14, 2025 14:57
@tanuj-rai tanuj-rai requested a review from ashleywang1 August 14, 2025 14:58
Copy link
Contributor

@ashleywang1 ashleywang1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be a broken reference to setSelectedMemories that still exists in the code

@tanuj-rai
Copy link
Author

There seems to be a broken reference to setSelectedMemories that still exists in the code

Thank you so much @ashleywang1, for the feedback. I will fix it as soon as possible.

@tanuj-rai tanuj-rai requested a review from ashleywang1 August 14, 2025 17:59
Copy link
Contributor

@ashleywang1 ashleywang1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you able to run make build-ui locally? That should help you iterate through the failing tests here.

@tanuj-rai
Copy link
Author

Are you able to run make build-ui locally? That should help you iterate through the failing tests here.

Thanks @ashleywang1 for the suggestion to run make build-ui! Unfortunately, I’m unable to install Docker on my system due to compatibility issues. Since I can’t run Docker-dependent tests locally, I will use GitHub Actions for debugging the failed tests.

@peterj
Copy link
Collaborator

peterj commented Aug 15, 2025

If you can't install docker, you can run bun run build --no-lint from the ui folder to make sure UI builds correctly (and run npm run test).

@tanuj-rai
Copy link
Author

If you can't install docker, you can run bun run build --no-lint from the ui folder to make sure UI builds correctly (and run npm run test).

Thank you @peterj for the guidance!, I've ran these commands.

On running this bun run build --no-lint, I got

   - Experiments (use with caution):
     · swcPlugins

   Creating an optimized production build ...
 ✓ Compiled successfully in 46s
   Checking validity of types ...
   Collecting page data ...
   Generating static pages (0/13) ...
   Generating static pages (3/13) 
   Generating static pages (6/13) 
   Generating static pages (9/13) 
 ✓ Generating static pages (13/13)
   Finalizing page optimization ...
   Collecting build traces ...

Route (app)                                      Size  First Load JS
┌ ○ /                                           143 B         131 kB
├ ○ /_not-found                                 977 B         102 kB
├ ƒ /a2a/[namespace]/[agentName]                138 B         101 kB
├ ○ /agents                                     143 B         131 kB
├ ƒ /agents/[namespace]/[name]/chat             195 B         210 kB
├ ƒ /agents/[namespace]/[name]/chat/[chatId]    346 B         210 kB
├ ○ /agents/new                               14.7 kB         179 kB
├ ○ /icon                                       138 B         101 kB
├ ○ /memories                                  5.4 kB         135 kB
├ ○ /memories/new                             5.12 kB         186 kB
├ ○ /models                                   5.08 kB         138 kB
├ ○ /models/new                               7.67 kB         171 kB
├ ○ /servers                                  10.4 kB         181 kB
└ ○ /tools                                    6.23 kB         139 kB
+ First Load JS shared by all                  101 kB
  ├ chunks/4bd1b696-c3d30077330d7166.js       53.2 kB
  ├ chunks/684-a06e8c632d5cda41.js            45.7 kB
  └ other shared chunks (total)               1.87 kB


 

and on running npm run test i got


> kagents-ui@0.1.0 test
> jest --verbose

jest-haste-map: Haste module naming collision: kagents-ui
 The following files share their name; please adjust your hasteImpl:
   * <rootDir>/package.json
   * <rootDir>/.next/standalone/package.json

PASS src/lib/__tests__/toolUtils.test.ts
 Tool Utility Functions
   isMcpTool
     ✓ should identify valid MCP tools (4 ms)
     ✓ should reject invalid MCP tools (17 ms)
   isAgentTool
     ✓ should identify valid Agent tools (1 ms)
     ✓ should reject invalid Agent tools (2 ms)
   groupMcpToolsByServer
     ✓ should group multiple MCP tools from same server into single entry (3 ms)
     ✓ should keep MCP tools from different servers separate (2 ms)
     ✓ should keep MCP tools from servers with same names but different namespaces separate (3 ms)
     ✓ should preserve non-MCP tools unchanged (2 ms)
     ✓ should handle empty tool names arrays (1 ms)
     ✓ should remove duplicate tool names within same server (1 ms)
     ✓ should handle null/undefined inputs gracefully (1 ms)
     ✓ should skip null/undefined tools in array (1 ms)
     ✓ should handle MCP tools with missing or invalid toolServer
     ✓ should handle MCP tools with undefined/null toolNames
   getToolIdentifier
     ✓ should return correct identifier for Agent tools
     ✓ should return correct identifier for MCP tools (1 ms)
     ✓ should handle MCP tools with missing name
     ✓ should return random identifier for unknown tool types (1 ms)
     ✓ should handle null/undefined agent ref (1 ms)
   getToolDisplayName
     ✓ should return agent ref for Agent tools
     ✓ should return server name for MCP tools (1 ms)
     ✓ should return "No name" for MCP tools with missing name
     ✓ should return "Unknown Tool" for unknown tool types
   getToolDescription
     ✓ should return "Agent Tool" for Agent tools
     ✓ should return description from availableTools for MCP tools
     ✓ should return fallback description for MCP tools not found in availableTools (1 ms)
     ✓ should return "No description available" for unknown tool types
   getToolResponseDisplayName
     ✓ should return tool id when available (1 ms)
     ✓ should return "Unknown Tool" when id is missing
   getToolResponseDescription
     ✓ should return tool description when available (1 ms)
     ✓ should return "No description available" when description is missing
   getToolResponseCategory
     ✓ should extract category from kagent tool server tools (1 ms)
     ✓ should return full tool id when no underscore in kagent tool
     ✓ should return server_name for non-kagent tools (1 ms)
   getToolResponseIdentifier
     ✓ should return combined server name and tool id (1 ms)
   toolResponseToAgentTool
     ✓ should convert ToolsResponse to Tool with correct structure
     ✓ should handle different server references (1 ms)
   getDiscoveredToolDisplayName
     ✓ should return tool name when available
     ✓ should return "Unknown Tool" when name is missing (1 ms)
   getDiscoveredToolDescription
     ✓ should return tool description when available (1 ms)
     ✓ should return "No description available" when description is missing (1 ms)
   getDiscoveredToolCategory
     ✓ should extract category from kagent tool server tools
     ✓ should return full tool name when no underscore in kagent tool
     ✓ should return serverRef for non-kagent tools (1 ms)
     ✓ should handle serverRef that contains kagent-tool-server but not exact match
   getDiscoveredToolIdentifier
     ✓ should return combined server ref and tool name (1 ms)
     ✓ should handle empty tool name
   Edge cases and error handling
     ✓ should handle null/undefined inputs for getToolIdentifier (1 ms)
     ✓ should handle null/undefined inputs for getToolDisplayName (12 ms)
     ✓ should handle null/undefined inputs for getToolDescription
     ✓ should handle malformed tool objects (1 ms)
     ✓ should handle MCP tools with null/undefined mcpServer (1 ms)

PASS src/lib/__tests__/providers.test.ts
 isValidProviderInfoKey
   ✓ should return true for valid provider keys (2 ms)
   ✓ should return false for invalid provider keys (1 ms)
 getApiKeyForProviderFormKey
   ✓ should return the correct API key string for each provider form key (2 ms)
   ✓ should return the input key if it does not match known keys
 getProviderDisplayName
   ✓ should return the correct display name for each backend provider type (1 ms)
   ✓ should return the input type if no matching provider is found
 getProviderFormKey
   ✓ should return the correct form key for each backend provider type (1 ms)
   ✓ should return undefined if no matching provider type is found (1 ms)
 Provider Data Consistency
   ✓ should have PROVIDERS_INFO keys match modelProviders array elements (1 ms)
   ✓ should have a unique type for each provider (1 ms)

PASS src/lib/__tests__/utils.test.ts
 URL Generation Utilities
   getBackendUrl
     ✓ should use NEXT_PUBLIC_BACKEND_URL if provided (1 ms)
     ✓ should use default production URL when NEXT_PUBLIC_BACKEND_URL is not set
     ✓ should use default development URL
 Time Utilities
   getRelativeTimeString
     ✓ should return "just now" for times less than a minute ago (3 ms)
     ✓ should return minutes for times less than an hour ago (1 ms)
     ✓ should return hours for times less than a day ago (1 ms)
     ✓ should return days for times less than a month ago (1 ms)
 Resource Name Validation
   isResourceNameValid
     ✓ should accept valid RFC 1123 subdomain names (1 ms)
     ✓ should reject invalid names

Test Suites: 3 passed, 3 total
Tests:       71 passed, 71 total
Snapshots:   0 total
Time:        2.744 s
Ran all test suites.


@tanuj-rai tanuj-rai requested a review from peterj August 16, 2025 11:01
@peterj
Copy link
Collaborator

peterj commented Aug 18, 2025

there are still build issues -- can you please check? (also, the MemorySelectionSection.tsx should also be removed)

@tanuj-rai tanuj-rai force-pushed the feat/remove-memory-ui branch 2 times, most recently from d067484 to fe4aeeb Compare August 18, 2025 13:00
@peterj
Copy link
Collaborator

peterj commented Aug 18, 2025

please make sure you sign the DCO

@tanuj-rai
Copy link
Author

please make sure you sign the DCO

Thank you, @peterj. I have removed the MemorySelectionSection.tsx and signed the DCO. Please let me know if anything needs to be improved further.

@ashleywang1
Copy link
Contributor

@tanuj-rai - something might've messed up during the merge because I now see go/controller changes in this PR

@tanuj-rai
Copy link
Author

@tanuj-rai - something might've messed up during the merge because I now see go/controller changes in this PR

Hi @ashleywang1,

Apologies for the unintended go/controller/ changes in the PR. They were introduced during a rebase while signing the DCO, causing conflicts in go/controller/. I have reverted some changes, but the issue is not yet completely resolved.

@tanuj-rai
Copy link
Author

tanuj-rai commented Aug 21, 2025

I’m really sorry @peterj, for the mess caused by changes in go/controller. I really want to fix this properly. It will be ok if I clean up this branch so the PR only includes the intended UI changes, or should I open a fresh PR with the correct commits?

@EItanya
Copy link
Contributor

EItanya commented Aug 21, 2025

I’m really sorry @peterj, for the mess caused by changes in go/controller. I really want to fix this properly. It will be ok if I clean up this branch so the PR only includes the intended UI changes, or should I open a fresh PR with the correct commits?

That's totally up to you! Whichever is easier

@tanuj-rai tanuj-rai force-pushed the feat/remove-memory-ui branch from c0f0ba1 to 2e8f30a Compare August 22, 2025 12:32
Signed-off-by: Tanuj-rai <tanujrai898@gmail.com>
@tanuj-rai tanuj-rai force-pushed the feat/remove-memory-ui branch from 2e8f30a to 7d3ce9a Compare August 22, 2025 14:03
byoImage: string;
byoCmd: string;
byoArgs: string;
replicas: string;
imagePullPolicy: string;
imagePullSecrets: string[];
envPairs: { name: string; value?: string; isSecret?: boolean; secretName?: string; secretKey?: string; optional?: boolean }[];
envPairs: { key: string; value: string }[];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't look like the latest code either

@peterj
Copy link
Collaborator

peterj commented Aug 22, 2025

@tanuj-rai looks like some changes are unnecessary and/or you haven't synced from the latest main. Try fetching the latest main and then rebasing it onto your branch. (Alternatively, start from scratch as there shouldn't be too many places to remove the memory concepts from).

Signed-off-by: Tanuj Rai <tanujrai19@gmail.com>
Signed-off-by: Tanuj Rai <tanujrai19@gmail.com>
Signed-off-by: Tanuj Rai <tanujrai19@gmail.com>
Signed-off-by: Tanuj Rai <tanujrai19@gmail.com>
Signed-off-by: Tanuj Rai <tanujrai19@gmail.com>
Signed-off-by: Tanuj Rai <tanujrai19@gmail.com>
Signed-off-by: Tanuj Rai <tanujrai19@gmail.com>
Signed-off-by: Tanuj Rai <tanujrai19@gmail.com>
Signed-off-by: Tanuj Rai <tanujrai19@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants