Repository navigation
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: the central Discord code-fence fix is covered by the open replacement at #90648, while this branch still changes tilde-run mention behavior and lacks after-fix real behavior proof. Canonical path: Use the proof-backed replacement PR at #90648 as the landing path for the Discord mention code-fence fix. So I’m closing this here and keeping the remaining discussion on #90648. Review detailsBest possible solution: Use the proof-backed replacement PR at #90648 as the landing path for the Discord mention code-fence fix. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection and the linked issue show the current regex can mis-handle a triple-backtick literal inside a fenced code block, and this branch's tilde handling creates a clear source-level regression path for Is this the best way to solve the issue? No. The scanner approach is plausible for the backtick bug, but this branch is not the best landing path because it broadens the skipped syntax to tilde fences; the replacement PR keeps the fix scoped to Discord-rendered backtick code segments and has proof. Security review: Security review cleared: The diff changes Discord mention parsing and tests only; I found no new dependency, credential, workflow, package, or code-execution surface. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against b8adc11977ab. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1c293d4e62
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| let nextLineStart = findLineEnd(text, index); | ||
| if (nextLineStart < text.length) { | ||
| nextLineStart += 1; |
There was a problem hiding this comment.
Preserve mentions after same-line code blocks
If a Discord message starts with a one-line triple-backtick block such as ```@alice``` outside @bob, the closing backticks are on the opener line. This starts the closer search on the next line, and the fallback below treats the opener as an unterminated fence through EOF, so mentionAliases after the closing backticks are left as plain text and the intended Discord ping is never sent. The previous regex only preserved the same-line code span and still rewrote the suffix; check same-line triple-backtick closers before falling back to an EOF segment.
Useful? React with 👍 / 👎.
|
I think this still has a nearby behavior regression in the mention-alias path. Current stops being rewritten to I pushed #90648 with the same #90643 fix but scoped to Discord-rendered backtick code segments, plus a regression for this case: expect(rewriteDiscordKnownMentions("~~~\n@alice\n~~~", { accountId: "default" }))
.toBe("~~~\n<@123456789>\n~~~");That keeps the filed repro fixed while preserving the existing plain-text alias behavior for tilde runs. |
|
Closing as superseded by #90648, which keeps the Discord mention code-fence fix scoped to backtick code segments and carries the proof-backed regression coverage. This branch has no unique remaining landing path. |
Summary
Fixes #90643
Tests
Note
node_modules/.bin/tsc -p extensions/discord/tsconfig.json --noEmit --pretty falsecurrently fails on pre-existing Discord/plugin-sdk type drift unrelated to this patch.