Skip to content

Add built-in AI flow launch inputs#24595

Open
luisorofino wants to merge 1 commit into
loa/openmetrics-ai-genfrom
loa/ai-built-in-launch-inputs
Open

Add built-in AI flow launch inputs#24595
luisorofino wants to merge 1 commit into
loa/openmetrics-ai-genfrom
loa/ai-built-in-launch-inputs

Conversation

@luisorofino

@luisorofino luisorofino commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds built-in launch settings to every ddev meta ai flow:

  • Requires a PRD file and injects its contents as the prd runtime variable.
  • Allows an optional maximum orchestration timeout, with an empty value running unbounded.
  • Shows built-in settings after flow-specific inputs for both new and resumed runs.
  • Supports visual placeholders on custom string, number, and path flow inputs.
  • Uses the OpenMetrics endpoints JSON example as a placeholder instead of a default value.

UI screenshot

image (4)

Motivation

Flows need consistent product requirements and configurable run duration without repeating framework-owned inputs in every flow definition. Custom placeholders also let flow authors provide examples without accidentally submitting those examples as default values.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add qa/required if this PR needs QA validation, or qa/skip-qa if it does not. Exactly one of the two is required.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

@luisorofino luisorofino added the qa/skip-qa Automatically skip this PR for the next QA label Jul 17, 2026
@luisorofino
luisorofino changed the base branch from master to loa/openmetrics-ai-gen July 17, 2026 15:02
@luisorofino
luisorofino marked this pull request as ready for review July 17, 2026 15:04
@luisorofino
luisorofino requested a review from a team as a code owner July 17, 2026 15:04
@dd-octo-sts dd-octo-sts Bot added the ddev label Jul 17, 2026
@luisorofino

Copy link
Copy Markdown
Contributor Author

@codex review

@dd-octo-sts

dd-octo-sts Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Validation Report

All 21 validations passed.

Show details
Validation Description Status
agent-reqs Verify check versions match the Agent requirements file
ci Validate CI configuration and code coverage settings
codeowners Validate every integration has a CODEOWNERS entry
config Validate default configuration files against spec.yaml
dep Verify dependency pins are consistent and Agent-compatible
http Validate integrations use the HTTP wrapper correctly
imports Validate check imports do not use deprecated modules
integration-style Validate check code style conventions
jmx-metrics Validate JMX metrics definition files and config
labeler Validate PR labeler config matches integration directories
legacy-signature Validate no integration uses the legacy Agent check signature
license-headers Validate Python files have proper license headers
licenses Validate third-party license attribution list
metadata Validate metadata.csv metric definitions
models Validate configuration data models match spec.yaml
openmetrics Validate OpenMetrics integrations disable the metric limit
package Validate Python package metadata and naming
qa-label Validate the pull request declares whether it needs QA for the next Agent release
readmes Validate README files have required sections
saved-views Validate saved view JSON file structure and fields
version Validate version consistency between package and changelog

View full run

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 70b9fb063d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

names = [flow_input.name for flow_input in inputs]
if len(names) != len(set(names)):
raise ValueError("Input names must be unique")
reserved_names = {flow_input.name for flow_input in BUILT_IN_FLOW_INPUTS}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reserve max_timeout as a built-in input name

When a flow declares a valid custom input named max_timeout, this validator lets it through because only BUILT_IN_FLOW_INPUTS (prd) are reserved. The launch modal renders declared inputs with id="input-{name}" and then always adds the built-in timeout field with id="input-max_timeout", so that flow ends up with duplicate widget IDs / an ambiguous #input-max_timeout lookup and cannot reliably launch. Please also reserve max_timeout or give the built-in field an ID that cannot collide with flow inputs.

Useful? React with 👍 / 👎.

@AAraKKe AAraKKe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks Luis! I think we are mixing reposibilities and that is why so much code needs to change. Take a look at the comment on the models.

We want to inject them where inputs live, always. Every integration needs a prd and the timeout to run, so we just inject them at validation (is intended to modify values as well, not only raise errors) and everything else will adapt to it. Define the max timeout as a number.

Comment on lines +221 to +223
reserved_names = {flow_input.name for flow_input in BUILT_IN_FLOW_INPUTS}
if conflicts := sorted(set(names) & reserved_names):
raise ValueError(f"Input names are reserved for built-in launch inputs: {conflicts}")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

request: instead of simply validating them, inject them if they are not there. Both pr and max timeout. The validator can be used to modify the variables. The reason is that at the moment you are defining the built in inputs here but then in variables you need to handle them as well, generating a coupling between specific inputs and variables, which did not exist at the moment.

If in validation, when a prd and max_timeout input are not defined, you inject them here, the rest of the code stays unchanged, because the model is the only one responsible for having its inputs.

You don't even need to modify the TUI layer. The reason we are is because we are bypassing the owner of the inputs being the flow and we are defining a set of inputs outside of their natural ownership layer.

Comment on lines +116 to +119
yield Label(f"{PRD_INPUT.label.upper()} ({PRD_INPUT.input_type.value})", classes="eyebrow")
yield from self._widget_for(PRD_INPUT)
yield Label("MAX TIMEOUT (SECONDS)", classes="eyebrow")
yield Input(placeholder="Leave empty for unbounded", id=MAX_TIMEOUT_INPUT_ID)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

note: this would not exist if the 2 mandatory inputs already came from inputs.

file_access_policy=FileAccessPolicy(write_root=write_root),
callbacks=callbacks,
resume=self.resume,
max_timeout=self.max_timeout,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

note: this would be just get the timeout from the run_time variables because it will always be here, and if not, pass None.

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

Labels

ddev qa/skip-qa Automatically skip this PR for the next QA team/agent-integrations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants