Skip to content

fix: When there are interface parameters passed by the intelligent agent, the parameter names of the interface parameters will not be displayed in the reference variable list in subsequent nodes - #8230

Merged
shaohuzhang1 merged 1 commit into
v3from
pr@v3@fix_api_params
Nov 30, 2026

Conversation

@shaohuzhang1

Copy link
Copy Markdown
Contributor

fix: When there are interface parameters passed by the intelligent agent, the parameter names of the interface parameters will not be displayed in the reference variable list in subsequent nodes

…ent, the parameter names of the interface parameters will not be displayed in the reference variable list in subsequent nodes
label: field.name || field.variable,
value: field.variable,
}))
return [...userFields, ...apiFields]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No syntax issues in the diff. The main concern is a semantic change: ?? → ||.

Potential issues

  1. Behavior change with falsy values

    • Before: field.name ?? field.variable
      • Falls back only when field.name is null or undefined.
    • After: field.name || field.variable
      • Falls back for any falsy value: "", 0, false, NaN, null, undefined.
    • If field.name is an empty string and you want to show it as an intentional empty label, || will incorrectly replace it.
    • If field.name can only be a non-empty string or null/undefined, the change has no practical effect.
  2. Inconsistency with userFields

    • userFields still uses:
      label: field.field ?? field.variable
    • apiFields now uses:
      label: field.name || field.variable
    • If the fallback rules should be the same, this inconsistency may cause different labels for equivalent missing/empty values.
  3. Possible unintended behavior for whitespace-only names

    • field.name || field.variable does not fall back for " ".
    • If API data may contain whitespace-only names, consider trimming.

Suggested fix

If the goal is only to handle null / undefined, keep ??:

label: field.name ?? field.variable,

If the goal is to also fall back for empty strings, make it explicit and consistent:

label: field.name?.trim() ? field.name : field.variable,

Or, if both fields should behave identically:

const getLabel = (name?: string | null, variable?: string) =>
  name?.trim() ? name : variable ?? ''

Summary

  • || is not wrong syntactically, but it is broader than ??.
  • Main risk: empty string or other falsy values now trigger fallback.
  • Main suggestion: align userFields and apiFields logic, and use an explicit empty-string check if that is the intended behavior.

@shaohuzhang1
shaohuzhang1 merged commit 6e58374 into v3 Nov 30, 2026
3 of 4 checks passed
@shaohuzhang1
shaohuzhang1 deleted the pr@v3@fix_api_params branch November 30, 2026 09:26
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