MCPcopy
hub / github.com/coder/mux / buildSystemContextForTest

Function buildSystemContextForTest

src/node/services/streamContextBuilder.test.ts:76–104  ·  view source on GitHub ↗
(args: {
  runtime: TestRuntime;
  metadata: WorkspaceMetadata;
  workspacePath: string;
  cfg: ProjectsConfig;
  isSubagentWorkspace: boolean;
  effectiveAdditionalInstructions?: string;
  planFilePath?: string;
  memoryToolAvailable?: boolean;
})

Source from the content-addressed store, hash-verified

74}
75
76async function buildSystemContextForTest(args: {
77 runtime: TestRuntime;
78 metadata: WorkspaceMetadata;
79 workspacePath: string;
80 cfg: ProjectsConfig;
81 isSubagentWorkspace: boolean;
82 effectiveAdditionalInstructions?: string;
83 planFilePath?: string;
84 memoryToolAvailable?: boolean;
85}) {
86 return buildStreamSystemContext({
87 runtime: args.runtime,
88 metadata: args.metadata,
89 workspacePath: args.workspacePath,
90 workspaceId: args.metadata.id,
91 agentDefinition: { id: "exec", scope: "built-in" },
92 effectiveMode: "exec",
93 agentDiscoveryRuntime: args.runtime,
94 agentDiscoveryPath: args.workspacePath,
95 isSubagentWorkspace: args.isSubagentWorkspace,
96 effectiveAdditionalInstructions: args.effectiveAdditionalInstructions,
97 planFilePath: args.planFilePath,
98 modelString: "openai:gpt-5.2",
99 cfg: args.cfg,
100 providersConfig: null,
101 mcpServers: {},
102 memoryToolAvailable: args.memoryToolAvailable,
103 });
104}
105
106describe("buildPlanInstructions", () => {
107 test("prepends runtime plan file guidance ahead of caller additional instructions", async () => {

Callers 1

Calls 1

buildStreamSystemContextFunction · 0.90

Tested by

no test coverage detected