Conversation
Signed-off-by: Zzde <zhangxh1997@gmail.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
This PR updates the AI agent experience end-to-end: improving the chat UI/UX (mobile + loading indicator), enhancing suggested prompts/i18n, and making backend tool handling more robust (tool error signaling and dynamic resource resolution for RBAC/tool execution).
Changes:
- UI: Make the chatbox responsive on mobile, improve the “thinking” indicator, and expand suggested prompts with template placeholders.
- Frontend SSE handling: Improve
tool_resultparsing and reflect tool success/failure viaactionStatus. - Backend AI tools: Resolve Kubernetes resources via discovery (with static fallback), add CRD support, and add tests for resource matching.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/src/styles/base.css | Adds animated “thinking dots” styling. |
| ui/src/i18n/locales/zh.json | Updates/expands AI suggested prompts (with placeholder templates). |
| ui/src/i18n/locales/en.json | Updates/expands AI suggested prompts (with placeholder templates). |
| ui/src/hooks/use-ai-chat.ts | Improves tool result handling, including error inference and status updates. |
| ui/src/components/ai-chat/ai-chatbox.tsx | Mobile-friendly layout, viewport-bound resizing on desktop, richer suggested prompts, and new loading indicator. |
| pkg/ai/tools_test.go | Adds tests for CRD static resolution and resource input matching. |
| pkg/ai/tools.go | Adds discovery-based resource resolution + CRD mapping; updates permission resolution and object building accordingly. |
| pkg/ai/openai.go | Increases tool-call iteration limit; includes is_error in tool_result SSE. |
| pkg/ai/anthropic.go | Increases tool-call iteration limit; includes is_error in tool_result SSE. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -376,7 +504,7 @@ func requiredToolPermissions(toolName string, args map[string]interface{}) ([]to | |||
| return nil, err | |||
| } | |||
| namespace, _ := args["namespace"].(string) | |||
| resource := resolveResourceInfo(kind) | |||
| resource := resolveResourceInfo(ctx, cs, kind) | |||
| return []toolPermission{{ | |||
There was a problem hiding this comment.
requiredToolPermissions now calls discovery-based resolveResourceInfo(...). For a single tool invocation, AuthorizeTool calls this and then ExecuteTool/execute* calls resolveResourceInfo again, so discovery can run twice per tool call (and ServerPreferredResources() is relatively expensive). Consider caching discovery results per request/cluster, or resolving once and reusing the resourceInfo between auth and execution.
No description provided.