Skip to content

Commit 860c7ee

Browse files
committed
refactor(agents): compose generation reuse with lifecycle artifact selection
Rebase over #125957, which preserves built-artifact mode for lifecycle-selected prepared registries. Reuse of the active gateway generation and the generation-inherited delta preference compose with that owner's parameter instead of duplicating the forwarding.
1 parent 94953ec commit 860c7ee

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎src/agents/prepared-model-runtime.inbound-registry.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,12 @@ export function prepareWorkspacePluginRegistries(
130130
env: input.env ?? process.env,
131131
...(input.workspaceDir ? { workspaceDir: input.workspaceDir } : {}),
132132
...(input.allowGatewaySubagentBinding ? { allowGatewaySubagentBinding: true } : {}),
133-
...(extendsActiveGatewayGeneration ? { preferBuiltPluginArtifacts: true } : {}),
134133
metadataSnapshot,
135-
...(preferBuiltPluginArtifacts ? { preferBuiltPluginArtifacts: true } : {}),
134+
// Lifecycle-selected callers and delta loads extending the active Gateway
135+
// generation both stay on built artifacts; isolated loads keep source truth.
136+
...(preferBuiltPluginArtifacts || extendsActiveGatewayGeneration
137+
? { preferBuiltPluginArtifacts: true }
138+
: {}),
136139
selections: input.runtimePluginSelections,
137140
})
138141
: inboundPluginRegistry;

‎src/agents/runtime-plugins.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ describe("agent runtime plugin registries", () => {
388388
installRecords: {},
389389
manifestRegistry: snapshot.manifestRegistry,
390390
onlyPluginIds: ["codex", "memory-core"],
391+
preferBuiltPluginArtifacts: true,
391392
runtimeOptions: undefined,
392393
workspaceDir: snapshot.workspaceDir,
393394
});

‎src/agents/runtime-plugins.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ type AgentRuntimePluginRegistryParams = {
3131
/** Lifecycle-owned selection; standalone/direct generations stay source-default. */
3232
preferBuiltPluginArtifacts?: boolean;
3333
metadataSnapshot?: PluginMetadataSnapshot;
34-
/** Set when extending a Gateway generation that loaded built artifacts itself. */
35-
preferBuiltPluginArtifacts?: boolean;
3634
};
3735

3836
function resolveAgentRuntimePluginRegistryLoad(params: AgentRuntimePluginRegistryParams) {
@@ -96,7 +94,6 @@ function resolveAgentRuntimePluginRegistryLoad(params: AgentRuntimePluginRegistr
9694
? {}
9795
: { onlyPluginIds: plan.pluginIds }),
9896
...(startupPluginIds === undefined ? {} : { channelPluginLoadIntent: "full" as const }),
99-
...(params.preferBuiltPluginArtifacts === true ? { preferBuiltPluginArtifacts: true } : {}),
10097
runtimeOptions: params.allowGatewaySubagentBinding
10198
? { allowGatewaySubagentBinding: true }
10299
: undefined,

0 commit comments

Comments
 (0)