updates
This commit is contained in:
@@ -5,7 +5,6 @@ import { Hono } from "hono";
|
||||
|
||||
import { internalRoute } from "./auth/internal-route";
|
||||
import { parseAgentEnv } from "./runtime/agent-env";
|
||||
import { runtimeRegistry } from "./runtime/agent-os-registry";
|
||||
import {
|
||||
cancelAgentOsAttempt,
|
||||
executeAgentOsAttempt,
|
||||
@@ -82,8 +81,6 @@ app.post(
|
||||
}
|
||||
);
|
||||
|
||||
app.all("/api/rivet/*", (context) => runtimeRegistry.handler(context.req.raw));
|
||||
|
||||
app.route("/", flue());
|
||||
|
||||
export default app satisfies Fetchable;
|
||||
|
||||
@@ -51,7 +51,11 @@ export const executeAgentOsAttempt = async (
|
||||
workspaceKey: input.workspaceKey,
|
||||
}),
|
||||
];
|
||||
const repository = new RepositoryWorkspace();
|
||||
const repository = new RepositoryWorkspace(
|
||||
env.AGENT_WORKSPACE_ROOT,
|
||||
true,
|
||||
env.BUN_EXECUTABLE
|
||||
);
|
||||
const prepared = await repository.prepare({
|
||||
attemptId: input.attemptId,
|
||||
baseBranch: input.baseBranch,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { execFileSync, spawn } from "node:child_process";
|
||||
import { spawn } from "node:child_process";
|
||||
import { createHash } from "node:crypto";
|
||||
import { once } from "node:events";
|
||||
import {
|
||||
@@ -131,13 +131,16 @@ const pathExists = async (target: string): Promise<boolean> => {
|
||||
export class RepositoryWorkspace {
|
||||
readonly #root: string;
|
||||
readonly #installDependencies: boolean;
|
||||
readonly #bunExecutable: string;
|
||||
|
||||
constructor(
|
||||
root = process.env.AGENT_WORKSPACE_ROOT ?? "/var/lib/zopu/workspaces",
|
||||
installDependencies = true
|
||||
root = "/srv/zopu/workspaces",
|
||||
installDependencies = true,
|
||||
bunExecutable = "bun"
|
||||
) {
|
||||
this.#root = root;
|
||||
this.#installDependencies = installDependencies;
|
||||
this.#bunExecutable = bunExecutable;
|
||||
}
|
||||
|
||||
async prepare(input: PrepareRepositoryInput): Promise<PreparedRepository> {
|
||||
@@ -201,9 +204,7 @@ export class RepositoryWorkspace {
|
||||
"Base branch checkout"
|
||||
);
|
||||
}
|
||||
const bunExecutable =
|
||||
process.env.BUN_EXECUTABLE ??
|
||||
execFileSync("which", ["bun"], { encoding: "utf-8" }).trim();
|
||||
const bunExecutable = this.#bunExecutable;
|
||||
|
||||
if (this.#installDependencies) {
|
||||
requireSuccess(
|
||||
|
||||
Reference in New Issue
Block a user