Skip to content

Fix LM Studio wizard prompter binding - #90429

Merged
steipete merged 1 commit into
openclaw:mainfrom
christineyan4:fix-682-lmstudio-prompter-binding
Jun 7, 2026
Merged

steipete merged 1 commit into
openclaw:mainfrom
christineyan4:fix-682-lmstudio-prompter-binding

Conversation

@christineyan4

@christineyan4 christineyan4 commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Bind LM Studio setup prompter methods before storing them as callbacks so gateway wizard class methods keep their receiver.
  • Add regression coverage for both text and note class-method prompter paths.

Real behavior proof

  • Behavior or issue addressed: Windows setup wizard selecting More… → LM Studio crashed on gateway 2026.5.28 with TypeError: Cannot read properties of undefined (reading 'prompt').
  • Real environment tested: Windows openclaw-windows-node setup UI against a local OpenClawGateway WSL gateway. The installed gateway bundle was patched with this PR's LM Studio prompter binding change for B-side validation.
  • Exact steps or command run after this patch: Restarted openclaw-gateway.service, launched the Windows setup wizard, selected More… → LM Studio, and reran the headless LM Studio provider probe.
  • Evidence after fix: Screen recording: https://github.com/user-attachments/assets/30542ff5-59de-4e1d-b5d2-16c37cd985ef
  • Observed result after fix: The wizard advanced to the LM Studio base URL step instead of throwing the prompt TypeError.
  • What was not tested: Windows app consumption of an official fixed gateway release/LKG; that remains a follow-up after this upstream fix lands and a fixed gateway version is selected.

Verification

  • pnpm build
  • pnpm test extensions/lmstudio/src/setup.test.ts — 38 passed
  • pnpm exec oxfmt --check --threads=1 extensions/lmstudio/src/setup.ts extensions/lmstudio/src/setup.test.ts
  • pnpm lint:extensions
  • Hanselman dual-model review: no blocking findings. Both reviewers flagged missing note binding coverage; this PR now includes that regression test.

Notes

  • pnpm check:changed could not run locally because the Crabbox/Testbox wrapper failed its local binary sanity check before starting the remote check.
  • Windows consumption should wait for a fixed gateway release/LKG decision; this PR only fixes the gateway-side provider bug.

@openclaw-barnacle openclaw-barnacle Bot added extensions: lmstudio size: S triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 4, 2026
@clawsweeper

clawsweeper Bot commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 7, 2026, 3:25 AM ET / 07:25 UTC.

Summary
The PR binds LM Studio interactive setup text and note prompter callbacks and adds regression coverage for class-backed wizard prompters.

PR surface: Source +2, Tests +85. Total +87 across 2 files.

Reproducibility: yes. by source inspection: current main extracts text and note from a class-backed wizard prompter whose methods use this.prompt, matching the reported receiver-loss crash. I did not execute the Windows setup flow locally, but the supplied recording shows the after-fix path.

Review metrics: none identified.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster ✨ media proof bonus
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P1] Downstream Windows users will still need a fixed gateway release or LKG selection before the upstream fix reaches their installed setup flow.

Maintainer options:

  1. Decide the mitigation before merge
    Land this narrow provider-local fix after maintainer review, then handle Windows gateway release or LKG consumption in the downstream Windows rollout path.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No automated repair is needed; the remaining action is maintainer review plus downstream Windows gateway release or LKG handling after merge.

Security
Cleared: The diff is limited to LM Studio provider setup TypeScript and tests, with no security or supply-chain sensitive surface expansion.

Review details

Best possible solution:

Land this narrow provider-local fix after maintainer review, then handle Windows gateway release or LKG consumption in the downstream Windows rollout path.

Do we have a high-confidence way to reproduce the issue?

Yes by source inspection: current main extracts text and note from a class-backed wizard prompter whose methods use this.prompt, matching the reported receiver-loss crash. I did not execute the Windows setup flow locally, but the supplied recording shows the after-fix path.

Is this the best way to solve the issue?

Yes; binding only the extracted LM Studio callbacks is the narrowest maintainable fix because fallback callback callers are preserved and direct params.prompter.text(...) call sites already keep their receiver.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against ab33fe33d1e0.

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The supplied recording directly shows the after-fix Windows setup wizard selecting LM Studio and reaching the LM Studio base URL step.

Label justifications:

  • P2: This fixes a real LM Studio setup crash with limited provider-specific blast radius.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (recording): The supplied recording directly shows the after-fix Windows setup wizard selecting LM Studio and reaching the LM Studio base URL step.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied recording directly shows the after-fix Windows setup wizard selecting LM Studio and reaching the LM Studio base URL step.
  • proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. The supplied recording directly shows the after-fix Windows setup wizard selecting LM Studio and reaching the LM Studio base URL step.
Evidence reviewed

PR surface:

Source +2, Tests +85. Total +87 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 4 2 +2
Tests 1 85 0 +85
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 89 2 +87

