Skip to content

fix(cli): rename consoleExec url param so /models /routes /version /datasource work - #2591

Merged
bpamiri merged 2 commits into
developfrom
fix/bot-2582-several-wheels-console-commands-fail-with-makehttp
May 12, 2026
Merged

bpamiri merged 2 commits into
developfrom
fix/bot-2582-several-wheels-console-commands-fail-with-makehttp

Conversation

@wheels-bot

@wheels-bot wheels-bot Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

Summary

wheels console slash commands /models, /routes, /version, and /datasource route through consoleExec in cli/lucli/Module.cfc, whose first parameter was named url. CFML's reserved URL scope shadowed the parameter inside the function body, so the call makeHttpPost(url, body) received the URL scope struct in place of the request URL and threw Cannot cast Object type [url] to a value of type [string]. Renamed the parameter to requestUrl to mirror makeHttpPost's own signature and updated the single call site.

Related Issue

Closes #2582

Type of Change

  • Bug fix
  • New feature
  • Enhancement to existing feature
  • Documentation update
  • Refactoring

Feature Completeness Checklist

  • Tests -- cli/lucli/tests/specs/commands/ConsoleCommandSpec.cfc asserts the parameter name no longer collides with the URL scope (failing → passing).
  • Framework Docs -- N/A (handled by bot-update-docs.yml if needed).
  • AI Reference Docs -- N/A (handled by bot-update-docs.yml if needed).
  • CLAUDE.md -- N/A (handled by bot-update-docs.yml if needed).
  • CHANGELOG.md -- Entry added under [Unreleased] > Fixed.
  • Test runner passes -- Local CLI test runner: cli.lucli.tests.specs.commands.ConsoleCommandSpec reports totalPass: 2, totalFail: 0 after the fix; sibling specs in cli.lucli.tests.specs.commands.* still pass.

Test Plan

  • curl "http://localhost:60007/wheels/cli/tests?format=json&directory=cli.lucli.tests.specs.commands" → ConsoleCommandSpec passes; no regressions in adjacent command specs.
  • Manual smoke against a Wheels app: wheels console → /models, /routes, /version, /datasource each return their expected output without makeHttpPost errors.

@wheels-bot

wheels-bot Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

Wheels Bot — No doc updates

Reviewed this PR's diff and found no docs that need updating (purely internal CLI bugfix — the console-and-repl.mdx guide already accurately documents /models, /routes, /version, and /datasource; renaming a private function parameter restores already-documented behavior without changing any public API surface or Wheels conventions).

@wheels-bot wheels-bot Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wheels Bot — Reviewer A

TL;DR: This is a minimal, correct fix for a CFML reserved-scope collision bug in the wheels console slash commands. Renaming the url parameter to requestUrl in consoleExec unambiguously resolves the shadowing. Tests, CHANGELOG, and commit message are all clean. Would approve if not self-review restricted.

Correctness

The root cause is straightforward: CFML treats url as a reserved struct scope (the URL query-string bag). When consoleExec declared required string url, the call makeHttpPost(url, body) resolved url to the URL scope struct rather than the function parameter, producing the Cannot cast Object type [url] to a value of type [string] error.

The fix is correct and complete. Every call site already passes evalUrl (a local var), so only the function signature and internal reference needed updating. The three HTTP helper functions (consoleExec, makeHttpRequest, makeHttpPost) now all use requestUrl consistently — verified by grepping Module.cfc. No residual url parameter names remain.

Tests

ConsoleCommandSpec.cfc uses the same source-inspection pattern established by ReloadCommandSpec.cfc: consoleExec is private and makes a live HTTP call, so checking the source text is the right trade-off. Both assertions are correctly written:

  • expect(reFind(pattern, moduleSource) > 0).toBeFalse(message) — toBeFalse(message) is a valid WheelsTest BDD matcher signature.
  • expect(moduleSource).notToInclude(needle, message) — dispatched through onMissingMethod→toInclude with isNot=true→notIncludes(target, needle, message), all with matching signatures. notToInclude with a second message argument works correctly.
  • "##2582" in the failure message escapes to #2582 at runtime — correct.

One small note for future maintainers: the first test's regex anchors url as the first parameter (function consoleExec\(\s*required\s+string\s+url\b). If a url parameter were ever added in a later position it would not fire. The second test (makeHttpPost(url,) is the more robust guard since it catches the actual call site regardless of signature position. Both together provide adequate regression coverage.

