Read selected remote sessions directly without listing run history

This commit is contained in:
2026-11-18 04:12:56 +00:00
parent f85f93bdfb
commit 35eaefd05d
5 changed files with 35 additions and 37 deletions

View File

@@ -209,6 +209,7 @@ func TestRemoteSessionConfigCloseIsIdempotent(t *testing.T) {
workspaceRoot := t.TempDir()
pipelinePath, campaignPath, _ := writeValidConfigFiles(t, workspaceRoot)
fake := &storage.FakeBackend{}
fake.ListErr = errors.New("remote session loading must not enumerate historical objects")
seedRemoteSessionConfig(t, fake, "2026-05-03", `session_id: 2026-05-03
inputs:
audio_s3:
@@ -217,12 +218,11 @@ inputs:
setSessionConfigSearchPaths(t, []string{filepath.Join(t.TempDir(), "session.yml")})
deps, _ := remoteSessionLoaderDependencies(fake)
var downloadedPath string
deps.downloadObjectToTemp = captureRemoteSessionTempPath(&downloadedPath)
loaded, err := loadCommandConfigWithDependencies(context.Background(), pipelinePath, "", campaignPath, "", config.SessionLoadOptions{SessionID: "2026-05-03"}, nil, deps)
if err != nil {
t.Fatalf("loadCommandConfig() error = %v", err)
}
downloadedPath := loaded.Config.SessionSource.LocalPath
if err := loaded.Close(); err != nil {
t.Fatalf("first Close() error = %v", err)
}
@@ -237,16 +237,6 @@ inputs:
}
}
func captureRemoteSessionTempPath(destination *string) func(context.Context, storage.ObjectStore, string, string) (string, error) {
return func(ctx context.Context, store storage.ObjectStore, key, pattern string) (string, error) {
path, err := storage.DownloadObjectToTemp(ctx, store, key, pattern)
if err == nil {
*destination = path
}
return path, err
}
}
func TestExecuteRemoteSessionFallbackLoadsSecretsBeforeObjectStoreInit(t *testing.T) {
workspaceRoot := t.TempDir()
pipelinePath, campaignPath, _ := writeValidConfigFiles(t, workspaceRoot)