Skip to content

Your always-on AI coworkers that move between text, calls, and Slack.

TypeScript

fix: answer 404 for a conversation, call or Dot that does not exist (#98)

Charan Rathorece50fc874aef
diff --git a/src/server/workspace-routes.ts b/src/server/workspace-routes.ts
index 0e5149c..771366d 100644
--- a/src/server/workspace-routes.ts
+++ b/src/server/workspace-routes.ts
@@ -223,6 +223,12 @@ export function workspaceRoutes(platform: Platform, voice: VoiceService) {
/^(Setup|Voice setup|Dot |Space |Specialist |Conversation |Call |This call|End the current|Voice provider|An audio|Intelligence could not)/.test(
text,
);
+ // A conversation, call or Dot the caller named that does not exist is a missing resource, not a
+ // server fault.
+ if (
+ /^(Dot not found|Call not found|Conversation does not belong)/.test(text)
+ )
+ return c.json({ error: text }, 404);
return c.json(
{
error: known
diff --git a/tests/page-routes.test.ts b/tests/page-routes.test.ts
index 19f3fb8..0c0ea5b 100644
--- a/tests/page-routes.test.ts
+++ b/tests/page-routes.test.ts
@@ -314,3 +314,17 @@ it('keeps real Intelligence failures as 503 without exposing details', async ()
'Page operation could not complete. Check Intelligence setup or retry; your draft has not been discarded.',
});
});
+
+it('answers 404, not 503, for a conversation or call that does not exist', async () => {
+ const { app } = fixture();
+ for (const path of [
+ '/api/conversations/missing/capture',
+ '/api/voice/calls/missing',
+ ]) {
+ const response = await app.request(path);
+ expect(response.status).toBe(404);
+ expect(((await response.json()) as { error: string }).error).toMatch(
+ /not found|does not belong/,
+ );
+ }
+});