Detach prepared execution ownership from runners

This commit is contained in:
2026-11-05 13:52:36 +00:00
parent 7d500ee62f
commit 2f0f5fa607
5 changed files with 23 additions and 4 deletions

View File

@@ -43,6 +43,7 @@ var (
// Runner executes the Promptkit core use case.
type Runner struct {
identity *runnerIdentity
promptDefs promptdef.Repository
profiles profile.Repository
artifacts artifact.Reader
@@ -54,6 +55,10 @@ type Runner struct {
defaultTransientRetries uint64
}
// A non-zero-sized token gives each constructed runner a distinct identity
// without retaining its collaborators in prepared handles.
type runnerIdentity struct{ marker byte }
// RunAdmitter reserves capacity for one resolved backend run.
type RunAdmitter interface {
Admit(context.Context, string) (func(), error)
@@ -113,6 +118,7 @@ func NewRunnerWithRepairer(
retries = defaultTransientRetries[0]
}
return &Runner{
identity: &runnerIdentity{},
promptDefs: promptDefs,
profiles: profiles,
artifacts: artifacts,