Skip to content

feat(FR-3205): redesign custom deployment Start Command with shell/exec modes#8170

Open
agatha197 wants to merge 1 commit into
mainfrom
fr-3205
Open

feat(FR-3205): redesign custom deployment Start Command with shell/exec modes#8170
agatha197 wants to merge 1 commit into
mainfrom
fr-3205

Conversation

@agatha197

@agatha197 agatha197 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Resolves #8035 (FR-3205)

Summary

Redesigns the custom-deployment Start Command input so shell semantics work correctly, backed by the new command/shell GraphQL fields (ModelServiceConfigInput, "Added in 26.7.0"). The WebUI no longer tokenizes the command client-side — it sends the raw string and lets the backend wrap (shell -c cmd) or shlex.split + exec.

Follow-up to #7957 (FR-3166), which only shipped a temporary helper-text mitigation while the client kept tokenizing.

UI

The command/config-file region is wrapped in one collapsible card:

  • The Command input | Config file segment moves into the card header (right side) with per-mode tooltips.
  • A Basic / Advanced switch (with a ? tooltip) sits on the Start Command label row.
  • Basic: shell implicit (/bin/bash), multi-line input, no helper.
  • Advanced → Shell: reveals Execution (Shell | Exec) + Shell selector; multi-line input; helper notes ;/&&/|/$VAR/redirection work. Sends command + selected shell.
  • Advanced → Exec: single-line input (Enter blocked, warns on shell operators); Shell disabled; sends command + shell: null so the backend splits into argv.
  • Config file mode is unchanged (mount target + model definition file path), just inside the same card.

Admin Deployment Presets get the same Basic/Advanced + Shell selector (no Exec mode — PresetModelServiceConfigInput.shell is non-null).

Version gating

isManagerVersionCompatibleWith('26.7.0') selects command/shell vs the deprecated tokenized startCommand; fragment fields use @since(version:"26.7.0") so prefill falls back to reconstructing from the token list on older managers. Never sends both command and startCommand.

