Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(scripts): install offline local credential before first turn

Steven Enamakelce96d416256f
diff --git a/scripts/life-scenarios/run.mjs b/scripts/life-scenarios/run.mjs
index 33c9ad460f..0a46ed46cc 100644
--- a/scripts/life-scenarios/run.mjs
+++ b/scripts/life-scenarios/run.mjs
@@ -550,6 +550,24 @@ async function main() {
});
console.log(`core : ${core.url} (pid ${health.pid}, healthy=${health.healthy})`);
+ // Install the offline local credential before the first turn.
+ const localUserId = `life-scenarios-${runId.slice(0, 10).replace(/-/g, "")}`;
+ await core.rpc("openhuman.auth_set_credential", {
+ token: mintLocalSessionToken(localUserId),
+ kind: "local",
+ userId: localUserId,
+ user: { _id: localUserId, email: "[email protected]", name: "Life Scenarios" },
+ });
+ const authState = await core.rpc("openhuman.auth_get_state", {}).catch(() => null);
+ console.log(
+ `auth : local session installed (${
+ authState ? JSON.stringify(authState).slice(0, 120) : "state unavailable"
+ })`,
+ );
+ console.log(
+ `route : ${opts.managed ? "managed backend" : opts.inferenceUrl} model=${opts.model}`,
+ );
+
const results = [];
try {
// A cheap smoke turn proves the credential and route work before we spend