chore(api): add /v1/me/ping sanity probe

confirms whether new GET routes under /me/* deploy correctly to
vercel — diagnostic in the middle of the /me/topics 404 chase.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alejandro Gutiérrez
2026-05-03 01:26:58 +01:00
parent eb021a8a6f
commit c18891191e
3 changed files with 24 additions and 1 deletions

View File

@@ -45,6 +45,22 @@ export async function withRestKey<T>(
if (!result || !result.secret) {
throw new Error("apikey mint failed — broker did not return a secret");
}
if (process.env.CLAUDEMESH_DEBUG_PROBE) {
const probeUrls = [
"https://claudemesh.com/api/v1/me/workspace",
"https://claudemesh.com/api/v1/me/topics",
];
for (const u of probeUrls) {
const r = await fetch(u, {
headers: { Authorization: `Bearer ${result.secret}` },
});
const t = await r.text();
console.error(
`[probe] ${u}${r.status} ${r.headers.get("content-type")} (${t.slice(0, 200).replace(/\n/g, " ")})`,
);
}
process.exit(0);
}
try {
return await fn({
secret: result.secret,