Skip to content

fix: return not found for unknown page conversations - #14

Merged
jerelvelarde merged 1 commit into
CopilotKit:mainfrom
charan-rathore:fix-page-conversation-404
Oct 5, 2026
Merged

jerelvelarde merged 1 commit into
CopilotKit:mainfrom
charan-rathore:fix-page-conversation-404

Conversation

@charan-rathore

Copy link
Copy Markdown
Contributor

What this fixes

On the page routes, asking for a conversation id that does not exist (or belongs to someone else) returned a generic 503 telling the user to check the Intelligence setup. That points at the wrong thing: the caller used a bad conversation id.

Changes

  • The exact conversation-owner lookup error on page routes now returns 404.
  • Real Intelligence errors still return the generic 503, and the response text does not leak more than before.
  • It does not turn other errors into client errors.

Tests

Four endpoint regression tests (they fail on the base commit), including one that checks genuine Intelligence errors stay 503.

Results below are from the person who prepared the change; I did not rerun them. Full suite: 34 files, 161 tests pass. Lint, typecheck, format check and production build pass (the build prints a chunk size warning that was already there). No UI or dependency changes.

Note

This touches src/server/page-routes.ts and tests/page-routes.test.ts. Open PR #11 changes workspace-routes.ts and also adds a test to tests/page-routes.test.ts, so whichever lands second may need a small rebase on the test file. The code changes do not overlap.

@NathanTarbert NathanTarbert left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @charan-rathore, this is nicely scoped. Matching only the "does not belong" message keeps everything else, including real Intelligence failures, on the generic 503, and the test pins that down. Answering with 404 rather than 403 also means the route doesn't confirm that someone else's conversation exists, which is the right call.

One thing worth knowing for later. The same message from requireThread still comes back as 503 on the workspace routes, because it matches the Conversation prefix in that handler. So after this, an unknown conversation is a 404 on page routes and a 503 on workspace routes. That doesn't need to change here. It fits with the direction in #11 and #28, and could be a small follow-up so both agree.

Looks good to me.

@charan-rathore

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Agreed that the workspace routes should answer the same way. I will leave that out of this PR and look at it as a separate change once the direction in #11 and #28 is clear.

@jerelvelarde jerelvelarde left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useful API behavior fix: missing or inaccessible conversations return the same safe 404 response, while unrelated upstream failures remain generic 503 responses. Fits the existing ownership boundary and preserves current page receipt behavior. Route tests cover missing/foreign conversations and withholding upstream error details. No actionable findings. Individual checks pass; combined tree passes 233 tests, type checking, lint, formatting, and production build.

@jerelvelarde
jerelvelarde merged commit 9651689 into CopilotKit:main Oct 5, 2026
1 check passed
@charan-rathore
charan-rathore deleted the fix-page-conversation-404 branch October 5, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants