Skip to content

[chore] Add harness-agnostic remote asset-prep seam#5042

Draft
junaway wants to merge 2 commits into
big-agentsfrom
chore/add-foundation-remote-bootstrap
Draft

[chore] Add harness-agnostic remote asset-prep seam#5042
junaway wants to merge 2 commits into
big-agentsfrom
chore/add-foundation-remote-bootstrap

Conversation

@junaway

@junaway junaway commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Context

Remote-sandbox credential/asset provisioning (writing auth files, uploading config) only existed as a Pi-specific code path (prepareDaytonaPiAssets), copy-pasted per harness as new harnesses landed on remote sandboxes. There was no shared seam, so every new harness x remote-sandbox cell risked its own drift in credential handling.

Changes

Adds prepareRemoteHarnessAssets in services/runner/src/engines/sandbox_agent/remote-assets.ts, a single dispatch point keyed on plan.acpAgent that later harness/sandbox branches plug into instead of hand-rolling their own prep function. Wires it into sandbox_agent.ts. Also fixes casing (E2b to E2B) picked up in this seam during the matrix build, and trims the now-stale session-alive.test.ts assertion that checked for a status field the streams redesign already dropped from the heartbeat contract.

Tests / notes

  • New unit coverage in sandbox-agent-remote-assets.test.ts.
  • This branch is a shared dependency: chore/add-codex-daytona, chore/add-codex-e2b, chore/add-opencode-daytona, chore/add-opencode-e2b, and chore/add-claude-daytona were built to layer onto this seam even though they're stacked directly on big-agents for now — expect a follow-up fold-in pass once this lands.

jp-agenta and others added 2 commits July 2, 2026 14:47
…arnessAssets)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 2, 2026 21:40
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 2, 2026
@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Jul 2, 2026 9:40pm

Request Review

@dosubot dosubot Bot added the refactoring A code change that neither fixes a bug nor adds a feature label Jul 2, 2026
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 37a1e46b-7876-444b-ba52-87bad5afa60e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/add-foundation-remote-bootstrap

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a harness-agnostic “remote asset prep” seam in the runner’s sandbox-agent engine so remote sandbox credential/asset provisioning is centralized (instead of being reimplemented per harness).

Changes:

  • Adds prepareRemoteHarnessAssets dispatch + writeCodexAuthToSandbox utility for remote-sandbox credential provisioning.
  • Wires the new seam into runSandboxAgent so remote sandboxes run the shared prep step.
  • Adds unit tests and design docs for the seam (tasks/specs/research).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
services/runner/src/engines/sandbox_agent/remote-assets.ts New shared remote-sandbox asset/credential prep dispatch keyed by plan.acpAgent.
services/runner/src/engines/sandbox_agent.ts Calls the new prep seam for remote sandboxes (Daytona now; E2B gated via forward-compat check).
services/runner/tests/unit/sandbox-agent-remote-assets.test.ts Unit coverage for dispatch behavior and Codex auth file write.
docs/design/agent-workflows/projects/foundation-remote-bootstrap/tasks.md Task breakdown for implementing the seam + wiring + tests.
docs/design/agent-workflows/projects/foundation-remote-bootstrap/specs.md Spec for interface/dispatch and Codex auth write behavior.
docs/design/agent-workflows/projects/foundation-remote-bootstrap/research.md Background and rationale for the seam + per-harness credential needs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +48 to +55
### `writeCodexAuthToSandbox`

Writes `~/.codex/auth.json`:

```json
{ "providers": [{ "name": "openai", "apiKey": "<OPENAI_API_KEY>" }] }
```

const calls: Call[] = [];
const sandbox = makeSandbox(calls);
await writeCodexAuthToSandbox(sandbox, { OPENAI_API_KEY: "sk-direct" }, () => {});
assert.deepEqual(calls[0], { op: "mkdir", path: "/root/.codex" });
Comment on lines +469 to 471
if (plan.isDaytona || (plan as any).isE2B) {
await prepareRemoteHarnessAssets({ sandbox, plan, log: logger });
}
@jp-agenta jp-agenta marked this pull request as draft July 2, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring A code change that neither fixes a bug nor adds a feature size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants