ba90ad8132
Both the /news discuss button and the briefing discuss button now call a shared seed_article_discussion() helper that stages the synthetic read_article tool exchange and the conversational seed prompt — behavior stays byte-identical across entry points. /news also auto-starts generation so the chat screen lands on an in-flight stream. First assistant reply in a seeded article conversation is persisted as a Note (tags: article-summary + article topics) and backlinked via rss_items.discussion_note_id, so the knowledge base stops being amnesiac about articles the user has engaged with. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
39 lines
799 B
Python
39 lines
799 B
Python
"""Link rss_items to their discussion-summary note.
|
|
|
|
Revision ID: 0039
|
|
Revises: 0038
|
|
Create Date: 2026-04-14
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
revision = "0039"
|
|
down_revision = "0038"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.add_column(
|
|
"rss_items",
|
|
sa.Column("discussion_note_id", sa.BigInteger(), nullable=True),
|
|
)
|
|
op.create_foreign_key(
|
|
"fk_rss_items_discussion_note_id",
|
|
"rss_items",
|
|
"notes",
|
|
["discussion_note_id"],
|
|
["id"],
|
|
ondelete="SET NULL",
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_constraint(
|
|
"fk_rss_items_discussion_note_id", "rss_items", type_="foreignkey"
|
|
)
|
|
op.drop_column("rss_items", "discussion_note_id")
|