Skip to content

Conversation

@peterj
Copy link
Collaborator

@peterj peterj commented Jan 29, 2025

No description provided.

Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
@peterj
Copy link
Collaborator Author

peterj commented Jan 29, 2025

I wanted to get a preliminary review to make sure I am going in the right direction

@peterj peterj requested review from EItanya, ilackarms and npolshakova and removed request for EItanya and ilackarms January 29, 2025 20:55
@peterj
Copy link
Collaborator Author

peterj commented Jan 29, 2025

I can only assign one reviewer, but @ilackarms, @EItanya , @yuval-k please take a look as well.

"github.com/spf13/cobra"
)

func newTeamCmd() *cobra.Command {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason to have a cli tool to create a team if we have a CR representing teams: https://github.com/kagent-dev/kagent/blob/main/examples/1-team-resources.yaml#L2

Copy link
Contributor

Choose a reason for hiding this comment

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

Same question for list/get, why would you use:

kagent team list

Versus:

kubectl get AutogenTeam -A -oyaml

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

probably not in the long run; once the controller is there,we don't need this (+ I haven't tested this yet :))

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure about list/get. This CLI could print them in some sort of prettier way, or something which is more appealing. idk just spitballing

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

if you agree, I'll leave this until we have the controller up and running. once that's ready, we can discuss if we want a nicer output or if we want to remove it completely.

}

// Add global flags
cmd.PersistentFlags().String("api-url", "http://localhost:8081/api", "Backend API URL")
Copy link
Contributor

Choose a reason for hiding this comment

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

So the CLI can't really do anything until the server is up and running? We might want to add a check to help figure out what the api-url is from the config in the cluster (or even just check if the server is running)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

agree, once we have the controller we can add the check

Copy link
Contributor

Choose a reason for hiding this comment

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

In general the url should actually be discovered by looking at kube unless explicitly set but that can be added later


import "fmt"

