Let people name accounts and use the names to tell accounts apart

Connections get an account_name (migration 0039) that the owner sets with
PATCH /api/connections/<id>; the account label stays the account's
identity, so signing in again still finds it. When someone has more than
one account of a service, its tools are listed as "Telegram · <account>"
and the model sees each account's actions under the account's name
(telegram_send_message_alerts_bot) with the account in the description,
instead of _1 and _2. Actions shared by different services are named
after the service. Tools a user renamed keep their name.
This commit is contained in:
arc53-machine committed 2026-09-29 10:41:54 +01:00
1 parent 607c2296e3
commit bdcb88866a
11 files changed
+371 -7

No files matched your search

+3
View File
@@ -608,6 +608,9 @@ connector_sessions_table = Table(
Column("scopes", JSONB, nullable=False, server_default="[]"),
Column("last_error", Text),
Column("last_used_at", DateTime(timezone=True)),
# Added in ``0039_connection_account_name``: what the user calls the
# account; ``account_label`` stays its identity.
Column("account_name", Text),
)
@@ -36,7 +36,7 @@ from docsgpt.storage.db.serialization import PGNativeJSONEncoder
_UPDATABLE_SCALARS = {
"server_url", "session_token", "user_email", "status", "expires_at",
"connector_key", "display_name", "account_label", "auth_kind",
"encrypted_credentials", "has_refresh_token", "last_error", "last_used_at",
"encrypted_credentials", "has_refresh_token", "last_error", "last_used_at", "account_name",
}
_UPDATABLE_JSONB = {"session_data", "token_info", "scopes"}