Skip to content

[codex] fix raw object key idempotency - #4

Closed
sarthakagrawal927 wants to merge 1 commit into
mainfrom
codex/raw-object-key-idempotency
Closed

[codex] fix raw object key idempotency#4
sarthakagrawal927 wants to merge 1 commit into
mainfrom
codex/raw-object-key-idempotency

Conversation

@sarthakagrawal927

Copy link
Copy Markdown
Member

What changed

  • Made raw upload object keys content-hash based instead of filename-based.
  • Added a regression test that uploads the same bytes under two filenames and asserts the same object key is reused.

Why

  • The file table is already deduped by (project, domain, content_hash), but the object-store path still encoded the filename.
  • That meant the same bytes uploaded under a different filename could create a second blob and orphan the first one, which breaks the claimed content-hash idempotency.

Validation

  • uv run pytest -q tests/test_objects.py
  • uv run ruff check src/kb/storage/objects.py tests/test_objects.py

@sarthakagrawal927

Copy link
Copy Markdown
Member Author

Superseded by #5 which includes all changes from this PR (content-hash keying) plus the path-traversal safety guard and pgvector parent_id fix.

@sarthakagrawal927
sarthakagrawal927 deleted the codex/raw-object-key-idempotency branch June 19, 2026 06:57
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