feat(main): wire per-skill Orchestrators replacing single executor.Run
Each skill now gets its own Orchestrator built from its ChainFor entry, with LiteLLM for local tiers and Claude for cloud tiers. Removes the defunct models.Resolve calls and single shared executor.Run pattern. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -84,11 +84,23 @@ func main() {
|
|||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
executor := iexec.New(iexec.Config{
|
claudeExec := iexec.New(iexec.Config{
|
||||||
SystemPrompt: string(systemPrompt),
|
SystemPrompt: string(systemPrompt),
|
||||||
LiteLLMBaseURL: cfg.LiteLLMBaseURL,
|
LiteLLMBaseURL: cfg.LiteLLMBaseURL,
|
||||||
LiteLLMAPIKey: cfg.LiteLLMAPIKey,
|
LiteLLMAPIKey: cfg.LiteLLMAPIKey,
|
||||||
})
|
})
|
||||||
|
litellmExec := iexec.NewLiteLLM(cfg.LiteLLMBaseURL, cfg.LiteLLMAPIKey, 0)
|
||||||
|
verifier := iexec.NewVerifier("", models.Verifier(), 0)
|
||||||
|
|
||||||
|
buildOrch := func(skill string) *iexec.Orchestrator {
|
||||||
|
rawChain := models.ChainFor(skill, "")
|
||||||
|
chain := make([]iexec.ChainEntry, len(rawChain))
|
||||||
|
for i, m := range rawChain {
|
||||||
|
chain[i] = iexec.EntryFor(m)
|
||||||
|
}
|
||||||
|
attempts := make([]iexec.AttemptRecord, 0, len(chain))
|
||||||
|
return iexec.NewOrchestrator(chain, litellmExec.Run, claudeExec.Run, verifier, models.LlamaSwapURL(), &attempts)
|
||||||
|
}
|
||||||
|
|
||||||
tierFn := func(ctx context.Context) tier.Info {
|
tierFn := func(ctx context.Context) tier.Info {
|
||||||
return tier.Detect(ctx, "https://api.anthropic.com", cfg.LiteLLMBaseURL)
|
return tier.Detect(ctx, "https://api.anthropic.com", cfg.LiteLLMBaseURL)
|
||||||
@@ -98,8 +110,8 @@ func main() {
|
|||||||
reg.Register(tdd.New(tdd.Config{
|
reg.Register(tdd.New(tdd.Config{
|
||||||
SystemPrompt: string(systemPrompt),
|
SystemPrompt: string(systemPrompt),
|
||||||
SkillPrompt: string(tddPrompt),
|
SkillPrompt: string(tddPrompt),
|
||||||
DefaultModel: models.Resolve("tdd", ""),
|
DefaultModel: models.ChainFor("tdd", "")[0],
|
||||||
ExecutorFn: executor.Run,
|
ExecutorFn: buildOrch("tdd").Run,
|
||||||
SessionsDir: cfg.SessionsDir,
|
SessionsDir: cfg.SessionsDir,
|
||||||
}))
|
}))
|
||||||
reg.Register(brain.New(brain.Config{
|
reg.Register(brain.New(brain.Config{
|
||||||
@@ -113,33 +125,33 @@ func main() {
|
|||||||
}))
|
}))
|
||||||
reg.Register(retrospective.New(retrospective.Config{
|
reg.Register(retrospective.New(retrospective.Config{
|
||||||
SkillPrompt: string(retroPrompt),
|
SkillPrompt: string(retroPrompt),
|
||||||
DefaultModel: models.Resolve("retrospective", ""),
|
DefaultModel: models.ChainFor("retrospective", "")[0],
|
||||||
SessionsDir: cfg.SessionsDir,
|
SessionsDir: cfg.SessionsDir,
|
||||||
ExecutorFn: executor.Run,
|
ExecutorFn: buildOrch("retrospective").Run,
|
||||||
}))
|
}))
|
||||||
reg.Register(review.New(review.Config{
|
reg.Register(review.New(review.Config{
|
||||||
SkillPrompt: string(reviewPrompt),
|
SkillPrompt: string(reviewPrompt),
|
||||||
DefaultModel: models.Resolve("review", ""),
|
DefaultModel: models.ChainFor("review", "")[0],
|
||||||
ExecutorFn: executor.Run,
|
ExecutorFn: buildOrch("review").Run,
|
||||||
SessionsDir: cfg.SessionsDir,
|
SessionsDir: cfg.SessionsDir,
|
||||||
}))
|
}))
|
||||||
reg.Register(skilldebug.New(skilldebug.Config{
|
reg.Register(skilldebug.New(skilldebug.Config{
|
||||||
SkillPrompt: string(debugPrompt),
|
SkillPrompt: string(debugPrompt),
|
||||||
DefaultModel: models.Resolve("debug", ""),
|
DefaultModel: models.ChainFor("debug", "")[0],
|
||||||
ExecutorFn: executor.Run,
|
ExecutorFn: buildOrch("debug").Run,
|
||||||
SessionsDir: cfg.SessionsDir,
|
SessionsDir: cfg.SessionsDir,
|
||||||
}))
|
}))
|
||||||
reg.Register(spec.New(spec.Config{
|
reg.Register(spec.New(spec.Config{
|
||||||
SkillPrompt: string(specPrompt),
|
SkillPrompt: string(specPrompt),
|
||||||
DefaultModel: models.Resolve("spec", ""),
|
DefaultModel: models.ChainFor("spec", "")[0],
|
||||||
ExecutorFn: executor.Run,
|
ExecutorFn: buildOrch("spec").Run,
|
||||||
SessionsDir: cfg.SessionsDir,
|
SessionsDir: cfg.SessionsDir,
|
||||||
}))
|
}))
|
||||||
reg.Register(trainer.New(trainer.Config{
|
reg.Register(trainer.New(trainer.Config{
|
||||||
ReaderPrompt: string(trainerReaderPrompt),
|
ReaderPrompt: string(trainerReaderPrompt),
|
||||||
WriterPrompt: string(trainerWriterPrompt),
|
WriterPrompt: string(trainerWriterPrompt),
|
||||||
DefaultModel: models.Resolve("trainer", ""),
|
DefaultModel: models.ChainFor("trainer", "")[0],
|
||||||
ExecutorFn: executor.Run,
|
ExecutorFn: buildOrch("trainer").Run,
|
||||||
SessionsDir: cfg.SessionsDir,
|
SessionsDir: cfg.SessionsDir,
|
||||||
BrainDir: cfg.BrainDir,
|
BrainDir: cfg.BrainDir,
|
||||||
}))
|
}))
|
||||||
|
|||||||
Reference in New Issue
Block a user