c55d6c61fc
- Add `hasOutOfProcessLiveness: true` to createServerAdapter() so the reaper skips local PID checks and uses the staleness window instead. - Remove the initial onSpawn call and all periodic keepalive onSpawn refreshes that were compensating for the missing flag. - Remove POST_TERMINAL_KEEPALIVE_MS constant and keepaliveTick counter that backed those workarounds. - Cast required: adapter-utils ServerAdapterModule type predates this field. - Bump to 0.1.38. Co-Authored-By: Paperclip <noreply@paperclip.ing>
46 lines
1.5 KiB
TypeScript
46 lines
1.5 KiB
TypeScript
import type { ServerAdapterModule, AdapterSessionManagement } from "@paperclipai/adapter-utils";
|
|
import { type, models, agentConfigurationDoc } from "../index.js";
|
|
import { execute } from "./execute.js";
|
|
import { testEnvironment } from "./test.js";
|
|
import { sessionCodec } from "./session.js";
|
|
import { getConfigSchema } from "./config-schema.js";
|
|
import { listK8sSkills, syncK8sSkills } from "./skills.js";
|
|
import { listK8sModels } from "./models.js";
|
|
|
|
const sessionManagement: AdapterSessionManagement = {
|
|
supportsSessionResume: true,
|
|
nativeContextManagement: "confirmed",
|
|
defaultSessionCompaction: {
|
|
enabled: true,
|
|
maxSessionRuns: 0,
|
|
maxRawInputTokens: 0,
|
|
maxSessionAgeHours: 0,
|
|
},
|
|
};
|
|
|
|
export function createServerAdapter(): ServerAdapterModule {
|
|
return {
|
|
type,
|
|
execute,
|
|
testEnvironment,
|
|
sessionCodec,
|
|
sessionManagement,
|
|
models,
|
|
listModels: listK8sModels,
|
|
listSkills: listK8sSkills,
|
|
syncSkills: syncK8sSkills,
|
|
supportsLocalAgentJwt: true,
|
|
supportsInstructionsBundle: true,
|
|
instructionsPathKey: "instructionsFilePath",
|
|
requiresMaterializedRuntimeSkills: false,
|
|
// Tells the reaper to skip local PID checks and use the staleness-based
|
|
// liveness window instead (adapter spawns K8s Jobs in separate pods).
|
|
// Cast required: adapter-utils ServerAdapterModule type predates this field.
|
|
hasOutOfProcessLiveness: true,
|
|
agentConfigurationDoc,
|
|
getConfigSchema,
|
|
} as ServerAdapterModule;
|
|
}
|
|
|
|
export { execute, testEnvironment, sessionCodec };
|