Skip to content

[Improve] Reuse task prompts as automations - #1649

Draft
roomote-roomote[bot] wants to merge 1 commit into
developfrom
improve/save-message-as-automation
Draft

[Improve] Reuse task prompts as automations#1649
roomote-roomote[bot] wants to merge 1 commit into
developfrom
improve/save-message-as-automation

Conversation

@roomote-roomote

Copy link
Copy Markdown
Contributor

​Opened on behalf of @mrubens. Follow up by mentioning @roomote-roomote, in the web UI, or in Slack.

What changed

  • Added an admin-only Save as automation action to normal user-authored task prompts.
  • Opened the existing custom automation editor with the selected prompt prefilled exactly, including whitespace and special characters.
  • Removed the prompt from the browser URL after the editor consumes it, while preserving unrelated query parameters.
  • Kept the action off assistant messages, structured input responses, non-admin views, and prompts too large for safe URL navigation.

Why this change was made

Recurring agent instructions often end up scattered across scratch files because turning a proven prompt into a reusable workflow still requires manual copy/paste. Open work already covers a saved-prompt library, so this deliberately distinct improvement reuses Roomote's established custom automation workflow instead of introducing another prompt store.

Impact

Admins can turn an instruction from an existing task into a named, schedulable custom automation with one action and no intermediate clipboard step. The change uses the current automation persistence and execution paths; it adds no schema or backend subsystem. Focused interaction tests, web type checking, linting, formatting, and repository pre-push checks pass. Browser screenshots were attempted twice, but the seeded local admin was redirected to mandatory inference-provider setup before task history or automations could be reached, so no screenshot evidence is included.

Non-goals

  • No generic prompt library, folders, tags, sharing, versioning, or prompt-management page.
  • No changes to the saved-prompt work in #1605.
  • No changes to custom automation scheduling, execution, permissions, or storage semantics.
  • No expansion of custom automation creation to non-admin users.

@roomote-community

roomote-community Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

2 issues outstanding. See task

  • Do not put the task prompt in the automation URL, which exposes it before client-side cleanup. (apps/web/src/app/(sandbox)/task/[taskId]/messages/acp/AcpTextMessage.tsx:371)
  • Hide the automation action for empty or whitespace-only user prompts, which the destination cannot prefill. (apps/web/src/app/(sandbox)/task/[taskId]/messages/acp/AcpTextMessage.tsx:208)

Reviewed 371d021

<MessageAction
tooltip="Save as automation"
onClick={() => {
window.location.href = `${SETTINGS_PATHS.automations}?prompt=${encodeURIComponent(automationPrompt)}`;

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.

This puts the complete task prompt in the initial /automations?prompt=... request, where it can be retained by access logs, proxies, and browser history before replaceState runs. Task prompts can contain credentials or incident data, so the cleanup happens too late. Transfer the value through a client-side, one-time store rather than a URL query parameter.

isAdmin &&
isUser &&
msg.updateType === ACP_ENVELOPE_EVENT_TYPES.UserPrompt &&
baseContent.length <= MAX_AUTOMATION_PREFILL_LENGTH

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.

This also enables the action for empty or whitespace-only prompts. Image-only user messages render actions because msg.images is present, but the destination rejects ?prompt= at CustomAutomationsSection.tsx:529-532, leaving the user on Automations with no dialog. Require baseContent.trim().length > 0 before showing this action while still passing the untrimmed content through for valid prompts.

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