docs(agent-workflows): note the session_streams tags/flags schema drift#5012
docs(agent-workflows): note the session_streams tags/flags schema drift#5012mmabrouk wants to merge 1 commit into
Conversation
An in-place edit of migration oss000000008 (commit 22d843c) left existing databases without the tags/meta columns that the session_streams ORM and DAO read, so the UI streaming path 500s while batch invoke is fine. Record the exact code-vs-table mismatch and the reconciling-migration fix. Claude-Session: https://claude.ai/code/session_01WSp2LqKrEtXnm2fsPWuQWa
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Review request: docs-only. Confirm the recommended fix is right: a new idempotent forward migration ( |
What
A design note recording a schema drift the big-agents pull left behind: the UI streaming path 500s (
sign HTTP 500) while batch invoke is unaffected.Root cause
Commit
22d843c0aeedited migrationoss000000008_add_session_streams.pyin place after it had already been applied. It renamed thestatusJSONB column totagsand addedmeta. Alembic keys off the revision id, so existing databases never re-run it and keep the old columns.Meanwhile the code reads the new columns:
api/oss/src/dbs/postgres/sessions/streams/dbes.py:21-28mixes inFlagsDBA,TagsDBA,MetaDBA.api/oss/src/dbs/postgres/sessions/streams/dao.py:58,76runsselect(SessionStreamDBE), which expands to a SELECT namingtags/meta.api/oss/src/dbs/postgres/sessions/streams/mappings.py:24,48,62-63read/writestream_dbe.tags.On a stale DB:
column session_streams.tags does not exist-> 500.Recommended fix
A new idempotent forward migration (
oss000000009) thatADD COLUMN IF NOT EXISTS tags JSONB/meta JSON. No-op on fresh DBs, fix on stale ones. Aligning the code instead would drop first-class DTO fields, so not recommended.Full note:
docs/design/agent-workflows/projects/builder-agent-reliability/streaming-schema-drift/README.md.https://claude.ai/code/session_01WSp2LqKrEtXnm2fsPWuQWa