Archive pipelines: hide unused ones while keeping their history

archived_at on pipelines (migrated in place). archive_pipeline and
unarchive_pipeline by id or name with an expected-version guard;
list_pipelines hides archived unless include_archived. Archived
pipelines refuse runs, retries, new versions and name reuse, and
cannot be archived while an enabled schedule points at them.
CLI archive/unarchive and list --archived/--all, docs and skill note.
This commit is contained in:
2026-11-04 23:25:55 +00:00
parent fa6c0864db
commit 06bf580154
16 changed files with 630 additions and 14 deletions
+12 -1
View File
@@ -350,13 +350,24 @@ func HandlerWithOptions(ctx context.Context, options Options, stores ...*pipelin
} else if request.Type == protocol.List && len(stores) > 0 {
response.Type = protocol.PipelineList
response.DefaultModel, response.DefaultHarness = starterDefaults()
items, err := stores[0].List(ctx)
items, err := stores[0].ListPipelines(ctx, request.IncludeArchived)
if err != nil {
response.Type = protocol.Error
response.Error = err.Error()
} else {
response.Pipelines = items
}
} else if (request.Type == protocol.ArchivePipeline || request.Type == protocol.UnarchivePipeline) && len(stores) > 0 {
detail, err := archivePipeline(ctx, stores[0], request)
response.Detail = detail
response.Type = protocol.PipelineArchived
if request.Type == protocol.UnarchivePipeline {
response.Type = protocol.PipelineUnarchived
}
if err != nil {
response.Type = protocol.Error
response.Error = err.Error()
}
} else if request.Type == protocol.Search {
if len(stores) == 0 {
response.Type = protocol.Error