fix: memory scope_id column overflow and API read mismatch
Some checks failed
CI/CD Pipeline / Backend — Lint & Test (push) Has been cancelled
CI/CD Pipeline / Frontend — Lint & Build (push) Has been cancelled
CI/CD Pipeline / Docker — Build Check (push) Has been cancelled

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:
2026-07-01 08:05:23 +08:00
parent e33aa6e0b7
commit f1326bff95
3 changed files with 78 additions and 40 deletions

View File

@@ -75,6 +75,39 @@ fun LoginScreen(
// Server URL
if (isEditingUrl) {
// Preset quick-select buttons
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.spacedBy(8.dp)
) {
val isLocalSelected = editedUrl == "http://192.168.31.135:8037"
val isCloudSelected = editedUrl == "http://101.43.95.130:8037"
OutlinedButton(
onClick = { editedUrl = "http://192.168.31.135:8037" },
colors = if (isLocalSelected) {
ButtonDefaults.outlinedButtonColors(
containerColor = MaterialTheme.colorScheme.primaryContainer
)
} else {
ButtonDefaults.outlinedButtonColors()
}
) {
Text("本地")
}
OutlinedButton(
onClick = { editedUrl = "http://101.43.95.130:8037" },
colors = if (isCloudSelected) {
ButtonDefaults.outlinedButtonColors(
containerColor = MaterialTheme.colorScheme.primaryContainer
)
} else {
ButtonDefaults.outlinedButtonColors()
}
) {
Text("云服务")
}
}
Spacer(modifier = Modifier.height(8.dp))
OutlinedTextField(
value = editedUrl,
onValueChange = { editedUrl = it },
@@ -84,7 +117,7 @@ fun LoginScreen(
modifier = Modifier.fillMaxWidth(),
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Next),
enabled = !uiState.isLoading,
supportingText = { Text("输入后点击保存,设置即时生效") }
supportingText = { Text("点击上方快捷选择,或手动输入后保存") }
)
Row(
modifier = Modifier.fillMaxWidth(),