Commits

fix(cli): rename consoleExec url param so /models /routes /version /datasource work — valid type, valid scope, 82 chars, not ALL-CAPS. Passes commitlint.

Docs

CHANGELOG entry under [Unreleased] > Fixed is accurate and appropriately detailed. No .ai/wheels/ or guide doc changes are needed for an internal CLI helper rename.

@wheels-bot

wheels-bot Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

Wheels Bot — Reviewer B (round 1)

A's review is accurate and appropriately scoped. No sycophancy, no false positives, no missed issues. The technical claims are verified against the source.

Sycophancy

None detected. A backs every positive claim with a specific reference to the diff or source. "Would approve if not self-review restricted" is an honest acknowledgement of the constraint, not a lazy LGTM.

False positives

None detected.

  • A claims toBeFalse(message = "") is a valid WheelsTest BDD signature — confirmed at vendor/wheels/wheelstest/system/Expectation.cfc:152.
  • A describes the notToInclude dispatch chain as onMissingMethod → strips "not" → invokes toInclude with isNot=true → assert.notIncludes — confirmed by reading Expectation.cfc:65–89 and toInclude:562–563.
  • A claims all three HTTP helpers (consoleExec, makeHttpRequest, makeHttpPost) now use requestUrl consistently — confirmed by grepping Module.cfc lines 1192, 5164, 5185.

Missed issues

None detected. The diff is a 2-line rename in Module.cfc plus a new regression spec and a CHANGELOG entry. A correctly identifies the one weak spot in the test (the regex only anchors url as the first parameter) and correctly notes test 2 is the more robust guard. There are no cross-engine concerns here — this is private CLI code running on the Wheels CLI runtime.

Verdict alignment

A submitted COMMENTED with an explicit "would approve" rationale. That is the appropriate state when the bot cannot self-approve; it conveys the intent without bypassing the restriction. Consistent with the findings.

Convergence

A and I are aligned. The fix is correct and complete, the tests adequately cover the regression, and the CHANGELOG entry is accurate. No changes are needed.

@bpamiri
bpamiri marked this pull request as ready for review May 12, 2026 01:06
@bpamiri
bpamiri merged commit 867fb4a into develop May 12, 2026
5 of 6 checks passed
@bpamiri
bpamiri deleted the fix/bot-2582-several-wheels-console-commands-fail-with-makehttp branch May 12, 2026 01:06

@wheels-bot wheels-bot Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wheels Bot — Reviewer A

TL;DR: This is a minimal, correct fix for a CFML reserved-scope collision in wheels console slash commands. The parameter rename from url to requestUrl in consoleExec is the right fix, all call sites pass a local var evalUrl so no call site changes were needed, and the source-level regression spec follows the established ReloadCommandSpec.cfc pattern. The head SHA changed due to a merge-with-develop commit; the PR's three-file diff is substantively identical to the previous review pass. No new issues found.

Correctness

The fix is precise and complete. CFML's implicit URL scope shadowed the required string url parameter inside consoleExec, causing makeHttpPost(url, body) to receive a struct rather than the string URL. The rename to requestUrl (matching makeHttpPost's own parameter name at line 5185 of Module.cfc) eliminates the collision at the only call site inside the function (line 1195).

All six callers of consoleExec (lines 1144, 1165, 1169, 1173, 1178, 1183) pass evalUrl, which is a local var defined at line 1073. No caller changes were needed. The remaining makeHttpPost call at line 1075 passes evalUrl directly and was never affected.

Test coverage

ConsoleCommandSpec.cfc extends wheels.wheelstest.system.BaseSpec (correct — BDD, not RocketUnit). The two source-inspection assertions are appropriate for a private function that makes a live HTTP call:

  • Line 23: reFind(pattern, moduleSource) > 0).toBeFalse(...) — guards the function signature.
  • Line 30: .notToInclude("makeHttpPost(url,", ...) — guards the call site.

The ##2582 escape on line 24 correctly emits #2582 at runtime. The toBeFalse(message) signature is valid under WheelsTest's BDD matcher interface.

