Skip to content

fix(chat): conceal a missing deployment the way an unreachable one is - #7100

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/chat-notfound-concealment
Aug 26, 2026
Merged

fix(chat): conceal a missing deployment the way an unreachable one is#7100
waleedlatif1 merged 1 commit into
stagingfrom
fix/chat-notfound-concealment

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

From the v0.8.12 release review (#7090). The internal chat error policy documents that a missing deployment and one in an unreachable workspace "must stay indistinguishable" — and they were not.

  • The policy rewrites a cross-tenant authorization failure to Chat not found or access denied, but the domain answers an absent deployment with its own Chat deployment not found, which the projection passed straight through. Two 404s a caller can tell apart is exactly the existence oracle the concealment exists to close.
  • The legacy code is derived from the message (legacyCode), so the difference leaked on both the error and code fields.
  • Every not_found reachable through this policy means the same thing — the deployment is not available to this caller — so all of them now render as the concealed message. None of the alternatives (context.ts, update-chat-deployment.ts, the two undeploy paths) carries a distinction worth preserving at the cost of the one they must not make.

Type of Change

  • Bug fix

Testing

  • The two existing 404 tests asserted only response.status, which is how the bodies drifted apart unnoticed. The new test compares the two responses directly and asserts the concealed wording; it goes red against the unfixed policy.
  • Full apps/sim suite green: 34,539 tests.
  • bun run lint, all 33 audits (check:audits), and type-check pass.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

The internal chat error policy rewrites a cross-tenant authorization failure
to `Chat not found or access denied`, and says in its own doc that a missing
deployment and an unreachable one must stay indistinguishable. The domain
answers an absent deployment with its own wording, though, and the policy
passed that through — so the editor received `Chat deployment not found` for a
deployment that is not there and `Chat not found or access denied` for one it
may not reach. Two 404s a caller can tell apart is the existence oracle the
concealment exists to close, and because the legacy `code` is derived from the
message, it leaked on both fields.

Every `not_found` reachable through this policy means the same thing, so the
projection now renders all of them as the concealed message.

The two existing 404 tests asserted only the status, which is how the bodies
drifted apart unnoticed; the new one compares the two responses.
@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 26, 2026 4:13am

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR closes an existence oracle in internal chat deployment routes by giving missing and unauthorized deployments the same response body and legacy error code.

  • Normalizes every classified internal-chat not_found response to Chat not found or access denied.
  • Adds a regression test comparing missing and unreachable deployment responses directly.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness or security issues identified.

The policy consistently conceals all internal chat deployment not-found outcomes, and the regression test exercises both missing and unauthorized paths through the same response projection.

Important Files Changed

Filename Overview
apps/sim/app/api/chat/error-policy.ts Normalizes classified not-found errors before producing both the message and message-derived legacy code.
apps/sim/app/api/chat/manage/[id]/route.test.ts Adds coverage proving missing and unauthorized deployments produce identical concealed 404 responses.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Internal chat request] --> B{Deployment available to caller?}
  B -->|Missing| C[Classified not_found]
  B -->|Unauthorized workspace| C
  C --> D[Concealed message]
  D --> E[Identical 404 error and legacy code]
Loading

Reviews (1): Last reviewed commit: "fix(chat): conceal a missing deployment ..." | Re-trigger Greptile

@waleedlatif1
waleedlatif1 merged commit 93da5d1 into staging Aug 26, 2026
30 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/chat-notfound-concealment branch August 26, 2026 04:33
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.

1 participant