Run tasks directly with language-independent project tools
This commit is contained in:
@@ -65,7 +65,7 @@ func TestWebStagesCanRunWithoutMutationApproval(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestMutatingToolsRequireManualApproval(t *testing.T) {
|
||||
func TestDeclaredMutationToolsRunWithoutManualApproval(t *testing.T) {
|
||||
for _, tool := range []string{"edit", "shell"} {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
store, err := pipeline.Open(filepath.Join(t.TempDir(), "tools.db"))
|
||||
@@ -79,15 +79,11 @@ func TestMutatingToolsRequireManualApproval(t *testing.T) {
|
||||
items, _ := store.List(ctx)
|
||||
r, _ := newRunner(ctx, store)
|
||||
request := protocol.Message{PipelineID: items[0].ID, Version: 1, RequestKey: "unsafe", Input: map[string]any{"prompt": "task"}}
|
||||
if _, err := r.start(request); err == nil || !strings.Contains(err.Error(), "manual tool approval") {
|
||||
t.Fatal("mutation without approval", tool, err)
|
||||
}
|
||||
r.execute = func(context.Context, stage.Definition, stage.Values) (stage.Result, error) {
|
||||
return stage.Result{Outcome: "success", Output: stage.Values{}}, nil
|
||||
}
|
||||
request.AllowTools = true
|
||||
if _, err := r.start(request); err != nil {
|
||||
t.Fatal("approved run rejected", err)
|
||||
t.Fatal("declared tools should run without a second approval", err)
|
||||
}
|
||||
r.wg.Wait()
|
||||
cancel()
|
||||
|
||||
Reference in New Issue
Block a user