Skip to content

fix: overhaul default model settings across workflow apps and tools - #6843

Merged
shaohuzhang1 merged 1 commit into
1Panel-dev:v2from
shenkaibo:pr@v2@fix_workflow‑global‑model‑switch
Sep 1, 2026

Hidden character warning

The head ref may contain hidden characters: "pr@v2@fix_workflow\u2011global\u2011model\u2011switch"
Merged

fix: overhaul default model settings across workflow apps and tools#6843
shaohuzhang1 merged 1 commit into
1Panel-dev:v2from
shenkaibo:pr@v2@fix_workflow‑global‑model‑switch

Conversation

@shenkaibo

Copy link
Copy Markdown
Contributor

Summary

One combined fix set covering default-model configuration for workflow applications and tools — from persistence/execution correctness through the panel UI and per-category parameter dialog.

This PR squashes 8 prior commits into one and includes fixes for the following bugs/issues:

Data loss — copy operations

  • Copying a workflow application dropped its default model configuration: the WorkflowRequest serializer neither declared nor mapped default_model_setting, so DRF silently discarded it and the copy had empty dropdowns in the default-model settings panel.
  • Copying a workflow tool lost its default model settings: tool creation (ToolSerializer.Create.insert) built the ToolWorkflow row with only work_flow. default_model_setting is now passed through so the copy keeps it.

Missing-default execution

  • A node in "default" model mode kept running the last configured model after that default was cleared: base step-node implementations left stale node_data.model_id. They now always resolve model_id from default_model_setting in "default" mode (None when unconfigured), so debug fails fast with the existing empty-model error, matching publish-time validation — across all affected step nodes.

Panel behavior (default-model-setting)

  • Staged edits on close: closing without save let nodes pick up non-persisted config and debug still succeeded. Edits are now staged locally and only committed on save, with an unsaved-changes confirm (save / discard / cancel) on close; the panel mounts via v-if so its click-outside listener is not live while collapsed.
  • Publish validation highlight: when a missing default model blocks publish validation, the offending problem node was not highlighted on the canvas — it is now located and highlighted.
  • Long-term memory field position: the AI model config field position did not match the prototype; repositioned to match.
  • Save-button gating: save button stayed enabled with nothing changed; now disabled when there are no unstaged modifications.
  • Readonly support: read-only users could not see/open the default-model settings at all (button gated on edit-level permission). Re-gated on the read-level (debug/read) condition and the panel is view-only for them (model select, param button, apply-to-all, save disabled; hasChanges always false).
  • Reranker param button: the parameter-settings button was enabled for RERANKER, which has no parameter form; now disabled for that category.

Param dialog flash (AIModeParamSettingDialog)

  • Opening a model's parameter config flashed the previous category's content (~1s) before showing the correct one: the dialog reused the prior model_form_field on a destroy-on-close remount, so DynamicsForm rendered the last category's params until the async getModelParamsForm resolved. Fields are now cleared before the dialog shows, and the body is wrapped in a v-loading mask covering the async window.

Files

  • Backend: application workflow step-node impls (12), application.py, tool.py, locales.
  • Frontend: default-model-setting/index.vue, AIModeParamSettingDialog.vue, workflow views, validate.ts, nodes.

One combined change set covering default-model configuration for workflow
applications and tools, from Persistence/execution correctness through the
panel UI and per-category parameter dialog. Bugs and issues fixed:

- [Copy app] Copying a workflow application dropped its default model
  configuration: the WorkflowRequest serializer neither declared nor mapped
  default_model_setting, so DRF silently discarded it and the copy had empty
  dropdowns in the default-model settings panel.

- [Copy tool] Copying a workflow tool lost its default model settings: tool
  creation (ToolSerializer.Create.insert) built the ToolWorkflow row with only
  work_flow. default_model_setting is now passed through so the copy keeps it.

- [Execution] A node in "default" model mode kept running the last configured
  model after that default was cleared: base step-node impls left stale
  node_data.model_id. They now always resolve model_id from
  default_model_setting in "default" mode (None when unconfigured) so debug
  fails fast with the existing empty-model error, matching publish-time
  validation across all 13 affected step nodes.

- [Panel staging] Default-model-setting panel: closing without save let nodes
  pick up non-persisted config and debug still succeeded. Edits are now staged
  locally and committed only on save, with an unsaved-changes confirm
  (save/discard/cancel) on close; panel mounts via v-if so its click-outside
  listener is not live while collapsed.

- [Publish highlight] Missing default model blocks publish validation but the
  offending problem node was not highlighted on the canvas; it is now located
  and highlighted when publish validation fails.

- [Long-term memory] Long-term memory AI model config field position did not
  match the prototype; repositioned to match.

- [Save button] Default-model-settings save button stayed enabled with nothing
  changed; now disabled when there are no unstaged modifications.

- [Readonly] Read-only users could not see/open the default-model settings at
  all (button gated on edit-level permission). Re-gated on read-level
  (debug/read) and the panel is view-only for them (model select, param
  button, apply-to-all, save disabled; hasChanges always false).

- [Reranker] Parameter-settings button in the default-model panel was enabled
  for RERANKER, which has no parameter form; disabled for that category.

- [Param dialog flash] Opening a model's parameter config flashed the previous
  category's content (~1s) before the correct one: AIModeParamSettingDialog
  reused the prior model_form_field on a destroy-on-close remount. Fields are
  now cleared before the dialog shows, and the body is wrapped in a v-loading
  mask covering the async getModelParamsForm window.
@shaohuzhang1
shaohuzhang1 merged commit 3554561 into 1Panel-dev:v2 Sep 1, 2026
1 of 2 checks 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.

2 participants