Repository navigation
fix: qualify created_at in the PostgreSQL conversation upsert - #481
Merged
maralbahari merged 1 commit intoOct 26, 2026
Merged
Conversation
conversation::get_or_create ran `ON CONFLICT (id) DO UPDATE SET created_at = created_at`. PostgreSQL rejects the unqualified column as ambiguous with EXCLUDED.created_at (42702), so every stored conversation turn returned 500 on PostgreSQL. SQLite accepts it. Qualify it as conversations.created_at and add a PostgreSQL test that creates a conversation, stores a turn, and gets it again unchanged. Fixes vllm-project#479 Signed-off-by: Zheng Lu <[email protected]>
Zheng-Lu
requested review from
bbrowning,
franciscojavierarceo,
haoshan98,
jiahuei,
leseb,
maralbahari,
noobHappylife,
qandrew and
tjtanaa
as code owners
October 23, 2026 19:05
maralbahari
approved these changes
Oct 26, 2026
maralbahari
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the fix!
haoshan98
added a commit
to EmbeddedLLM/agentic-api
that referenced
this pull request
Oct 27, 2026
Brings in vllm-project#480 (ARCHITECTURE.md request admission and rate limiting), vllm-project#481 (PostgreSQL conversation upsert), vllm-project#467 (prompt cache breakpoints on inlined text files), vllm-project#478 (benchmark session sweep) and vllm-project#487 (test alignment with typed Responses validation). Merged without conflicts. Signed-off-by: haoshan98 <[email protected]>
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.
Summary
Fixes #479.
On PostgreSQL, every stored conversation turn returned 500 before inference ran. The turn calls
conversation::get_or_create, whose upsert ends inON CONFLICT (id) DO UPDATE SET created_at = created_at. In that clause an unqualifiedcreated_atcould mean the existing row orEXCLUDED, so PostgreSQL rejects the statement as ambiguous (SQLSTATE 42702). SQLite accepts it.The update now reads
SET created_at = conversations.created_at. It is still a no-op whose only job is to makeRETURNINGyield the existing row.DO NOTHINGwould not work here, because it returns no row on conflict. This is the onlyON CONFLICTin production code.CI's
postgresjob already runspostgres_storage_integration, so the new test runs there without any workflow change.Test Plan
postgres_get_or_create_creates_then_returns_the_existing_conversationinpostgres_storage_integration.rs:get_or_createcreates the conversation, and a turn is persisted into it.created_at.latest_response_id) and its item are unchanged.postgres:17-alpine: the first call fails with42702 column reference "created_at" is ambiguous.postgres:17-alpine:storage::schema::tests::(3);postgres_storage_integration(6, including the new test);postgres_tenant_isolation_test(6).POST /v1/responsesturn withconversationreturned this 500. With the same one-line change, the turn and that PR's conversation listing test passed.test_conversation_get_or_create_same_idstill passes.cargo fmt -- --check,cargo clippy --workspace --all-targets -- -D warnings, the Rust file-size ratchet andpre-commit run --all-filesare clean.cargo test --workspace --no-fail-fast: 111 test binaries ran, with 2719 tests passing and 1 failing. The failure istool::web_fetch::http::tests::the_deadline_bounds_a_slow_origin, a wall-clock bound in code this PR doesn't touch. It also fails onmainon my machine when the whole suite runs in parallel, and it passes 3 of 3 runs in isolation.