Repository navigation
[CTX-1340] fix(ui): charge retained strings including click-arg keys (#2227) - #2229
Merged
Merged
Conversation
Charge Text bytes, theme tokens, command identifiers, argument keys, and string argument values against the existing 2 MiB SCN-4 aggregate, and cap argument keys at the existing 64-byte command-identifier bound. The 320 KiB envelope, the 2 MiB number, and the E_UI_BLOCK_BUDGET code/class are unchanged.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Xuepoo
commented
Oct 18, 2026
Xuepoo
left a comment
Contributor
Author
There was a problem hiding this comment.
Independent review verdict (separate agent, guard cron hermes-planner).
Verdict: APPROVE.
Checks performed:
git show 14f47f3e --stat+ full diff;gh pr diff 2229- Confirmed
UiNode::retained_string_bytes()recursion is bounded byUI_MAX_NODES; per-string by existing caps;saturating_add/subthroughout; no new numeric ceiling (UI_CLICK_MAX_ARG_KEY_BYTES = UI_CLICK_MAX_COMMAND_BYTES). - Field rename
aggregated_text_bytes -> aggregated_retained_bytesconsistent acrossclear/mount/update/drop; update atomic (subtract-then-add, compare before mutate). - Tests present: unit test in
ui.rs(identifiers charged,text_bytes()stays text-only), service tests (aggregated_retained_budget_counts_every_string, key-only >2 MiB fails closed, rejected update/mount leave registry intact), bridge integration test for 64/65-byte key boundary.
Only a non-blocking doc nit. CI green on head 14f47f3. Merge gate satisfied (comment-LGTM + green CI).
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.
Priority: P2 | Area: area:security | Labels: fix,P2,area:security | Milestone: v0.1.0 | RFC: isolation/resource RC limits | Task: CTX-1340
Closes #2227
What
The plugin UI budget counted only
Textleaf bytes, leaving command identifiers,ClickCommand.argskeys, string values, and tokens bounded only by the 320 KiB envelope. This charges every retained string against the existing 2 MiB aggregate.Changes
bitty-lua/src/ui.rs:UiNode::retained_string_bytes,ClickCommand::retained_string_bytes, argument-key cap (UI_CLICK_MAX_ARG_KEY_BYTES = UI_CLICK_MAX_COMMAND_BYTES, no new numeric ceiling), validation, tests.plugin_runtime/services.rs: mount/update/remove charge retained bytes; rejected update leaves the previous block and aggregate intact; diagnostic names the dimension.tests/plugin_ui.rs: bridge-level key-cap test.Contracts unchanged
2 MiB aggregate, 320 KiB marshal envelope,
E_UI_BLOCK_BUDGETcode/class, SCN-3/SCN-5. Only the aggregate diagnostic text differs. Error-vocabulary stability remains a cross-repo item (bitty-plugin-sdk#154).Verification
-D warnings(bitty-lua/bitty-runtime, all targets), Windows GNU all-targets: passcargo nextest run -p bitty-lua -p bitty-runtime --locked: 2,787 passed, 1 skippedkey.len() * 0makes the large-key test fail; reverted and re-run greene1f6920d