Skip to content

fix(core,mcp,leadclaw): #3508 send user_prompt (not prompt) to POST /user_prompt#17

Merged
milstan merged 1 commit intomainfrom
milstan/fix-user-prompt-key
Apr 22, 2026
Merged

fix(core,mcp,leadclaw): #3508 send user_prompt (not prompt) to POST /user_prompt#17
milstan merged 1 commit intomainfrom
milstan/fix-user-prompt-key

Conversation

@milstan
Copy link
Copy Markdown
Contributor

@milstan milstan commented Apr 21, 2026

Summary

  • Fixes product#3508: the backend's UserPromptPayload is @SerialName("user_prompt") with strict kotlinx.serialization, so the client's { prompt } body was rejected with a 400. Both leadbay_refine_prompt and the granular leadbay_set_user_prompt now send { user_prompt }, and their dry_run previews reflect the real wire shape.
  • Three new unit tests pin the POST body key (setUserPrompt, refinePrompt, refinePrompt dry_run) so the contract can't silently reappear. Audited every other requestVoid("POST", …, body) call site — no other Kotlin snake_case endpoints were being hit with camelCase bodies.
  • Versions: @leadbay/core 0.2.1→0.2.2 (private), @leadbay/mcp + @leadbay/leadclaw 0.2.2→0.2.3 (with openclaw.plugin.json synced), CHANGELOG entries in both published packages.

Test plan

  • pnpm -r typecheck clean
  • pnpm -r test — 127/127 pass (95 core / 12 leadclaw / 20 mcp), including the 3 new contract tests
  • Post-merge: npx -y @leadbay/mcp + leadbay_refine_prompt against staging returns 204, not a JSON deserialization 400

🤖 Generated with Claude Code

…user_prompt

Backend's UserPromptPayload is kotlinx.serialization @SerialName("user_prompt");
strict deserialization rejected the client's { prompt } body with a 400. Every
non-dry-run call to leadbay_refine_prompt and the granular leadbay_set_user_prompt
was broken. The dry_run preview printed the same wrong shape, which hid the
mismatch from anyone who inspected it.

Three new unit tests pin the wire key (setUserPrompt body, refinePrompt body,
refinePrompt dry_run preview) so the contract can't silently reappear.

Checked every other requestVoid("POST", …, body) call site — no other Kotlin
snake_case endpoints were being hit with camelCase-keyed bodies.

Versions: core 0.2.1→0.2.2 (private), mcp + leadclaw 0.2.2→0.2.3
(openclaw.plugin.json synced).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@milstan milstan merged commit 307d97a into main Apr 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant