Add read-only task context inheritance, ordered task-level LLM failover, live Worker controls, cascading task cleanup, FIFO task concurrency, cancellation diagnostics, UI updates, tests, build script, and changelog.
20 lines
442 B
Go
20 lines
442 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/Autumn-27/artex/agent"
|
|
)
|
|
|
|
func TestShutdownContextPreservesNamedCause(t *testing.T) {
|
|
signalCtx, signalCancel := context.WithCancel(context.Background())
|
|
ctx, shutdown := shutdownContext(signalCtx)
|
|
defer shutdown(nil)
|
|
signalCancel()
|
|
<-ctx.Done()
|
|
if code, _, _, ok := agent.AbortReason(ctx); !ok || code != "shutdown" {
|
|
t.Fatalf("code=%q ok=%v, want shutdown", code, ok)
|
|
}
|
|
}
|