Skip to content

refactor: dedupe recipe launch-command extra-args into shared serializer#164

Open
OnlyTerp wants to merge 1 commit into
sybil-solutions:mainfrom
OnlyTerp:terp/wp-009-shared-command-serializer
Open

refactor: dedupe recipe launch-command extra-args into shared serializer#164
OnlyTerp wants to merge 1 commit into
sybil-solutions:mainfrom
OnlyTerp:terp/wp-009-shared-command-serializer

Conversation

@OnlyTerp

Copy link
Copy Markdown

Summary

Extract the byte-identical launch-command extra-args logic that was duplicated between the frontend recipe preview and the controller launch builder into a single shared/command-builder.ts. Behavior-preserving.

Changes

  • New shared/command-builder.ts: internal-key sets, JSON-string keys, and the extra-args serialization, parameterized per-side via an options object (false-boolean handling, shell quoting, JSON normalization).
  • controller/src/modules/engines/process/backend-builder.ts and frontend/src/features/recipes/recipe-command.ts consume it. Divergent / security behavior is kept per-side (model-runtime-default heuristics, VLLM_STUDIO_ALLOW_CUSTOM_LAUNCH_COMMAND env-gating, binary path resolution, the enable_expert_parallelism false-exception).

Verification

  • Before/after equivalence check: emitted launch argv is byte-identical across representative recipes (string / number / array / object / JSON-string speculative_config / boolean values, internal-key filtering, the enable_expert_parallelism exception, llama_bin security rejection, empty strings).
  • cd controller && bun run typecheck → clean; bun test src/shared/command-builder.test.ts → 24 pass; frontend typecheck + build → clean.

Non-goals

  • No dry-run endpoint; the preview stays offline/string-formatted exactly as before.

@OnlyTerp OnlyTerp requested a review from 0xSero as a code owner June 23, 2026 04:56
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