MCPcopy Index your code
hub / github.com/Doorman11991/smallcode / buildStepMessages

Function buildStepMessages

src/session/parallel_executor.js:44–51  ·  view source on GitHub ↗

* Build an isolated messages array for a single parallel step. * The step sees the system prompt and its task description, but NOT * the full conversation history (which would include sibling results). * * IMPORTANT: sharedSystemMessages must contain ONLY {role:'system'} entries — * not user/as

(sharedSystemMessages, stepInstruction)

Source from the content-addressed store, hash-verified

42 * @returns {object[]}
43 */
44function buildStepMessages(sharedSystemMessages, stepInstruction) {
45 // Safety: only allow system messages to prevent history bleed
46 const systemOnly = (sharedSystemMessages || []).filter(m => m.role === 'system');
47 return [
48 ...systemOnly,
49 { role: 'user', content: stepInstruction },
50 ];
51}
52
53/**
54 * Execute a single batch of steps concurrently.

Callers 1

executeBatchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected