Returns the full destination path of the file in the container.
(obj: any, agentContainerName: string, fqn: string)
| 869 | |
| 870 | /** Returns the full destination path of the file in the container. */ |
| 871 | private async writeJSONToAgentContainer(obj: any, agentContainerName: string, fqn: string) { |
| 872 | const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'vivaria-agent-temp-')) |
| 873 | const tempFile = path.join(tempDir, 'temp.json') |
| 874 | await fs.writeFile(tempFile, JSON.stringify(obj)) |
| 875 | |
| 876 | await this.docker.copy(tempFile, { containerName: agentContainerName, path: fqn, owner: 'agent' }) |
| 877 | } |
| 878 | |
| 879 | private async runWithPyhooksAgentOutput( |
| 880 | branchKey: BranchKey, |