You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follows #51. Once repository support lands for preset endpoints, we should record the repository configuration (and other preset-specific data) in a generic metadata field that the UI can consume.
Background
Preset automations (/v1/preset/prompt and /v1/preset/plugin) are built from user-provided configuration that gets packaged into a tarball. Currently, only the prompt field is stored on the Automation model (see models.py:56). The generated tarball contains additional configuration that would be useful for the UI to display and for users to understand what their automation does:
Summary
Follows #51. Once repository support lands for preset endpoints, we should record the repository configuration (and other preset-specific data) in a generic metadata field that the UI can consume.
Background
Preset automations (
/v1/preset/promptand/v1/preset/plugin) are built from user-provided configuration that gets packaged into a tarball. Currently, only thepromptfield is stored on theAutomationmodel (seemodels.py:56). The generated tarball contains additional configuration that would be useful for the UI to display and for users to understand what their automation does:PluginSourcelist used by/v1/preset/plugin(stored inplugins_config.jsoninside tarball)Proposal
Add a
preset_metadataJSONB column to theAutomationmodel:Metadata Schema
The field is intentionally generic to accommodate future presets:
{ "preset_type": "prompt" | "plugin", "prompt": "...", "plugins": [{"source": "github:owner/repo", "ref": "v1.0.0"}], "repos": [{"url": "OpenHands/repo", "ref": "main"}] }For prompt presets:
preset_type,prompt,repos(once #51 lands)For plugin presets:
preset_type,prompt,plugins,reposChanges Required
models.py— Addpreset_metadataJSONB columnschemas.py— Addpreset_metadata: dict | NonetoAutomationResponsepreset_router.py— Populatepreset_metadatawhen creating automations:{"preset_type": "prompt", "prompt": body.prompt, "repos": [...]}{"preset_type": "plugin", "prompt": body.prompt, "plugins": [...], "repos": [...]}Note
This does not apply to custom SDK automations (created via
/v1with a user-uploaded tarball), which will havepreset_metadata = NULL.This issue was created by an AI assistant (OpenHands).