@@ -74,19 +74,17 @@ function addAlwaysOnSkills(
7474 transport : CloudPromptTransport ,
7575 input : TaskCreationInput ,
7676) : CloudPromptTransport {
77- const refs = new Map (
78- ( transport . skillBundles ?? [ ] ) . map ( ( skill ) => [
79- `${ skill . source } :${ skill . path } ` ,
80- skill ,
81- ] ) ,
82- ) ;
83- for ( const skill of input . alwaysOnSkills ?? [ ] ) {
84- refs . set ( `${ skill . source } :${ skill . path } ` , {
77+ const refs = [
78+ ...( transport . skillBundles ?? [ ] ) ,
79+ ...( input . alwaysOnSkills ?? [ ] ) . map ( ( skill ) => ( {
8580 ...skill ,
8681 alwaysOn : true ,
87- } ) ;
88- }
89- return { ...transport , skillBundles : [ ...refs . values ( ) ] } ;
82+ } ) ) ,
83+ ] ;
84+ const deduplicated = new Map (
85+ refs . map ( ( skill ) => [ `${ skill . source } :${ skill . path } ` , skill ] ) ,
86+ ) ;
87+ return { ...transport , skillBundles : [ ...deduplicated . values ( ) ] } ;
9088}
9189
9290export class TaskCreationSaga extends Saga <
@@ -506,13 +504,6 @@ export class TaskCreationSaga extends Saga<
506504 const shouldConnect = ! isCloudCreate && ( ! ! input . taskId || ! ! agentCwd ) ;
507505
508506 if ( shouldConnect ) {
509- const alwaysOnSkillInstructions = input . alwaysOnSkills ?. length
510- ? await this . readOnlyStep ( "resolve_always_on_skills" , ( ) =>
511- this . deps . host . renderAlwaysOnSkillInstructions (
512- input . alwaysOnSkills ?? [ ] ,
513- ) ,
514- )
515- : undefined ;
516507 const initialPrompt =
517508 ! input . taskId && input . content
518509 ? await this . readOnlyStep ( "build_prompt_blocks" , ( ) =>
@@ -550,8 +541,9 @@ export class TaskCreationSaga extends Saga<
550541 if ( input . model ) connectParams . model = input . model ;
551542 if ( input . reasoningLevel )
552543 connectParams . reasoningLevel = input . reasoningLevel ;
553- if ( alwaysOnSkillInstructions )
554- connectParams . alwaysOnSkillInstructions = alwaysOnSkillInstructions ;
544+ if ( input . alwaysOnSkillInstructions )
545+ connectParams . alwaysOnSkillInstructions =
546+ input . alwaysOnSkillInstructions ;
555547 if ( importedClaude ) {
556548 connectParams . importedSessionId = importedClaude . importedSessionId ;
557549 connectParams . adapter = "claude" ;
0 commit comments