daemon.process() branches on ContainerPool != nil: sandboxed tasks publish a taskrun.Request to archie.taskrun.<id> and await the response via the new runViaAgent method, instead of running workflow.Route/workflow.Run locally. Non-container mode is unchanged. Every durable side effect (Store, Forge, git push) already landed via the storerpc/forgerpc/ worktreerpc proxies during archie-agent's run by the time runViaAgent returns — it only parks the task itself on transport/setup failure, never duplicating a terminal state archie-agent's own workflow.Run already recorded. Also fixes a real correctness gap: with concurrent multi-task dispatch (archie-core-u64/g1l) plus containerized archie-agent, a shared queue-group subscription could let one container answer a sibling's taskrun message while having a *different* task's worktree mounted. archie-agent now reads its boot-time task.json and subscribes to its own exact per-task subject when present, falling back to the shared queue group only in dev/pool mode (no task.json). Adds agentexec.ProvidersFromConfig, deduped from cmd/archied's former executionProviders. Closes the archie-core-5zh epic: archie-agent runs an entire task's workflow per invocation instead of one stage per round trip, with all credentials staying daemon-side throughout.
27 lines
746 B
Go
27 lines
746 B
Go
package agentexec
|
|
|
|
import (
|
|
"reflect"
|
|
"testing"
|
|
|
|
"github.com/samcharles93/archie-core/internal/config"
|
|
)
|
|
|
|
func TestProvidersFromConfig(t *testing.T) {
|
|
in := map[string]config.Provider{
|
|
"anthropic": {Class: "anthropic", APIKeyEnv: "ANTHROPIC_API_KEY", BaseURL: "https://api.anthropic.com"},
|
|
}
|
|
want := map[string]Provider{
|
|
"anthropic": {Class: "anthropic", APIKeyEnv: "ANTHROPIC_API_KEY", BaseURL: "https://api.anthropic.com"},
|
|
}
|
|
if got := ProvidersFromConfig(in); !reflect.DeepEqual(got, want) {
|
|
t.Fatalf("ProvidersFromConfig() = %#v, want %#v", got, want)
|
|
}
|
|
}
|
|
|
|
func TestProvidersFromConfigEmpty(t *testing.T) {
|
|
if got := ProvidersFromConfig(nil); len(got) != 0 {
|
|
t.Fatalf("ProvidersFromConfig(nil) = %#v, want empty", got)
|
|
}
|
|
}
|