Repository navigation
fix(interpreter): bound recursive prompt expansion - #2671
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 839c036 | Commit Preview URL Branch Preview URL |
Oct 10 2026, 11:40 PM |
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.
Summary
Bounds recursive prompt expansion so the reported self-referential payload can no longer recurse without limit. Root cause: `` re-enters prompt decoding on every cycle (expand_word -> prompt_transformation -> expand_prompt_string -> expand_word) with no depth tracking, so a self-referential value recurses until the native stack overflows and aborts the host process.
Reported vector (default promptvars on):
Changes
ExecutionMode::for_prompt(): prompt path can never enable nested execution.Before / After
resource limit exceeded: maximum prompt expansion depth exceeded (8)); stdout empty; subsequent invocations run normally. 7/7 newprompt_resource_testspass (self/mutual cycles, finite chains, depth boundary ok/rejected, sibling independence, session recovery, shared budget), plus 6 prompt unit, 81 tool/limits, 203 parser tests;cargo fmt --checkandcargo clippy -p bashkit --all-targetsclean.Tests
cargo test -p bashkit --test integration prompt_resource(7 passed)cargo test -p bashkit --lib prompt(6 passed),limits(81 passed),parser(203 passed)Produced by yolop