feat(agent): Agent Files / agent Cloud storage — api backend (ENG-589) (#37172)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
zyssyz123
2026-06-09 04:01:05 +00:00
committed by GitHub
co-authored by Claude Opus 4.8 autofix-ci[bot]
parent 789698cddd
commit a80bba2c35
40 changed files with 2730 additions and 166 deletions
@@ -0,0 +1,45 @@
"""add agent_drive_files (agent drive KV)
Revision ID: 7bad07dc267d
Revises: 3df4dbcc1e21
Create Date: 2026-06-08 13:39:15.150738
"""
from alembic import op
import models as models
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7bad07dc267d'
down_revision = '3df4dbcc1e21'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
'agent_drive_files',
sa.Column('tenant_id', models.types.StringUUID(), nullable=False),
sa.Column('agent_id', models.types.StringUUID(), nullable=False),
sa.Column('key', sa.String(length=512), nullable=False),
sa.Column('file_kind', sa.String(length=32), nullable=False),
sa.Column('file_id', models.types.StringUUID(), nullable=False),
sa.Column('value_owned_by_drive', sa.Boolean(), server_default=sa.text('false'), nullable=False),
sa.Column('size', sa.BigInteger(), nullable=True),
sa.Column('hash', sa.String(length=255), nullable=True),
sa.Column('mime_type', sa.String(length=255), nullable=True),
sa.Column('created_by', models.types.StringUUID(), nullable=True),
sa.Column('id', models.types.StringUUID(), nullable=False),
sa.Column('created_at', sa.DateTime(), server_default=sa.text('CURRENT_TIMESTAMP'), nullable=False),
sa.Column('updated_at', sa.DateTime(), server_default=sa.text('CURRENT_TIMESTAMP'), nullable=False),
sa.PrimaryKeyConstraint('id', name='agent_drive_file_pkey'),
sa.UniqueConstraint('tenant_id', 'agent_id', 'key', name='agent_drive_file_scope_key_unique'),
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('agent_drive_files')
# ### end Alembic commands ###