gptscript-ai / clio

Your friendly and safe CLI Copilot
Apache License 2.0
228 stars 24 forks source link

Call arguments for `exec` missing (but present in confirm message). #10

Open sangee2004 opened 3 months ago

sangee2004 commented 3 months ago

clio version - v0.1.1

Steps to reproduce the problem

  1. Chat with k8s agent and ask it to delete an existing deployment
  2. Notice that the call arguments for exec is missing in the TUI (but present in confirm message).

    
    > delete the deployment nginx-deployment
    
    ┌─────────────────┐
    │ Call Arguments: │
    │                 │
    │ exec {"         │
    └─────────────────┘

Run "kubectl delete deployment nginx-deployment" (or allow all "kubectl delete ..." commands) Confirm (y/n/a)>


After I confirm , I see it have the actual command for exec

delete the deployment nginx-deployment

┌───────────────────────────────────────────────────────────────┐
│ Call Arguments:                                               │
│                                                               │
│ exec {"command":"kubectl delete deployment nginx-deployment"} │
└───────────────────────────────────────────────────────────────┘

Running kubectl delete deployment nginx-deployment

┌────────────────────────────────────────────┐
│ deployment.apps "nginx-deployment" deleted │
└────────────────────────────────────────────┘

The deployment nginx-deployment has been successfully deleted.

Would you like to verify the deletion or perform any other actions?

@K8s>


Anther instance on when this happens:

yes

┌─────────────────┐
│ Call Arguments: │
│                 │
│ exec {"         │
└─────────────────┘

Run "kubectl get deployments" (or allow all "kubectl get ..." commands) Confirm (y/n/a)>


On confirmation:

list all deployments list all deployments

┌─────────────────────────────────────────────────────────────┐
│ Call Arguments:                                             │
│                                                             │
│ exec {"command":"kubectl get deployments --all-namespaces"} │
└─────────────────────────────────────────────────────────────┘

Running kubectl get deployments --all-namespaces



**Expected Behavior:**
Call arguments should not be missing for `exec` calls.
sangee2004 commented 3 months ago

Similar truncation issue is also seen when testing with gptscript -https://github.com/gptscript-ai/gptscript/issues/659