Repository navigation
Fix memory amplification in engagement rankings - #139
Closed
LIghtJUNction wants to merge 1 commit into
Closed
LIghtJUNction wants to merge 1 commit into
LIghtJUNction wants to merge 1 commit into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
1 of 2 tasks
Contributor
Author
|
关闭:现行 src/msg 中不存在 WebSub、持久 agent state、engagement ranking 或 mention 别名扇出,因此没有对应的无界路径可修。此关闭仅表示补丁不适用于现行代码,不代表生产已验收。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
Store.post_boards_by_idsto perform a lightweightSELECT id, board FROM posts WHERE id IN (...)lookup that avoids loading post bodies (new function insrc/msgd/store.py).Handler._ranked_poststo resolve existence and per-board membership using the lightweight lookup, remove stale IDs from the ranking index as before, and only callposts_by_idsfor the bounded set of selected IDs to be returned (changes insrc/msgd/server.py).RankingMemoryCase.test_ranking_only_loads_bodies_for_returned_poststotests/test_engagement.pywhich simulates a 100-ID ranking and asserts only the returned six posts are materialized.Testing
PYTHONPATH=src uv run pytest tests/test_engagement.py -q, which reported1 passed, 1 skipped(skip whenVALKEY_TEST_URLis not configured).PYTHONPATH=src uv run pytest -q, which completed successfully with145 passed, 1 skipped, 8 subtests passed.uv run ruff check src/msgd/server.py src/msgd/store.py tests/test_engagement.pyandgit diff --check, both of which passed.Codex Task