One minor note for future maintainers: the first regex anchors only the first-parameter position; if url were added as a later parameter it would not fire. The second assertion (call site guard) provides the more robust coverage. Together they are adequate regression protection.

Commits

fix(cli): rename consoleExec url param so /models /routes /version /datasource work — valid type, valid scope, 82 characters, not ALL-CAPS. Passes commitlint.

CHANGELOG

Entry under [Unreleased] > Fixed accurately describes the root cause, the affected commands, and the rename. No guide or .ai/wheels/ doc updates are needed for an internal CLI helper rename.

Cross-engine compatibility

No cross-engine concerns: serializeJSON, deserializeJSON, fileRead, expandPath, and reFind are all standard CFML built-ins available across Lucee, Adobe CF, and BoxLang. No struct member functions on CFCs, no client scope, no bracket-notation function calls.

@wheels-bot

wheels-bot Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

Wheels Bot — Reviewer B (round 1)

A's review is accurate, well-evidenced, and appropriately scoped to the diff. No sycophancy, no false positives, no missed issues. The prior B review on SHA c1d30ebf0 already converged-approve on the same logical change; A's re-review on the post-merge SHA c569877c9 reaches the same conclusion by the same reasoning.

Sycophancy

None detected. Every positive claim is backed by a specific line reference. The COMMENTED verdict with explicit "would approve" rationale is an honest acknowledgement of the self-review restriction, not a lazy LGTM.

False positives

None detected.

  • A's claim that ##2582 correctly emits #2582 at runtime is accurate — in CFScript string literals ## escapes to a literal #, so the error message renders as the intended GitHub issue reference.
  • A's claim that all six consoleExec callers pass evalUrl (a local var) and required no changes is consistent with the diff: the patch touches only the function signature and its single internal makeHttpPost call site, and no caller lines appear in the diff, confirming they were unaffected.
  • A's description of toBeFalse(message) as a valid WheelsTest BDD matcher signature is correct per vendor/wheels/wheelstest/system/Expectation.cfc.

Missed issues

None detected. The diff is a 2-line rename in Module.cfc, a new source-inspection spec, and a CHANGELOG entry. A correctly identifies the one limitation of the regex (first-parameter anchoring only) and correctly notes the call-site guard is the more robust coverage. No cross-engine concerns exist — fileRead, expandPath, reFind, serializeJSON, and deserializeJSON are all standard CFML built-ins available across Lucee, Adobe CF, and BoxLang.

Verdict alignment

COMMENTED with explicit "would approve" is the correct verdict under a self-review restriction. Consistent with the findings.

Convergence

Aligned, no changes needed. A and I agree: the fix is minimal and correct, the tests adequately cover the regression, and the CHANGELOG entry is accurate. This matches the converged-approve outcome already reached on the previous SHA.

bpamiri added a commit that referenced this pull request May 17, 2026
…ti-patterns #11-14 (#2740)

CLAUDE.md was 1133 lines, with 10 of 17 listed reference subdirectories missing and several
broken doc paths (config/services.cfm, docs/src/...). Reorders, dedups, and trims to 714 lines
(-37%) with all internal links now resolving.

Top-of-file restructured for high-leverage content first:
- Code Map: where framework/demo/CLI live and how they relate
- Before-Done checklist: which test suite to run for which change type
- Cross-Engine Invariants: promoted from buried Docker / Browser-Testing locations
- Anti-Patterns extended Top 10 -> Top 14, all new entries sourced from recent PRs:
  - #11 CFML reserved scopes shadow parameters (#2591)
  - #12 Empty array in whereIn / whereNotIn (#2736)
  - #13 Comma-list config != single-value HTTP header (#2725)
  - #14 Strip CFML comments before source-scanning (#2595)

Extracted sections, loaded only when relevant:
- .ai/wheels/deploy.md (92 lines) - wheels deploy Kamal port reference
- .ai/wheels/wheels-bot.md (34 lines) - bot architecture
- .ai/wheels/testing/browser-testing.md (68 lines) - browser DSL

Other dedups: t.timestamps() 3-column rule, mixed-argument-style rule, and the
WheelsTest-only-for-new-tests reminder each appear in one canonical location now.
Reference Docs list at bottom lists only verified-to-exist files.

Signed-off-by: Peter Amiri <peter@alurium.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Several wheels console commands fail with makeHttpPost invalid argument error

1 participant