func (c *Client) CreateRun(req *CreateRunRequest) (*Run, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think there should be a better UX than having to get the session id in order to create a run?

❯ ./bin/kagent run create
Error: accepts 1 arg(s), received 0
Usage:
  kagent run create [session-id] [flags]

Maybe we can save the last used session-id?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

perhaps kagent session set? or something similar to how kube context is?

Copy link
Contributor

Choose a reason for hiding this comment

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

100%, this is an implementation detail. IMO the CLI should create a new session each time it runs by default, unless there's some reason the user wants to explicitly tie it to an existing one which feels unlikely.

peterj and others added 5 commits January 29, 2025 15:00
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
…/cli

* 'peterj/cli' of github.com:kagent-dev/kagent:
  initial CLI. still work in progress, but basic list commands work

Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
@peterj peterj merged commit 7a7fdea into main Jan 30, 2025
Copy link
Contributor

Choose a reason for hiding this comment

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

This shouldn't be committed

@EItanya EItanya deleted the peterj/cli branch March 17, 2025 17:01
mukundkumarjha pushed a commit to mukundkumarjha/kagent that referenced this pull request May 6, 2025
lets-call-n-walk pushed a commit to lets-call-n-walk/kagent that referenced this pull request Nov 5, 2025
Implements all 16 review comments from inFocus7's code review to improve
code quality, test consistency, and validation reliability for the TLS
configuration feature.

Changes:

1. Fix CEL validation syntax (comment kagent-dev#16 - CRITICAL)
   - Replace != "" with size(field) > 0 for non-empty checks
   - Replace == "" with size(field) == 0 for empty checks
   - Fixes validation syntax errors that blocked CRD deployment

2. Remove task tracking comments (comments #1, kagent-dev#13, kagent-dev#14, kagent-dev#15)
   - Remove "(Task X.Y)" references from test docstrings
   - Remove obsolete implementation notes about env vars vs agent config
   - Remove test_openai_client_tls_parameters_override_environment (obsolete)

3. Fix copyright headers (comment #3)
   - Replace incorrect "Google LLC" copyright with Kagent project copyright
   - Apply consistent headers across test_ssl.py, test_tls_e2e.py, test_tls_integration.py

4. Migrate Go tests to testify (comments kagent-dev#5, kagent-dev#6)
   - Add testify/assert and testify/require imports
   - Replace manual error checks with testify assertions
   - Add envVarToMapHelper() for O(n) environment variable validation

5. Add golden tests for TLS scenarios (comment kagent-dev#12)
   - Create tls-with-custom-ca.yaml input
   - Create tls-with-disabled-verify.yaml input
   - Create tls-with-system-cas-disabled.yaml input
   - Generate golden outputs to catch TLS mounting regressions

6. Improve Python test quality (comments #2, kagent-dev#4, kagent-dev#9)
   - Remove redundant test case from test_ssl.py
   - Add test_e2e_openai_client_fails_without_custom_ca (negative test)
   - Simplify E2E_TEST_SUMMARY.md (72% reduction, remove task references)

7. Use OpenAI SDK's DefaultAsyncHttpxClient (comments kagent-dev#7, kagent-dev#8)
   - Replace custom httpx.AsyncClient with DefaultAsyncHttpxClient
   - Preserves OpenAI SDK defaults for timeout, pooling, and redirects
   - Add tests to verify SDK defaults are maintained

8. Fix documentation links (comment kagent-dev#10)
   - Update broken troubleshooting links to https://kagent.dev/docs

9. Document future enhancement (comment kagent-dev#11)
   - Created GitHub issue kagent-dev#1091 for automatic agent redeployment on secret changes

Test results:
- All Go tests pass (11 golden tests including 3 new TLS scenarios)
- All Python tests pass (15 tests including 2 new tests)
- CRD validation working correctly with proper error messages

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
lets-call-n-walk pushed a commit to lets-call-n-walk/kagent that referenced this pull request Nov 5, 2025
Implements all 16 review comments from inFocus7's code review to improve
code quality, test consistency, and validation reliability for the TLS
configuration feature.

Changes:

1. Fix CEL validation syntax (comment kagent-dev#16 - CRITICAL)
   - Replace != "" with size(field) > 0 for non-empty checks
   - Replace == "" with size(field) == 0 for empty checks
   - Fixes validation syntax errors that blocked CRD deployment

2. Remove task tracking comments (comments #1, kagent-dev#13, kagent-dev#14, kagent-dev#15)
   - Remove "(Task X.Y)" references from test docstrings
   - Remove obsolete implementation notes about env vars vs agent config
   - Remove test_openai_client_tls_parameters_override_environment (obsolete)

3. Fix copyright headers (comment #3)
   - Replace incorrect "Google LLC" copyright with Kagent project copyright
   - Apply consistent headers across test_ssl.py, test_tls_e2e.py, test_tls_integration.py

4. Migrate Go tests to testify (comments kagent-dev#5, kagent-dev#6)
   - Add testify/assert and testify/require imports
   - Replace manual error checks with testify assertions
   - Add envVarToMapHelper() for O(n) environment variable validation

5. Add golden tests for TLS scenarios (comment kagent-dev#12)
   - Create tls-with-custom-ca.yaml input
   - Create tls-with-disabled-verify.yaml input
   - Create tls-with-system-cas-disabled.yaml input
   - Generate golden outputs to catch TLS mounting regressions

6. Improve Python test quality (comments #2, kagent-dev#4, kagent-dev#9)
   - Remove redundant test case from test_ssl.py
   - Add test_e2e_openai_client_fails_without_custom_ca (negative test)
   - Simplify E2E_TEST_SUMMARY.md (72% reduction, remove task references)

7. Use OpenAI SDK's DefaultAsyncHttpxClient (comments kagent-dev#7, kagent-dev#8)
   - Replace custom httpx.AsyncClient with DefaultAsyncHttpxClient
   - Preserves OpenAI SDK defaults for timeout, pooling, and redirects
   - Add tests to verify SDK defaults are maintained

8. Fix documentation links (comment kagent-dev#10)
   - Update broken troubleshooting links to https://kagent.dev/docs

9. Document future enhancement (comment kagent-dev#11)
   - Created GitHub issue kagent-dev#1091 for automatic agent redeployment on secret changes

Test results:
- All Go tests pass (11 golden tests including 3 new TLS scenarios)
- All Python tests pass (15 tests including 2 new tests)
- CRD validation working correctly with proper error messages
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