Skip to content

fix: preserve prompt text in pnpm example commands - #24

Merged
steipete merged 2 commits into
openclaw:mainfrom
embrace897:codex/fix-example-prompt-separator
Nov 14, 2026
Merged

steipete merged 2 commits into
openclaw:mainfrom
embrace897:codex/fix-example-prompt-separator

Conversation

@embrace897

@embrace897 embrace897 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Cookbook commands using pnpm <script> -- "prompt" pass the separator into the example as a literal argument. Remove the extra separator from the README commands and smoke scripts so the SDK receives the intended prompt.

With pnpm 10.34.5, the offline custom-transport recipe recorded -- test prompt before the change and test prompt afterward. Formatting, type checking, lint, docs checks, all four example builds and both offline smoke commands passed. The full Windows suite reported 24 passes and three environment failures involving symlink permissions and subprocess lookup of pnpm.

Behavior proof

Verified PR head f70b7392e1f4fb3db251bdbaa4a2276f4b6c0f76 on Windows with Node 24.15.0, pnpm 10.34.5, and the repository's in-memory SDK transport.

> npx --yes [email protected] recipe:custom-transport -- "test prompt"
> tsx recipes/custom-transport/index.ts "--" "test prompt"
agent.params.input = "-- test prompt"
exit = 0

> npx --yes [email protected] recipe:custom-transport "test prompt"
> tsx recipes/custom-transport/index.ts "test prompt"
agent.params.input = "test prompt"
exit = 0

> npx --yes [email protected] examples:smoke
> node dist/index.js "Cookbook smoke"   (quickstart)
hello from OpenClaw
status = completed
> node dist/index.js "Cookbook smoke"   (coding-agent-cli)
[run.completed]
status = completed
exit = 0

The lines above excerpt the recipe JSON and smoke output. I built both starters before running smoke. The comparison uses the old and corrected command forms on the same checkout.

@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:docs Preliminary submission classification; full source review pending. P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:docs Preliminary submission classification; full source review pending. labels Nov 11, 2026
@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

Removes extra argument separators from pnpm example commands so the SDK receives the intended prompt.

Example: Run the custom-transport recipe with pnpm 10.34.5 and the prompt "test prompt".

  • Before: The documented command sends "-- test prompt" to the SDK.
  • After: The corrected command sends "test prompt".

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, correct fix supported by shipped-command terminal evidence and a successful exact-head repository check.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The contributor's terminal trace exercises the shipped recipe through pnpm on the reviewed head, records input changing from "-- test prompt" to "test prompt", and shows both changed compiled starter smoke invocations completing; this resolves the earlier proof request.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Copying documented pnpm commands adds an unintended "-- " prefix to the user's prompt.
Reason: The change restores exact prompt forwarding without adding configuration or changing intended SDK behavior.

Merge readiness

✅ Ready for maintainer review

This PR fixes a prompt-forwarding bug still present on main; the supplied terminal trace resolves the previous proof blocker, and no actionable defects remain.

Priority: P2
Reviewed head: f70b7392e1f4fb3db251bdbaa4a2276f4b6c0f76

Before merge

None.

Findings

None.

Agent review details

How this fits together

The cookbook's pnpm scripts launch recipes and starter CLIs that join command arguments into prompts passed to the SDK.

flowchart LR
  A[Documented command] --> B[pnpm script]
  B --> C[Recipe or starter CLI]
  C --> D[Argument reader]
  D --> E[SDK input]
  E --> F[Transport]
Loading

Technical review

Best possible solution:

Land the focused command corrections while preserving the existing argument readers and SDK contracts.

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

The argument readers preserve the separator, matching the contributor's before-and-after terminal trace; this read-only review executed no target code.

Is this the best way to solve the issue?

Removing the separators where commands are authored is the smallest complete fix and preserves legitimate prompt text handling.

AGENTS.md: not found in the target repository.

Codex review notes: model internal, reasoning medium; reviewed against 27bcf94d3158.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Exact introduced change: The pinned diff removes separators from documented commands and both smoke invocations without changing application argument handling. (package.json:11, f70b7392e1f4)
  • Current-main defect: Main still documents the separator, while readInput joins all forwarded arguments, preserving the unwanted prefix. (recipes/_shared/config.ts:35, 27bcf94d3158)
  • Contributor behavior proof: The full PR body supplies terminal output for the reviewed head on Windows with Node 24.15.0 and pnpm 10.34.5: the shipped custom-transport command records the corrected SDK input, and both compiled starter smoke commands complete. (f70b7392e1f4)
  • Original intent and feature history: [codex] build OpenClaw SDK cookbook #1 introduced runnable recipes; chore: refresh cookbook toolchain and example runtime #4 added compiled CLI smoke coverage. The correction preserves both purposes. An extended history check encountered unavailable older pnpm metadata blobs; the relevant command and argument-reader history was readable. (package.json:11, 3f1fc912f0d3)
  • Exact-head validation: The Cookbook and examples check succeeded on the reviewed head; its workflow runs pnpm check, including the changed smoke script. (.github/workflows/check.yml, f70b7392e1f4)

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P2: Copied recipe commands alter prompt text, with limited impact and a focused correction.
  • 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.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-11T07:20:46.507Z sha f70b739 :: needs real behavior proof before merge. :: none

Reviewed November 12, 2026, 9:27 AM ET / 14:27 UTC (Revision 2).

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. proof: sufficient Contributor real behavior proof is sufficient. 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. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 12, 2026
@steipete
steipete merged commit a6e9cee into openclaw:main Nov 14, 2026
4 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged as a6e9cee. Reproduced with the pinned pnpm 10.34.5 and the in-memory SDK transport: the old command sends "-- test prompt"; the corrected command sends exactly "test prompt".

Full pnpm check passed on Linux, including all 27 tests, formatting, typecheck, lint, docs, four starter builds, and both corrected CLI smoke commands. Refreshed exact-head CI passed at ca9e341: https://github.com/openclaw/cookbook/actions/runs/43578405102. Independent review found no actionable P0–P2 findings. Thanks @embrace897.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants