feat: wire real AgentOS execution
This commit is contained in:
@@ -31,7 +31,6 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@agentos-software/codex": "0.2.7",
|
||||
"@agentos-software/codex-cli": "0.3.4",
|
||||
"@agentos-software/git": "0.3.3",
|
||||
"@rivet-dev/agentos": "catalog:",
|
||||
"effect": "catalog:"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable max-classes-per-file -- the AgentOS service and its tagged error form one adapter contract. */
|
||||
import codex from "@agentos-software/codex-cli";
|
||||
import codex from "@agentos-software/codex";
|
||||
import { agentOS as createAgentOsActor } from "@rivet-dev/agentos";
|
||||
import type { AgentOSConfigInput } from "@rivet-dev/agentos";
|
||||
import { Context, Effect, Layer, Schema } from "effect";
|
||||
@@ -99,6 +99,7 @@ export const codexSessionEnv = (
|
||||
model: CodexModelEnv,
|
||||
extra: Readonly<Record<string, string>> = {}
|
||||
): Record<string, string> => ({
|
||||
CODEX_MODEL: model.model,
|
||||
OPENAI_API_KEY: model.apiKey,
|
||||
OPENAI_BASE_URL: model.baseUrl,
|
||||
...extra,
|
||||
|
||||
@@ -121,6 +121,16 @@ export class WorkAttemptExecutionError extends Schema.TaggedErrorClass<WorkAttem
|
||||
}
|
||||
) {}
|
||||
|
||||
export const WorkAttemptExecutionFailure = Schema.Struct({
|
||||
error: Schema.Struct({
|
||||
message: Text,
|
||||
reason: WorkAttemptExecutionErrorReason,
|
||||
retryable: Schema.Boolean,
|
||||
}),
|
||||
});
|
||||
export type WorkAttemptExecutionFailure =
|
||||
typeof WorkAttemptExecutionFailure.Type;
|
||||
|
||||
const invalidInput = (message: string) =>
|
||||
new WorkAttemptExecutionError({
|
||||
message,
|
||||
@@ -143,6 +153,11 @@ export const decodeWorkAttemptExecutionResult = (input: unknown) =>
|
||||
Effect.mapError((cause) => invalidInput(cause.message))
|
||||
);
|
||||
|
||||
export const decodeWorkAttemptExecutionFailure = (input: unknown) =>
|
||||
Schema.decodeUnknownEffect(WorkAttemptExecutionFailure)(input).pipe(
|
||||
Effect.mapError((cause) => invalidInput(cause.message))
|
||||
);
|
||||
|
||||
export interface SandboxRuntime {
|
||||
readonly name: string;
|
||||
readonly execute: (
|
||||
@@ -150,6 +165,7 @@ export interface SandboxRuntime {
|
||||
signal?: AbortSignal
|
||||
) => Effect.Effect<WorkAttemptExecutionResult, WorkAttemptExecutionError>;
|
||||
readonly cancel: (
|
||||
workspaceKey: string
|
||||
workspaceKey: string,
|
||||
attemptId: string
|
||||
) => Effect.Effect<void, WorkAttemptExecutionError>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user