feat(agent): persist pending tool call in session snapshot

This commit is contained in:
qzl
2026-03-03 15:39:56 +08:00
parent e03923e593
commit cff1436bc6
3 changed files with 171 additions and 1 deletions
+5 -1
View File
@@ -14,7 +14,7 @@ from sqlalchemy import (
func,
text,
)
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.dialects.postgresql import JSONB, UUID
from sqlalchemy.orm import Mapped, mapped_column
from core.db.base import Base, SoftDeleteMixin, TimestampMixin
@@ -75,3 +75,7 @@ class AgentChatSession(TimestampMixin, SoftDeleteMixin, Base):
total_cost: Mapped[Decimal] = mapped_column(
Numeric(12, 6), nullable=False, server_default=text("0")
)
state_snapshot: Mapped[dict | None] = mapped_column(
JSONB,
nullable=True,
)