MCPcopy Index your code
hub / github.com/coder/mux / subProjectAwareWorkspaceRoot

Function subProjectAwareWorkspaceRoot

src/node/services/systemMessage.ts:323–330  ·  view source on GitHub ↗

* For sub-project workspaces, callers typically pass the execution path * (` / `) as `workspacePath`. Instruction loading * needs the workspace root instead — without it, the parent project's * AGENTS.md is missed entirely. For non-sub-project workspaces the execution

(
  metadata: WorkspaceMetadata,
  runtime: Runtime,
  workspacePath: string
)

Source from the content-addressed store, hash-verified

321 * that build a workspace path independent of `runtime.getWorkspacePath()`.
322 */
323function subProjectAwareWorkspaceRoot(
324 metadata: WorkspaceMetadata,
325 runtime: Runtime,
326 workspacePath: string
327): string {
328 if (!metadata.subProjectPath?.trim()) return workspacePath;
329 return resolveWorkspaceRootPath(metadata, runtime);
330}
331
332async function readMultiProjectContextInstructions(
333 metadata: WorkspaceMetadata,

Callers 2

readToolInstructionsFunction · 0.85
buildSystemMessageFunction · 0.85

Calls 1

resolveWorkspaceRootPathFunction · 0.90

Tested by

no test coverage detected