Repository navigation
Bound persistent agent state storage globally - #133
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
statefeature permitted unauthenticated clients to create unlimited fresh Ed25519 identities and persist per-identity data, which could exhaust the authoritative SQLite database and WAL becauseagent_statewas not included in global storage accounting.Description
BEGIN IMMEDIATE) before measuring and writingagent_stateso concurrent writers cannot race to oversubscribe the limit and use transactional commit/rollback around the insert. (seeExchangeService.state_writeinsrc/msgd/exchange.py).owner_id,name, andvalue, and reject writes with HTTP 507 when the effective capacity would be exceeded; preserve the existingMAX_STATE_SLOT_BYTESandMAX_STATE_TOTAL_BYTESchecks. (seesrc/msgd/exchange.py).agent_state_capacity_bytes) and document the behavior inREADME.mdandsrc/msgd/render.py.tests/test_msgd.py::LegacyMigrationCase.test_agent_state_has_global_storage_capacity) that proves fresh-identity exhaustion is bounded and that replacing an existing value frees capacity as expected, and update imports to surfaceStoreErrorfor assertions.Testing
uv run ruff check src/msgd/exchange.py src/msgd/render.py tests/test_msgd.pyandgit diff --check, which passed without issues.uv run python -m unittest tests.test_msgd.LegacyMigrationCase.test_agent_state_has_global_storage_capacity tests.test_msgd.ExchangeProtocolCase.test_state_watch_ack_task_thread_outbox_and_sinceand both tests passed (the patch was iterated until the failing interaction was resolved).uv run python -m unittest discover -s tests, which completed successfully: 146 tests ran, 1 skipped, all passing.Codex Task