chore: remove twilio and expand pi cli detection

This commit is contained in:
Peter Steinberger
2025-12-05 21:13:23 +00:00
parent 5492845659
commit e7a9313135
5 changed files with 45 additions and 11 deletions

26
src/agents/pi.test.ts Normal file
View File

@@ -0,0 +1,26 @@
import { describe, expect, it } from "vitest";
import { piSpec } from "./pi.js";
describe("piSpec.isInvocation", () => {
it("detects pi binary", () => {
expect(piSpec.isInvocation(["/usr/local/bin/pi"])).toBe(true);
});
it("detects tau binary", () => {
expect(piSpec.isInvocation(["/opt/tau"])).toBe(true);
});
it("detects node entry pointing at coding-agent cli", () => {
expect(
piSpec.isInvocation([
"node",
"/Users/me/Projects/pi-mono/packages/coding-agent/dist/cli.js",
]),
).toBe(true);
});
it("rejects unrelated node scripts", () => {
expect(piSpec.isInvocation(["node", "/tmp/script.js"])).toBe(false);
});
});

View File

@@ -141,7 +141,20 @@ export const piSpec: AgentSpec = {
isInvocation: (argv) => {
if (argv.length === 0) return false;
const base = path.basename(argv[0]).replace(/\.(m?js)$/i, "");
return base === "pi" || base === "tau";
if (base === "pi" || base === "tau") return true;
// Also handle node entrypoints like `node /.../pi-mono/packages/coding-agent/dist/cli.js`
if (base === "node" && argv.length > 1) {
const second = argv[1]?.toString().toLowerCase();
return (
second.includes("pi-mono") &&
second.includes("packages") &&
second.includes("coding-agent") &&
(second.endsWith("cli.js") || second.includes("/dist/cli"))
);
}
return false;
},
buildArgs: (ctx) => {
const argv = [...ctx.argv];

View File

@@ -148,11 +148,6 @@ export async function ensureFunnel(
runtime.error(
"Failed to enable Tailscale Funnel. Is it allowed on your tailnet?",
);
runtime.error(
info(
"Tip: you can fall back to polling (no webhooks needed): `pnpm clawdis relay --provider twilio --interval 5 --lookback 10`",
),
);
if (isVerbose()) {
if (stdout.trim()) runtime.error(chalk.gray(`stdout: ${stdout.trim()}`));
if (stderr.trim()) runtime.error(chalk.gray(`stderr: ${stderr.trim()}`));