@@ -447,21 +447,23 @@ export class ControlPlaneClient {
447447 public async createBackgroundAgent (
448448 prompt : string ,
449449 repoUrl : string ,
450+ name : string ,
450451 branch ?: string ,
451452 ) : Promise < { id : string } > {
452453 if ( ! ( await this . isSignedIn ( ) ) ) {
453454 throw new Error ( "Not signed in to Continue" ) ;
454455 }
455456
456- const resp = await this . requestAndHandleError ( "agents/devboxes " , {
457+ const resp = await this . requestAndHandleError ( "agents" , {
457458 method : "POST" ,
458459 headers : {
459460 "Content-Type" : "application/json" ,
460461 } ,
461462 body : JSON . stringify ( {
462463 prompt,
463464 repoUrl,
464- branch,
465+ name,
466+ branchName : branch ,
465467 } ) ,
466468 } ) ;
467469
@@ -488,22 +490,23 @@ export class ControlPlaneClient {
488490 }
489491
490492 try {
491- const resp = await this . requestAndHandleError ( "agents/devboxes " , {
493+ const resp = await this . requestAndHandleError ( "agents" , {
492494 method : "GET" ,
493495 } ) ;
494496
495497 const agents = ( await resp . json ( ) ) as any [ ] ;
496498
497499 return agents . map ( ( agent : any ) => ( {
498500 id : agent . id ,
499- name : agent . name || null ,
501+ name : agent . name || agent . metadata ?. name || null ,
500502 status : agent . status ,
501- repoUrl : agent . repo_url || agent . repoUrl || "" ,
502- createdAt : new Date (
503- agent . created_at || agent . create_time_ms ,
504- ) . toISOString ( ) ,
503+ repoUrl : agent . metadata ?. repo_url || agent . repo_url || "" ,
504+ createdAt :
505+ agent . created_at || agent . create_time_ms
506+ ? new Date ( agent . created_at || agent . create_time_ms ) . toISOString ( )
507+ : new Date ( ) . toISOString ( ) ,
505508 metadata : {
506- github_repo : agent . metadata ?. github_repo || agent . repo_url ,
509+ github_repo : agent . metadata ?. github_repo || agent . metadata ?. repo_url ,
507510 } ,
508511 } ) ) ;
509512 } catch ( e ) {
0 commit comments