Repository navigation
Scope nested artifact GET/DELETE to the path conversation - #332
Merged
Merged
Conversation
GET/DELETE /v1/conversations/:cid/artifacts/:aid (and /raw) looked up by tenant+id only, so a sibling-thread or TUI-origin id succeeded. Lookups and delete now take an optional conversation_id; nested routes also 404 missing/TUI conversations like list/create. Tenant-wide /v1/artifacts/:aid is unchanged. Co-authored-by: Tyler Reckart <tylerreckart@users.noreply.github.com>
This was referenced Sep 13, 2026
tylerreckart
marked this pull request as ready for review
September 21, 2026 13:23
…id-scope # Conflicts: # CHANGELOG.md
tylerreckart
enabled auto-merge (squash)
September 21, 2026 13:23
Keep both Unreleased changelog entries. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_e2886bd4-48a5-4832-9d57-74b089a2b443) |
Keep both Unreleased changelog entries. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep both Unreleased changelog entries. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
GET/DELETE/v1/conversations/:cid/artifacts/:aid(and/raw) looked up by(tenant_id, artifact_id)only.:cidwas parsed and unused. Same-tenant callers could read or delete another conversation's blob (or a TUI-origin thread's blob) by guessing the numeric id. List and create on the same prefix already require an HTTP-visible conversation; the documented contract for the item routes is 404 unless the id exists for that tenant+conversation pair. Agent/readalready enforced conversation scope.Tenant-wide
/v1/artifacts/:aidis intentionally tenant-scoped and is unchanged.Fix
get_artifact_meta,get_artifact_content, anddelete_artifacttake an optionalconversation_id. When it is> 0, the SQL (and delete's pre-check) require that conversation so a mismatched:cidcannot nullify memory links or drop a sibling row. Nested HTTP handlers pass:cidand 404 missing/TUI conversations like list/create.Tests
unit_artifacts— matching conversation_id still reads/deletes; sibling conversation_id is a miss; mismatched delete is a no-op (row and memoryartifact_idstay); tenant-wide (conversation_id == 0) still works.Independently mergeable against
main. Code hunks auto-merge with #321–#331 (tenant_storeartifact methods / nested artifact router are far from A2A,EntryFilter, and conversation list). CHANGELOG[Unreleased]will need a rebase after whichever sibling merges first.Note
Medium Risk
Closes cross-conversation artifact read/delete within a tenant (authorization-scoped data); behavior change for clients that relied on mismatched
:cid, but matches documented API.Overview
Fixes a tenant-internal isolation gap: nested
GET/DELETE/v1/conversations/:cid/artifacts/:aid(and/raw) previously ignored:cidand keyed only on(tenant_id, artifact_id), so callers could read or delete another thread’s blob by id. List/create on the same prefix already required an HTTP-visible conversation; this change aligns item routes with that contract.Store + HTTP:
get_artifact_meta,get_artifact_content, anddelete_artifacttake an optionalconversation_id; when it is> 0, SQL (and delete’s pre-check) require the row to belong to that conversation. Mismatched delete is a no-op so memoryartifact_idlinks on sibling rows are not cleared. Nested handlers pass:cid, return404with"conversation not found"for missing or TUI-origin conversations, and"artifact not found"when the id is wrong for that pair. Tenant-wide/v1/artifacts/:aidstays unchanged (conversation_id == 0).Docs failure-mode tables and CHANGELOG
[Unreleased]note the split 404s;unit_artifactsadds coverage for scoped read/delete vs tenant-wide behavior.Reviewed by Cursor Bugbot for commit 09d8d63. Bugbot is set up for automated code reviews on this repo. Configure here.