mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-14 00:16:38 +00:00
* feat(collaboration): isolate delegated artifacts and child runs Isolate delegated inputs and outputs behind secure artifact exchange lifecycles. Scope Agent Link tasks by tenant and root agent, and enforce delegation spawn-tree boundaries. Add process-wide child-run admission and preserve logical media paths across native, MCP, and sandbox execution. * fix(collaboration): harden delegated task isolation Enforce tenant and root-agent task scope across migrations and stores. Add exactly-once async completion delivery, delegated sandbox boundaries, and confined artifact and media recovery across runtime surfaces. * fix(collaboration): recover interrupted async tasks * fix(collaboration): normalize persisted child-run status --------- Co-authored-by: ntduc <ntduc@cpp.ai.vn>
38 lines
786 B
Go
38 lines
786 B
Go
//go:build linux || darwin
|
|
|
|
package tools
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"path/filepath"
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
func TestDelegationArtifactPublishRejectsFIFOWithoutBlocking(t *testing.T) {
|
|
exchange := newTestDelegationExchange(
|
|
t,
|
|
t.TempDir(),
|
|
uuid.New(),
|
|
uuid.New(),
|
|
DelegationArtifactLimits{},
|
|
)
|
|
fifoPath := filepath.Join(exchange.OutputsHostPath(), "pipe")
|
|
if err := unix.Mkfifo(fifoPath, 0600); err != nil {
|
|
t.Skipf("mkfifo unavailable: %v", err)
|
|
}
|
|
destinationPath := t.TempDir()
|
|
_, err := exchange.Publish(
|
|
context.Background(),
|
|
openTestArtifactRoot(t, destinationPath),
|
|
time.Now(),
|
|
)
|
|
if !errors.Is(err, ErrArtifactNonRegular) {
|
|
t.Fatalf("Publish() error = %v, want non-regular rejection", err)
|
|
}
|
|
}
|