What I checked:

  • Current main receiver-loss path: Current main stores params.prompter?.text and params.prompter?.note as standalone callbacks before invoking them, which can lose this for class-backed prompters. (extensions/lmstudio/src/setup.ts:393, ab33fe33d1e0)
  • Class-backed wizard prompter: The gateway wizard session prompter is a class, and its note and text methods call this.prompt(...), matching the reported undefined receiver failure mode when extracted unbound. (src/wizard/session.ts:51, ab33fe33d1e0)
  • LM Studio setup entry point: The LM Studio provider auth method passes ctx.prompter directly into promptAndConfigureLmstudioInteractive, so the provider-local setup function is the right owner boundary for this fix. (extensions/lmstudio/index.ts:69, ab33fe33d1e0)
  • PR patch: The PR head binds params.prompter.text and params.prompter.note to params.prompter while preserving the fallback callback path. (extensions/lmstudio/src/setup.ts:390, 8887707b9445)
  • Regression coverage: The patch adds a class-method prompter harness plus separate tests for successful text prompting and discovery-failure note prompting, covering both extracted callbacks. (extensions/lmstudio/src/setup.test.ts:182, 8887707b9445)
  • Real behavior proof: The supplied 6.6 second recording shows the Windows OpenClaw setup wizard selecting LM Studio and advancing to the LM Studio base URL prompt instead of crashing. (8887707b9445)

Likely related people:

  • rugvedS07: Live path history shows the LM Studio integration commit added the provider setup function, tests, and plugin entry point involved in this bug. (role: introduced behavior; confidence: high; commits: 0cfb83edfae9; files: extensions/lmstudio/src/setup.ts, extensions/lmstudio/src/setup.test.ts, extensions/lmstudio/index.ts)
  • Frank Yang: The LM Studio integration commit lists Frank Yang as a co-author for the provider setup area. (role: co-author on introduced behavior; confidence: medium; commits: 0cfb83edfae9; files: extensions/lmstudio/src/setup.ts, extensions/lmstudio/src/setup.test.ts, extensions/lmstudio/index.ts)
  • steipete: Live history and the current shallow blame show recent maintenance on LM Studio setup and related wizard/setup surfaces. (role: recent area contributor; confidence: medium; commits: 4fa5092cdc39, f4098e64e4eb; files: extensions/lmstudio/src/setup.ts, extensions/lmstudio/index.ts, src/wizard/session.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@christineyan4

Copy link
Copy Markdown
Contributor Author
Screen.Recording.2026-06-04.133056.mp4

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 4, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 4, 2026
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. proof: sufficient ClawSweeper judged the real behavior proof convincing. labels Jun 4, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 4, 2026
@byungskers

Copy link
Copy Markdown

Nice narrow fix. I especially like that you covered both text and note method extraction, since the receiver-loss bug would have been easy to only patch on the happy path.

One tiny follow-up thought: if we expect other provider setup flows to keep destructuring class-backed prompter methods, it may be worth adding a small shared helper (or even a short comment near the binding) so this receiver-preservation pattern doesn't have to be rediscovered elsewhere. Not blocking here — just a maintainability note.

@steipete steipete self-assigned this Jun 7, 2026
Bind LM Studio setup prompter methods before storing them as callbacks so the gateway wizard class prompter keeps its receiver.

Co-authored-by: Copilot <[email protected]>
@steipete
steipete force-pushed the fix-682-lmstudio-prompter-binding branch from ce56acf to 8887707 Compare June 7, 2026 07:18
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 7, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 7, 2026
@steipete

steipete commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Maintainer verification for rebased head 8887707.

Reviewed current behavior and owner boundary: LM Studio setup extracts params.prompter.text and params.prompter.note as standalone callbacks in extensions/lmstudio/src/setup.ts, while the gateway wizard prompter in src/wizard/session.ts is class-backed and its methods call this.prompt(...). That matches the reported receiver-loss crash when Windows setup selects More... -> LM Studio.

Local proof:

  • OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs extensions/lmstudio/src/setup.test.ts -> 38 passed
  • pnpm exec oxfmt --check --threads=1 extensions/lmstudio/src/setup.ts extensions/lmstudio/src/setup.test.ts
  • node scripts/run-oxlint.mjs extensions/lmstudio/src/setup.ts extensions/lmstudio/src/setup.test.ts
  • pnpm tsgo:extensions
  • git diff --check origin/main...HEAD
  • pnpm changed:lanes --json -> extensions + extensionTests only
  • /Users/steipete/Projects/agent-scripts/skills/autoreview/scripts/autoreview --mode branch --base origin/main -> clean, no accepted/actionable findings

Real behavior proof: contributor supplied Windows setup wizard video proof showing More... -> LM Studio advancing to the LM Studio base URL step after the fix. I also verified the code path locally by source inspection against the class-backed WizardSessionPrompter receiver contract.

CI: gh pr checks --watch --fail-fast is green for head 8887707.

Not tested by me: a fresh Windows GUI run; I relied on the supplied video proof plus local regression/unit proof for the provider setup path.

@steipete
steipete merged commit 22276e6 into openclaw:main Jun 7, 2026
162 of 163 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: lmstudio P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants