GeezerVison is showing github.com — fix(mcpx/recipes): scan comments and strings when finding @name placeholders (#1670) by dezren39 · Pull Request #2957 · developing-today/code
Conversation
dezren39
commented
Oct 31, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Fixes #1670. Queue task 4225 (triage confirmed by task 1871).
What was wrong
refs() and substitute() in pkgs/mcpx/internal/recipes/recipes.go each scanned statelessly, despite the refs() doc promising to ignore comments and strings. An @name in a // comment, /* */ comment, or string literal became a required placeholder (elicitation/422 for a value never used in code), and Render spliced the filled value JSON-encoded inside the string literal, producing a script that does not parse.
Fix
One shared lexical scan, scanCode(), marks every byte of the source as code position or not — line comments, block comments, and single-/double-/backtick-quoted literals with backslash escapes, carried across lines so block comments and template literals span them. refs() only collects @name in code position; substitute() only replaces there. Both keep the pinned behaviours: declaration/@tool lines stay skipped, and the preceding-word-byte rule still keeps [email protected] from reading as a ref.
Known edges, accepted and documented in the scanCode comment rather than parsed around: a regex literal is not told apart from division (a //-shaped regex reads as a comment), and ${...} inside a template literal is treated as string text rather than interpolation.
Tests
- The three probe tests from the mcpx(recipes): an @name in a comment or string becomes a required placeholder — and Render splices its JSON value inside the string, breaking the script #1670 triage are promoted into
recipes_test.go, plus block-comment (single- and multi-line), trailing-comment, single-quoted, escaped-quote and template-literal (single- and multi-line) cases: a mention in any of them yields no placeholder and Render leaves the source byte-identical.
- A code-position
@who beside a string mention of the same name still substitutes — only in code position.
- Failing-first verified on the laptop: the new tests FAIL against the old
recipes.go (string literal rewritten to "ask "hi" first"), PASS with the fix; full go test ./internal/recipes/ -count=1 passes and gofmt is clean. CI is the authority for the wider suite.
![Autofix with [code]smith](/api/image?u=https%3A%2F%2Fcamo.githubusercontent.com%2F33b6f70f3541c4e93f4503d29cbfec051fa1b040d8e0ae9313a51c4ece44a627%2F68747470733a2f2f70722d636f6d6d656e74732d6173736574732e626c61636b736d6974682e73682f636f6465736d6974682f6175746f6669782d776974682d636f6465736d6974682d6461726b2d33782e706e67)
Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
chatgpt-codex-connector[bot] reacted with thumbs up emoji
…holders (#1670)
refs() and substitute() each scanned statelessly, so an @name in a comment or string literal became a required placeholder and Render spliced its JSON value inside the string. Both now share scanCode(), one lexical pass marking code position across line/block comments and single/double/backtick literals with escapes, carried across lines. Probe tests from the #1670 triage are promoted into the suite, plus block-comment, template-literal and escaped-quote cases; failing-first verified against the old implementation.
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-10-31T09:02:22.394702Z |
36107f1 |
Manual request |
ℹ️ 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" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Oct 31, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Warning
Review limit reached
You'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 27 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
91c6a11a-a411-46f7-818d-ec6a464fcc0d
Commits
-
Reviewing files that changed from the base of the PR and between 689e47c and 36107f1.
Files selected for processing: 2
-
pkgs/mcpx/internal/recipes/recipes.go
pkgs/mcpx/internal/recipes/recipes_test.go
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0467822975
ℹ️ 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".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
CRLF line continuation: a backslash on a CRLF line escaped only the CR, so the LF ended the string and the closing quote reopened one; the CRLF is now consumed as one escaped newline in single/double-quoted strings. Declaration lines: refs/Render skipped them but scanCode lexed their prose as script -- a /* in a @PARAM description opened a block comment over the body; the scan now skips decl/tool lines it reaches in code position at a line start (lookalike lines inside comments/strings still count as content). Both covered failing-first (TestACRLFLineContinuationKeepsTheStringOpen, TestADeclarationLineCannotLexTheBody).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0d679e3c0d
ℹ️ 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".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Codex P2 on #2957: scanCode ended a // comment only at LF, but
JavaScript also ends line comments at CR, U+2028 and U+2029 --
code after a standalone CR was lexed as comment text, so its
@name placeholders were never discovered or substituted. The
line-comment state now ends at all four terminators, with a
regression test covering CR, U+2028 and U+2029.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Codex Review: Didn't find any major issues. More of your lovely PRs please.
Reviewed commit: eae11b9783
ℹ️ 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".
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…es-comment-string-scan
# Conflicts:
# pkgs/mcpx/internal/recipes/recipes_test.go
|
@codex review — main merged in (b59dd8c); the single conflict (recipes_test.go append-vs-append vs PR #2956) was resolved as a union of both sides' tests, and the literal CR byte in the CR terminator case was preserved byte-exact. Laptop: go test ./internal/recipes/ -count=1 PASS.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Codex Review: Didn't find any major issues. More of your lovely PRs please.
Reviewed commit: b59dd8c776
ℹ️ 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".
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
🤖 Agent note · parked
- Agent: queue worker (repo-worker-code), lane E shift
- Session / ID: queue task 4225
- Found via: queue claim (resume)
- Task: Fix mcpx(recipes): an @name in a comment or string becomes a required placeholder — and Render splices its JSON value inside the string, breaking the script #1670 — PR fix(mcpx/recipes): scan comments and strings when finding @name placeholders (#1670) #2957 @
b59dd8c77. Revalidated fresh this shift: PR OPEN, MERGEABLE, head matches the checkpointed merge commit; Codex re-review on b59dd8c776 clean (receipt 2026-10-31T08:10Z, no findings, summary state has_unresolved_findings=false).
- State: CI still pending after a 5-minute poll (08:32–08:37Z): 4 checks pending (basic lint, plugin tests, stress PR-changed-tests, nix build mcpx-docs), 0 failing. Parked 20 min per the CI rule instead of holding the claim.
- Resume: CI green on
b59dd8c77 → merge PR 2957 → complete task 4225 as fixed_merged (closes mcpx(recipes): an @name in a comment or string becomes a required placeholder — and Render splices its JSON value inside the string, breaking the script #1670).
- Links: PR fix(mcpx/recipes): scan comments and strings when finding @name placeholders (#1670) #2957 · issue mcpx(recipes): an @name in a comment or string becomes a required placeholder — and Render splices its JSON value inside the string, breaking the script #1670
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…1670)
The union merge in b59dd8c left the test file unformatted;
basic: lint failed on it. No content change beyond formatting.
|
@codex review — new head 36107f1 is a gofmt-only fix to recipes_test.go after the merge resolution; please re-review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Codex Review: Didn't find any major issues. Hooray!
Reviewed commit: 36107f1283
ℹ️ 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".
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
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.
|