[Improve] Reuse task prompts as automations - #1649
Conversation
|
2 issues outstanding. See task
Reviewed 371d021 |
| <MessageAction | ||
| tooltip="Save as automation" | ||
| onClick={() => { | ||
| window.location.href = `${SETTINGS_PATHS.automations}?prompt=${encodeURIComponent(automationPrompt)}`; |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
What changed
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