mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-20 05:04:49 +00:00
chore(foundry): improve sandbox impl + status pill (#252)
* Improve Daytona sandbox provisioning and frontend UI Refactor git clone script in Daytona provider to use cleaner shell logic for GitHub token authentication and branch checkout. Add support for private repository clones with token-based auth. Improve Daytona provider error handling and git configuration setup. Frontend improvements include enhanced dev panel, workspace dashboard, sidebar navigation, and UI components for better task/session management. Update interest manager and backend client to support improved session state handling. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * Add header status pill showing task/session/sandbox state Surface aggregate status (error, provisioning, running, ready, no sandbox) as a colored pill in the transcript panel header. Integrates task runtime status, session status, and sandbox availability via the sandboxProcesses interest topic so the pill accurately reflects unreachable sandboxes. Includes mock tasks demonstrating error, provisioning, and running states, unit tests for deriveHeaderStatus, and workspace-dashboard integration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
5a1b32a271
commit
70d31f819c
82 changed files with 2625 additions and 4166 deletions
39
foundry/packages/backend/src/sandbox-config.ts
Normal file
39
foundry/packages/backend/src/sandbox-config.ts
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
import type { AppConfig, ProviderId } from "@sandbox-agent/foundry-shared";
|
||||
|
||||
function hasE2BApiKey(config: AppConfig): boolean {
|
||||
return Boolean(config.providers.e2b.apiKey?.trim());
|
||||
}
|
||||
|
||||
function forcedSandboxProviderId(): ProviderId | null {
|
||||
const raw = process.env.FOUNDRY_SANDBOX_PROVIDER?.trim() ?? process.env.HF_SANDBOX_PROVIDER?.trim() ?? null;
|
||||
if (raw === "local" || raw === "e2b") {
|
||||
return raw;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
export function defaultSandboxProviderId(config: AppConfig): ProviderId {
|
||||
const forced = forcedSandboxProviderId();
|
||||
if (forced === "local") {
|
||||
return "local";
|
||||
}
|
||||
if (forced === "e2b") {
|
||||
if (!hasE2BApiKey(config)) {
|
||||
throw new Error("FOUNDRY_SANDBOX_PROVIDER=e2b requires E2B_API_KEY to be configured.");
|
||||
}
|
||||
return "e2b";
|
||||
}
|
||||
return hasE2BApiKey(config) ? "e2b" : "local";
|
||||
}
|
||||
|
||||
export function availableSandboxProviderIds(config: AppConfig): ProviderId[] {
|
||||
return hasE2BApiKey(config) ? ["e2b", "local"] : ["local"];
|
||||
}
|
||||
|
||||
export function resolveSandboxProviderId(config: AppConfig, requested?: ProviderId | null): ProviderId {
|
||||
if (requested === "e2b" && !hasE2BApiKey(config)) {
|
||||
throw new Error("E2B provider is not configured. Set E2B_API_KEY before selecting the e2b provider.");
|
||||
}
|
||||
|
||||
return requested ?? defaultSandboxProviderId(config);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue