* 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 )
| 321 | * that build a workspace path independent of `runtime.getWorkspacePath()`. |
| 322 | */ |
| 323 | function 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 | |
| 332 | async function readMultiProjectContextInstructions( |
| 333 | metadata: WorkspaceMetadata, |
no test coverage detected