Files

  • react/src/helper/modelServiceCommand.ts (new) — shared prefill/submit logic (deriveCommandModeState, resolveCommandShell, operator pattern).
  • DeploymentAddRevisionModal.tsx, AdminDeploymentPresetModelConfigItem.tsx, AdminDeploymentPresetSettingPageContent.tsx, AdminDeploymentPresetSettingPage.tsx, AdminDeploymentPresetFormTypes.ts.
  • resources/i18n/*.json (en + ko translated; other locales English fallback).

Verification

  • pnpm relay — compiles clean.
  • tsc — no errors in touched files (the lone remaining FluentEmojiIcon error is a known worktree patched-dep symlink issue, unrelated).
  • Lint / Format — PASS.

TODO

  • Screenshots of Basic / Advanced-Shell / Advanced-Exec / Config-file states.
  • Manual verification against a 26.7.0 manager (and an older manager for the fallback path).

🤖 Generated with Claude Code

@github-actions github-actions Bot added area:ux UI / UX issue. area:i18n Localization size:XL 500~ LoC labels Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for react-coverage (./react)

Status Category Percentage Covered / Total
🔵 Lines 6.97% 2038 / 29227
🔵 Statements 5.71% 2304 / 40327
🔵 Functions 5.84% 334 / 5714
🔵 Branches 3.8% 1450 / 38077
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
react/src/components/AdminDeploymentPresetFormTypes.ts 0% 100% 100% 0% 7
react/src/components/AdminDeploymentPresetModelConfigItem.tsx 0% 0% 0% 0% 37-243
react/src/components/AdminDeploymentPresetSettingPageContent.tsx 0% 0% 0% 0% 120-1061
react/src/components/DeploymentAddRevisionModal.tsx 0% 0% 0% 0% 185-2341
react/src/helper/modelServiceCommand.ts 100% 94.44% 100% 100%
react/src/pages/AdminDeploymentPresetSettingPage.tsx 0% 0% 0% 0% 28-446
Generated in workflow #2679 for commit 73fcefd by the Vitest Coverage Report Action

@agatha197 agatha197 force-pushed the fr-3205 branch 10 times, most recently from ef922bc to 7050d0f Compare July 7, 2026 03:14
@agatha197 agatha197 marked this pull request as ready for review July 8, 2026 03:07
Copilot AI review requested due to automatic review settings July 8, 2026 03:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR redesigns the custom-deployment Start Command input so shell semantics work correctly, backed by the new command/shell GraphQL fields (ModelServiceConfigInput, added in 26.7.0). Instead of tokenizing the command client-side and sending a bare argv array, the WebUI now sends the raw command string and lets the backend either wrap it (shell -c cmd) or shlex.split + exec, depending on whether shell is set. A new collapsible Service Configuration card hosts a Basic/Advanced switch and (in Advanced) a Shell/Exec Execution selector plus a shell picker. Version gating (isManagerVersionCompatibleWith('26.7.0')) and @since fragment fields ensure graceful fallback to the deprecated tokenized startCommand on older managers.

Changes:

  • New shared helper modelServiceCommand.ts with deriveCommandModeState (prefill) and resolveCommandShell (submit), plus shell option/operator constants.
  • Reworked Start Command UI in DeploymentAddRevisionModal.tsx (collapsible card, Basic/Advanced, Shell/Exec modes, operator validation) and mirrored Basic/Advanced + Shell controls for admin deployment presets.
  • Added command/shell GraphQL selections (version-gated) with regenerated Relay artifacts, and new i18n keys across all 20 locales (en + ko translated, others English fallback).

Reviewed changes

Copilot reviewed 27 out of 34 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
react/src/helper/modelServiceCommand.ts New shared prefill/submit logic; lacks unit tests despite sibling-helper convention.
react/src/components/DeploymentAddRevisionModal.tsx Collapsible card + Basic/Advanced + Shell/Exec UI, version-gated submit (command/shell vs startCommand).
react/src/components/AdminDeploymentPresetSettingPageContent.tsx Prefill via deriveCommandModeState; adds command @since and version gating flag.
react/src/components/AdminDeploymentPresetModelConfigItem.tsx Preset Basic/Advanced + Shell selector (no Exec mode).
react/src/components/AdminDeploymentPresetFormTypes.ts Adds commandAdvanced to ModelServiceFormValue; updates docs on startCommand/shell.
react/src/pages/AdminDeploymentPresetSettingPage.tsx Version-gated submit path using resolveCommandShell / tokenized fallback.
resources/i18n/*.json (20 files) New command/shell/execution keys; CommandExecNewlineError added but unused.
react/src/__generated__/*.graphql.ts (7 files) Regenerated Relay artifacts for the new command/shell selections; consistent with query changes.
Files not reviewed (7)
  • react/src/generated/AdminDeploymentPresetSettingPageContent_preset.graphql.ts: Generated file
  • react/src/generated/AdminDeploymentPresetSettingPageCreateMutation.graphql.ts: Generated file
  • react/src/generated/AdminDeploymentPresetSettingPagePresetQuery.graphql.ts: Generated file
  • react/src/generated/AdminDeploymentPresetSettingPageUpdateMutation.graphql.ts: Generated file
  • react/src/generated/DeploymentAddRevisionModal_revisionSource.graphql.ts: Generated file
  • react/src/generated/DeploymentDetailPageQuery.graphql.ts: Generated file
  • react/src/generated/DeploymentRevisionHistoryTabListQuery.graphql.ts: Generated file

Comment thread resources/i18n/en.json Outdated
Comment thread react/src/helper/modelServiceCommand.ts
@github-actions github-actions Bot added the area:lib Library and SDK related issue. label Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for root-coverage

Status Category Percentage Covered / Total
🔵 Lines 8.3% 28 / 337
🔵 Statements 9.14% 32 / 350
🔵 Functions 11.53% 6 / 52
🔵 Branches 9.09% 18 / 198
File CoverageNo changed files found.
Generated in workflow #2679 for commit 73fcefd by the Vitest Coverage Report Action

…ec modes

Wrap the command/config-file region in one collapsible card, move the
command|config-file segment into the card header, and add a Basic/Advanced
switch that reveals Execution (Shell|Exec) + Shell selector.

Switch the write/prefill path to the new 26.7.0 command/shell GraphQL fields
(raw string sent to backend; no client-side tokenization), with version-gated
fallback to the deprecated startCommand list on older managers.

Shell mode: multi-line input, shell operators work.
Exec mode: single-line input (Enter blocked), warns on shell operators, shell
sent as null so the backend shlex-splits and exec's directly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@agatha197 agatha197 marked this pull request as ready for review July 9, 2026 05:53

@nowgnuesLee nowgnuesLee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The other locale files all seem to contain English text — please double-check.

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

Labels

area:i18n Localization area:lib Library and SDK related issue. area:ux UI / UX issue. deployment size:XL 500~ LoC start-command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redesign deployment Start Command input: backend raw-string command/shell field + shell vs exec mode UI

3 participants