Repository navigation
test(selection): make the held-buffer terminal cases survive a stale swap file and catch an overflow - #496
Conversation
…nal name, check v:errmsg when a demotion is pending The three real-Neovim cases that rename a buffer to the fixed name term://x//1:claude failed with E325 when a swap file with that name was left behind (a Neovim that a timeout killed, or a HOME that concurrent runs share). The buffer now gets no swap file before the rename. The case with a pending demotion did not check v:errmsg, so it passed on code that overflows the stack there. It asserts that v:errmsg stays empty, as the first case does. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-sonnet-5-5` • Thinking: `xhigh`_
|
@codex review |
|
@codex security review |
Codex Review Summary: ✅ CompletedThis 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. |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Two gaps in the real-Neovim cases of #493
#493 added three cases to
tests/integration/selection_held_spec.luathat make a buffer look like the Claude terminal. The verifier of #493 found two gaps in them. Both are in the test only. Nolua/code changes.term://x//1:claude. Neovim opens a swap file under the new name at the rename. If a Neovim that a timeout killed left a swap file with that name, or if concurrent runs share oneHOME, the rename raisesE325: ATTENTIONand the case fails for a reason that has nothing to do with the plugin. The new helperrename_to_claude_terminal(buf)setsswapfile = falseon the buffer before the rename, so no swap file exists under that name.v:errmsg. It asserted only that nothing was broadcast, so it passed on code that overflows the stack at that point. It now clearsv:errmsgbefore the edit and asserts that it is still empty afterwards, as the first of the three cases does.Proof
term:%%x%%1:claude.swpin$XDG_STATE_HOME/nvim/swap(left by a Neovim that I killed with SIGKILL after it renamed a modified buffer):main(before this PR), 0.12.3: the three cases fail withE325.selection.luafrom before fix(selection): send no terminal cursor and do not recurse when the held buffer becomes a Claude terminal #493 (5faad5b), the spec of this PR fails 3 cases, including the "demotion is pending" case. The spec frommainfails only the other 2 on that code.mise run format-checkandmise run checkare clean.mise run test: 1396 successes, 0 failures (seed 1794381885).Generated with
xum• Model:anthropic:claude-sonnet-5-5• Thinking:xhigh