feat(agent): add redis short-term user context cache and align tests

This commit is contained in:
qzl
2026-03-06 12:02:10 +08:00
parent fb8f21bcf3
commit c5ccfc4b88
34 changed files with 2073 additions and 263 deletions
-8
View File
@@ -38,10 +38,6 @@ class FakeUserService:
bio=update.bio if update.bio is not None else self._user.bio,
)
async def get_by_username(self, username: str) -> UserResponse:
return self._user
def _find_free_port() -> int:
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
sock.bind(("127.0.0.1", 0))
@@ -99,10 +95,6 @@ def test_profile_flow_e2e() -> None:
)
assert updated.status == 200
assert updated.json()["username"] == "updated"
public = request_context.get("/api/v1/users/demo")
assert public.status == 200
assert public.json()["username"] == "demo"
finally:
request_context.dispose()
finally: