Local to Cloud
This guide upgrades a local Codex workflow to the cloud while preserving artefacts and tooling. Start with a repository you already run through node ./bin/start-session.mjs or computer-agents locally.
Step 1: Capture the baseline
- Run a local session and inspect
docs/sessions/<id>/to understand the artefacts your workflow relies on. - Note MCP servers in use and any environment variables the agent needs.
Step 2: Prepare the workspace
- Ensure the repository is clean and pushed to git.
- If you rely on secrets, move them into
.envor configuration files that can be uploaded via the Files API.
Step 3: Provision a container
const cloud = new TestbaseCloud({ apiKey: process.env.TESTBASE_API_KEY });
const agent = await cloud.createCloudAgent({
name: 'Worker',
agentType: 'worker',
workspace: './repo',
model: 'gpt-4o-mini',
reasoningEffort: 'medium',
persistContainer: false
});If you need MCP servers, add them now with cloud.addMcpServer.
Step 4: Seed configuration
- Upload secrets, fixtures, or dependency manifests:
await cloud.uploadFile(agent.containerId, '/workspace/.env', process.env.LOCAL_ENV!);
await cloud.uploadFile(agent.containerId, '/workspace/scripts/bootstrap.sh', bootstrapScript);Step 5: Execute the same task
const result = await run(agent, 'Add feature X exactly as the local workflow does');
console.log(result.finalOutput);Compare artefacts:
cloud.listFilesto view outputscloud.downloadFileto retrieve logs or test reports
Step 6: Validate parity
- Diff local and cloud outputs.
- Ensure reviewer feedback or plan artefacts align.
- Check
cloud.getLogsfor runtime differences (missing packages, slower commands).
Step 7: Automate cleanup
Decide whether to keep the container alive. For CI jobs, delete it:
await cloud.deleteContainer(agent.containerId);Step 8: Update orchestrations
- Point orchestrators or schedulers at the new cloud-backed agent.
- Store the container ID in a secrets manager or recreate the container per run if you prefer immutability.
Following this sequence minimizes surprises: you graduate to the cloud with confidence that behaviour matches your trusted local workflow.
Last updated on