-
Notifications
You must be signed in to change notification settings - Fork 372
initial CLI. still work in progress, but basic list commands work #13
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
Conversation
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
|
I wanted to get a preliminary review to make sure I am going in the right direction |
|
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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 :))
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
cli/internal/api/run.go
Outdated
|
|
||
| import "fmt" | ||
|
|
||
| func (c *Client) CreateRun(req *CreateRunRequest) (*Run, error) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
update to the latest autogen commit
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>
There was a problem hiding this comment.
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
update agents
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>
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
No description provided.