MCPcopy Create free account
hub / github.com/callstack/agent-device / mergeParentFlags

Function mergeParentFlags

src/core/batch.ts:205–217  ·  view source on GitHub ↗
(
  parentFlags: BatchFlags | Record<string, unknown> | undefined,
  childFlags: TFlags,
)

Source from the content-addressed store, hash-verified

203}
204
205export function mergeParentFlags<TFlags extends Record<string, unknown>>(
206 parentFlags: BatchFlags | Record<string, unknown> | undefined,
207 childFlags: TFlags,
208): TFlags {
209 const parentRecord = readBatchFlags(parentFlags) ?? {};
210 const childRecord = childFlags as Record<string, unknown>;
211 for (const key of INHERITED_PARENT_FLAG_KEYS) {
212 if (childRecord[key] === undefined && parentRecord[key] !== undefined) {
213 childRecord[key] = parentRecord[key];
214 }
215 }
216 return childFlags;
217}
218
219// Phase 4 (agent-cost) batch-step elision. When a non-default response level is
220// requested for the whole batch, INTERMEDIATE steps are forced to `digest` so a

Callers 2

buildReplayActionFlagsFunction · 0.90
buildBatchStepFlagsFunction · 0.85

Calls 1

readBatchFlagsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…