Skip to content

Conversation

@inFocus7
Copy link
Contributor

original pr (which got in a terrible state due to merge conflicts + rebasing, so better to start fresh): #796


Originally, when listing the agents, if a single agent failed (i.e. modelConfig is invalid), no Agents were shown.

Changes

With these changes, we:

  1. Add a new AgentResponse field Accepted (i.e. Reconciled, but front-end friendly name)
    • This is based on the Accepted state of the Agent.
  2. Don't return an error response to the frontend when an Agent (or multiple) had failures.
    • We now continue listing agents, making the UI usable for valid agents, and adding a Not Accepted (could also be Not Reconciled, or Error for simplest terms) status on broken agents -- similar to how we do Not Ready while they are being deployed.
  3. No longer display unready/un-accepted Agents in the agent sidebar from chats.

Alternative Approaches

Another approach would be to avoid returning the not-reconciled agent altogether. This would avoid needing to set up the new response field and UI changes. I was originally leaning towards that one, but figured it may be useful/quicker for users to notice any broken agents if they appear in the UI with their failed status.

Another idea I had, but would probably be overkill and could constitute as a new feature, is to have a "notification system", where we would not display failed agents in the agents list, but instead have the reconciliation as a notification.

Testing

Dashboard

Build & run

make create-kind-cluster helm-install build-cli-local

KAGENT_HELM_REPO=./helm/ ./go/bin/kagent-local dashboard

Update an Agent to have an invalid modelConfig

kubectl patch agents.kagent.dev/k8s-agent -n kagent --type='json' -p='[{"op": "replace", "path": "/spec/declarative/modelConfig", "value": "default-model-config-2"}]'

Reload page.
View listing UI to see the failed state (Not Accepted).

Fix the agent.

kubectl patch agents.kagent.dev/k8s-agent -n kagent --type='json' -p='[{"op": "replace", "path": "/spec/declarative/modelConfig", "value": "default-model-config"}]'

Reload page.
It’s all good again!

CLI

This would ideally also get tested through the CLI to test the behavior of KAGENT_HELM_REPO=./helm/ ./go/bin/kagent-local get agent, but I’m hitting “userID is required” issues. My $HOME/.kagent/config.yaml file has it defined, so I'm not sure of the exact issue yet.


Resolves: #797

Copilot AI review requested due to automatic review settings August 25, 2025 18:04
Signed-off-by: Fabian Gonzalez <fabian.gonzalez@solo.io>
Signed-off-by: Fabian Gonzalez <fabian.gonzalez@solo.io>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces an install profile feature for KAgent that allows users to select predefined configurations during installation. The feature provides two profiles: "minimal" (default, no agents) and "demo" (all agents enabled), simplifying the setup process for different use cases.

  • Adds installation profile system with minimal and demo configurations
  • Enhances CLI install command with profile selection support
  • Implements interactive profile selection in shell mode

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

File Description
helm/README.md Removes outdated kmcp-crds installation instructions
go/cli/internal/profiles/ Adds new profiles package with embedded YAML configurations and profile management
go/cli/internal/cli/install.go Refactors installation logic to support profiles and adds interactive installation
go/cli/cmd/kagent/main.go Updates CLI to include profile flag and interactive profile selection

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

parts := strings.Split(value, "=")
redactedValues = append(redactedValues, parts[0]+"=********")
} else {
redactedValues = append(redactedValues, value)
Copy link

Copilot AI Aug 25, 2025

Choose a reason for hiding this comment

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

API key redaction logic assumes all values containing 'apiKey' have exactly one '=' separator. If a value has multiple '=' characters or no '=' character, this could cause index out of bounds or incorrect redaction.

Copilot uses AI. Check for mistakes.
@inFocus7 inFocus7 force-pushed the feat/kagent-installation-profiles branch from b608f1b to fcbe33e Compare August 25, 2025 18:05
Signed-off-by: Fabian Gonzalez <fabian.gonzalez@solo.io>
rootCmd.PersistentFlags().StringVarP(&cfg.Namespace, "namespace", "n", "kagent", "Namespace")
rootCmd.PersistentFlags().StringVarP(&cfg.OutputFormat, "output-format", "o", "table", "Output format")
rootCmd.PersistentFlags().BoolVarP(&cfg.Verbose, "verbose", "v", false, "Verbose output")
var profile string
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment about profile not being a config option in something like InstallConfig

Copy link
Contributor Author

Choose a reason for hiding this comment

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

:donezo:

Signed-off-by: Fabian Gonzalez <fabian.gonzalez@solo.io>
@EItanya EItanya merged commit 47fdfe0 into kagent-dev:main Aug 25, 2025
13 of 14 checks passed
yanivmn pushed a commit to yanivmn/kagent that referenced this pull request Aug 28, 2025
original pr (which got in a terrible state due to merge conflicts +
rebasing, so better to start fresh):
kagent-dev#796

---

Originally, when listing the agents, if a single agent failed (i.e.
`modelConfig` is invalid), no Agents were shown.

# Changes

With these changes, we:
1. Add a new AgentResponse field `Accepted` (i.e. `Reconciled`, but
front-end friendly name)
    - This is based on the `Accepted` state of the Agent.
2. **Don't** return an error response _to the frontend_ when an Agent
(or multiple) had failures.
- We now continue listing agents, making the UI usable for valid agents,
and adding a `Not Accepted` (could also be `Not Reconciled`, or `Error`
for simplest terms) status on broken agents -- similar to how we do `Not
Ready` while they are being deployed.
3. No longer display unready/un-accepted Agents in the agent sidebar
from chats.

## Alternative Approaches

Another approach would be to avoid returning the not-reconciled agent
altogether. This would avoid needing to set up the new response field
and UI changes. I was originally leaning towards that one, but figured
it may be useful/quicker for users to notice any broken agents if they
appear in the UI with their failed status.

Another idea I had, but would probably be overkill and could constitute
as a new feature, is to have a "notification system", where we would
_not_ display failed agents in the agents list, but instead have the
reconciliation as a notification.

# Testing

## Dashboard

Build & run
```sh
make create-kind-cluster helm-install build-cli-local

KAGENT_HELM_REPO=./helm/ ./go/bin/kagent-local dashboard
```

Update an Agent to have an invalid `modelConfig`
```sh
kubectl patch agents.kagent.dev/k8s-agent -n kagent --type='json' -p='[{"op": "replace", "path": "/spec/declarative/modelConfig", "value": "default-model-config-2"}]'
```

Reload page.
View listing UI to see the failed state (Not Accepted).

Fix the agent.
```sh
kubectl patch agents.kagent.dev/k8s-agent -n kagent --type='json' -p='[{"op": "replace", "path": "/spec/declarative/modelConfig", "value": "default-model-config"}]'
```

Reload page.
It’s all good again!

## CLI

This would ideally also get tested through the CLI to test the behavior
of `KAGENT_HELM_REPO=./helm/ ./go/bin/kagent-local get agent`, _but_ I’m
hitting “userID is required” issues. My `$HOME/.kagent/config.yaml` file
has it defined, so I'm not sure of the exact issue yet.

---

Resolves: kagent-dev#797

---------

Signed-off-by: Fabian Gonzalez <fabian.gonzalez@solo.io>
@artberger artberger mentioned this pull request Oct 29, 2025
10 tasks
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.

Creating an invalid agent (YAML) causes all agents to not load in the UI

2 participants