Add askUser config, disable askUser by default#1726
Add askUser config, disable askUser by default#1726dobesv wants to merge 5 commits intokagent-dev:mainfrom
Conversation
Signed-off-by: Dobes Vandermeer <dobes.vandermeer@newsela.com>
c9ab958 to
a8c341a
Compare
There was a problem hiding this comment.
Pull request overview
Adds an askUser configuration block to the agent spec so the built-in ask_user tool can be explicitly enabled, and is disabled by default when not configured (addressing #1554).
Changes:
- Introduces
AskUser/ask_userconfig types in Go + Python and wires them through agent translation/config. - Updates Python agent construction to only add
AskUserToolwhen explicitly enabled. - Adds unit tests in both Python and Go covering enabled/disabled/unspecified cases.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| python/packages/kagent-adk/tests/unittests/test_types.py | Adds tests asserting AskUserTool presence/absence based on ask_user.enabled. |
| python/packages/kagent-adk/src/kagent/adk/types.py | Adds AskUserConfig and gates adding AskUserTool on ask_user.enabled. |
| go/core/internal/controller/translator/agent/compiler.go | Translates spec.askUser into ADK agent config (AskUser). |
| go/core/internal/controller/translator/agent/adk_api_translator_test.go | Adds translator tests for AskUser propagation. |
| go/core/internal/controller/reconciler/reconciler.go | Warns when askUser.enabled is set for Go runtime (unsupported). |
| go/api/v1alpha2/agent_types.go | Extends the Agent CRD API (AgentSpec) with askUser. |
| go/api/adk/types.go | Extends ADK agent config JSON schema with ask_user. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Here was my proposed design from the previous PR, can we go with this?
type DeclarativeAgentSpec struct {
// ...existing fields...
BuiltinTools *BuiltinToolsConfig `json:"builtinTools,omitempty"`
}
type BuiltinToolsConfig struct {
AskUser *bool `json:"askUser,omitempty"`
// future built-in tools get their own fields here
}spec:
declarative:
builtinTools:
askUser: trueAskUser can have its own struct if you think there will be more config nested inside later, up to you
Signed-off-by: Dobes Vandermeer <dobes.vandermeer@newsela.com>
|
I updated it |
|
Thanks for fixing up the API. The only thing is that I'd like this tool on by default for ease of use. Advanced users/use-cases can always turn it off. |
Adds
builtinToolssettings block to the declarative agent spec. Currently it just has one sub-fieldaskUserwhich enables the "ask user" tool. If this is not set and enabled, the "ask user" tool is disabled. The tool is disabled by default because although it looks cool, it causes a lot of problems if you're not expecting it to be there, for example:Fixes #1554