@@ -89,7 +89,7 @@ import {
8989import { createShellCollectTool } from "../agent/background-shell-tool.js" ;
9090import { createAttachmentRehydrateTransform } from "../session/attachment-store.js" ;
9191import { tryReadPriorHandoffFile } from "../session/compaction-handoff.js" ;
92- import { gatherEnvironment } from "../agent/environment.js" ;
92+ import { gatherEnvironmentCached } from "../agent/environment.js" ;
9393import { generateSessionId } from "../session/index.js" ;
9494import { consumeStream } from "../session/stream-consumer.js" ;
9595import { createCycleTextRecorder } from "../session/stream-journal.js" ;
@@ -118,7 +118,7 @@ import {
118118 createUseSkillTool ,
119119 workerUseSkillDefinition ,
120120} from "../agent/use-skill.js" ;
121- import { discoverSkills } from "../extensions/skills.js" ;
121+ import { discoverSkillsCached } from "../extensions/skills.js" ;
122122import { formatAttachedSkillConstraints } from "../agent/directors/attached-skills.js" ;
123123import {
124124 createManageTasksRunner ,
@@ -612,7 +612,11 @@ async function runSubAgentInner(
612612 telemetryRollup : SubAgentTelemetryRollup ,
613613 settlementState : { latestModel : string } ,
614614) : Promise < RunSubAgentResult > {
615- const inferenceDeps = await assembleInferenceBase ( ) ;
615+ // CL-9010: fleet-spawned workers skip the pricing-cache seed re-read —
616+ // the parent runtime already applied the process seed at boot.
617+ const inferenceDeps = await assembleInferenceBase ( undefined , {
618+ ...( params . skipPricingSeed === true ? { skipPricingSeed : true } : { } ) ,
619+ } ) ;
616620
617621 // CL-9475: the fleet session id the parent observes (params.id); falls
618622 // back to the local session id below when run without a fleet caller.
@@ -774,7 +778,13 @@ async function runSubAgentInner(
774778 orchestrator : params . orchestrator === true ,
775779 } ) ;
776780 const skillDirs = [ ...( params . skillDirs ?? [ ] ) ] ;
777- const skillSnapshot = await discoverSkills ( params . cwd , skillDirs ) ;
781+ // CL-9010: reuse the dispatcher's catalog when the lane shares its cwd;
782+ // otherwise fall back to the cached discovery (same-cwd repeat spawns
783+ // skip the rescan). Copies keep one worker from mutating another's list.
784+ const skillSnapshot =
785+ params . skills !== undefined
786+ ? [ ...params . skills ]
787+ : await discoverSkillsCached ( params . cwd , skillDirs ) ;
778788 tools = [
779789 ...tools ,
780790 createSkillSearchTool ( {
@@ -975,6 +985,9 @@ async function runSubAgentInner(
975985 ? { secretGuardExtraDeniedPaths : nd . secretGuardExtraDeniedPaths }
976986 : { } ) ,
977987 ...( nd . skillDirs !== undefined ? { skillDirs : nd . skillDirs } : { } ) ,
988+ // CL-9010: nested shared-cwd lanes reuse this worker's catalog, which
989+ // was discovered (or inherited) for exactly this cwd.
990+ skillSnapshot,
978991 ...( nd . extraToolPlugins !== undefined
979992 ? { extraToolPlugins : nd . extraToolPlugins }
980993 : { } ) ,
@@ -1059,7 +1072,9 @@ async function runSubAgentInner(
10591072 getContextDir : ( ) => childContextDir ,
10601073 } ) ;
10611074
1062- const environment = await gatherEnvironment ( params . cwd ) ;
1075+ // CL-9010: same-cwd spawns within the TTL share the git/top-level
1076+ // snapshot instead of re-running git per lane.
1077+ const environment = await gatherEnvironmentCached ( params . cwd ) ;
10631078 const attachedSection =
10641079 params . attachedSkills !== undefined && params . attachedSkills . length > 0
10651080 ? await formatAttachedSkillConstraints ( {
0 commit comments