[Main discussion and idea from alexis-brettes (Nayero): https://discord.com/channels/1346225185166065826/1346225185841221644/1497163015047352361]
Add a built-in tool that blocks until a k8s resource reaches a given condition, using k wait under the hood. This removes the need for agents to poll repeatedly and saves a significant number of tokens.
When an agent deploys something and needs to wait for it to be ready, it currently has to call k get in a loop until the resource reaches the desired state. Each loop iteration is a full LLM turn, which wastes tokens and adds latency.
Current pattern:
[turn 1] kgp -n default -> Pending
[turn 2] kgp -n default -> Pending
[turn 3] kgp -n default -> Running
Proposed Solution
A tool that wraps k wait and returns only when the condition is met or the timeout expires:
k wait deployment/myapp -n default --for=condition=Available --timeout=300s
The tool would accept: resource type, resource name, namespace, condition, and timeout. It makes one blocking call and returns a clear success or failure message. No polling loop, no extra LLM turns.
This is related to kagent-dev/kagent#1541 but targets a specific and common use case: waiting for k8s resources rather than waiting for a fixed amount of time.
[Main discussion and idea from alexis-brettes (Nayero): https://discord.com/channels/1346225185166065826/1346225185841221644/1497163015047352361]
Add a built-in tool that blocks until a k8s resource reaches a given condition, using
k waitunder the hood. This removes the need for agents to poll repeatedly and saves a significant number of tokens.When an agent deploys something and needs to wait for it to be ready, it currently has to call
k getin a loop until the resource reaches the desired state. Each loop iteration is a full LLM turn, which wastes tokens and adds latency.Current pattern:
Proposed Solution
A tool that wraps
k waitand returns only when the condition is met or the timeout expires:k wait deployment/myapp -n default --for=condition=Available --timeout=300sThe tool would accept: resource type, resource name, namespace, condition, and timeout. It makes one blocking call and returns a clear success or failure message. No polling loop, no extra LLM turns.
This is related to kagent-dev/kagent#1541 but targets a specific and common use case: waiting for k8s resources rather than waiting for a fixed amount of time.