mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-18 18:04:45 +00:00
fix(mantis): validate telegram driver before lease
This commit is contained in:
@@ -51,7 +51,7 @@ describe("Mantis Telegram Desktop proof workflow", () => {
|
||||
|
||||
const agent = workflowStep("Run Codex Mantis Telegram agent");
|
||||
expect(agent.env?.OPENCLAW_TELEGRAM_USER_DRIVER_SCRIPT).toBe(
|
||||
"scripts/e2e/telegram-user-driver.py",
|
||||
"${{ github.workspace }}/scripts/e2e/telegram-user-driver.py",
|
||||
);
|
||||
expect(agent.env?.OPENCLAW_TELEGRAM_USER_CRABBOX_BIN).toBe("/usr/local/bin/crabbox");
|
||||
expect(agent.env?.CRABBOX_COORDINATOR).toContain(
|
||||
@@ -66,4 +66,24 @@ describe("Mantis Telegram Desktop proof workflow", () => {
|
||||
"OPENCLAW_TELEGRAM_USER_CRABBOX_BIN OPENCLAW_TELEGRAM_USER_CRABBOX_PROVIDER OPENCLAW_TELEGRAM_USER_DRIVER_SCRIPT",
|
||||
);
|
||||
});
|
||||
|
||||
it("checks the Telegram user driver before leasing credentials", () => {
|
||||
const proofScript = readFileSync(PROOF_SCRIPT, "utf8");
|
||||
const startSession = proofScript.slice(
|
||||
proofScript.indexOf("async function startSession"),
|
||||
proofScript.indexOf("async function sendSessionProbe"),
|
||||
);
|
||||
const defaultProof = proofScript.slice(proofScript.indexOf("async function main"));
|
||||
|
||||
expect(startSession).toContain("requireUserDriverScript(opts);");
|
||||
expect(startSession).toContain("leaseCredential({ localRoot, opts, root })");
|
||||
expect(defaultProof).toContain("requireUserDriverScript(opts);");
|
||||
expect(defaultProof).toContain("leaseCredential({ localRoot, opts, root })");
|
||||
expect(startSession.indexOf("requireUserDriverScript(opts);")).toBeLessThan(
|
||||
startSession.indexOf("leaseCredential({ localRoot, opts, root })"),
|
||||
);
|
||||
expect(defaultProof.indexOf("requireUserDriverScript(opts);")).toBeLessThan(
|
||||
defaultProof.indexOf("leaseCredential({ localRoot, opts, root })"),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user