fix: memory scope_id column overflow and API read mismatch
AgentRuntime writes scope_id as {user_id}:{agent_id} (73 chars) but:
- DB columns were CHAR(36)/VARCHAR(36), causing Data too long errors
- Memory API queried with agent_id only, returning empty results
- Add _mem_scope() helper to build correct scope_id format
- Update all CRUD queries in agent_memory.py to use _mem_scope()
- Enhance login failure logging in auth.py
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -140,7 +140,9 @@ async def login(
|
||||
user = db.query(User).filter(User.username == form_data.username).first()
|
||||
|
||||
if not user or not verify_password(form_data.password, user.password_hash):
|
||||
logger.warning(f"登录失败: 用户名 {form_data.username}")
|
||||
logger.warning(f"登录失败: 用户名 {form_data.username}, user_found={user is not None}, pwd_len={len(form_data.password)}")
|
||||
if user:
|
||||
logger.warning(f" DB hash prefix: {user.password_hash[:30]}...")
|
||||
raise UnauthorizedError("用户名或密码错误")
|
||||
|
||||
from datetime import timedelta
|
||||
|
||||
Reference in New Issue
Block a user