feat: integrate invite API and improve notification handling

- Add invite code display and binding functionality via API
- Fix notification unread count sync on auth state change
- Improve notification mark read with server state validation
- Add auth state listener to trigger notification refresh
- Add YaoCoinConverter for coin-to-yao type conversion
- Remove YaoLegend from divination screens (UI cleanup)
- Abbreviate relation labels in yao detail view
- Add re-register notice to account delete screen
- Update 'coins' terminology to 'points' in localization
- Fix backend points consumption to only run in CHAT mode
- Add HttpxAuthNoiseFilter to suppress auth endpoint logging
- Fix notification static_schema import path
- Add test coverage for notification bloc error handling
- Update AGENTS.md page header rules and image handling
- Delete deprecated run-dev.sh script
This commit is contained in:
qzl
2026-04-13 14:52:22 +08:00
parent da947f9f08
commit 1e22f27de2
52 changed files with 1419 additions and 307 deletions
+8 -7
View File
@@ -384,13 +384,14 @@ async def run_agentscope_task(command: dict[str, Any]) -> dict[str, object]:
runtime_config=runtime_config,
cancel_checker=_cancel_checker,
)
await points_service.consume_successful_run_points(
user_id=owner_id,
session_id=UUID(thread_id),
run_id=run_id,
operator_id=owner_id,
user_email=owner_email,
)
if runtime_mode == RuntimeMode.CHAT:
await points_service.consume_successful_run_points(
user_id=owner_id,
session_id=UUID(thread_id),
run_id=run_id,
operator_id=owner_id,
user_email=owner_email,
)
await session.commit()
except asyncio.CancelledError:
await points_service.record_failed_run_platform_cost(
@@ -9,7 +9,7 @@ from uuid import UUID
import yaml
from pydantic import BaseModel, ConfigDict, Field, ValidationError, model_validator
from v1.notifications.schemas import (
from backend.src.schemas.shared.notification import (
NotificationPayload,
NotificationPayloadNone,
)
+5 -1
View File
@@ -39,6 +39,7 @@ def build_logging_config(runtime: RuntimeSettings) -> dict[str, object]:
file_path=log_dir / runtime.log_file_name,
level=runtime.log_level,
formatter=formatter_name,
filters=["suppress_httpx_auth_noise"],
)
error_handler = build_file_handler_config(
runtime,
@@ -54,7 +55,10 @@ def build_logging_config(runtime: RuntimeSettings) -> dict[str, object]:
"filters": {
"error_only": {
"()": "core.logging.filters.ErrorLevelFilter",
}
},
"suppress_httpx_auth_noise": {
"()": "core.logging.filters.HttpxAuthNoiseFilter",
},
},
"formatters": {
"json": {
+13
View File
@@ -54,3 +54,16 @@ def build_sensitive_data_processor(
class ErrorLevelFilter(logging.Filter):
def filter(self, record: logging.LogRecord) -> bool:
return record.levelno >= logging.ERROR
class HttpxAuthNoiseFilter(logging.Filter):
_SUPPRESSED_FRAGMENTS = (
"/auth/v1/user",
"/auth/v1/token?grant_type=refresh_token",
)
def filter(self, record: logging.LogRecord) -> bool:
if record.levelno >= logging.WARNING:
return True
message = record.getMessage()
return not any(fragment in message for fragment in self._SUPPRESSED_FRAGMENTS)