Skip to content

[Refactor] Unify custom automation writes - #1005

Draft
roomote-roomote[bot] wants to merge 1 commit into
developfrom
feature/unify-custom-automation-writes-36avdpdoo0e8u
Draft

[Refactor] Unify custom automation writes#1005
roomote-roomote[bot] wants to merge 1 commit into
developfrom
feature/unify-custom-automation-writes-36avdpdoo0e8u

Conversation

@roomote-roomote

Copy link
Copy Markdown
Contributor

Created by Roomote. Follow up by mentioning @roomote-roomote, in the web UI, or in Slack.

What changed

  • Added one typed SDK server service that owns custom automation create/update normalization, schedule resolution, model and destination validation, partial-update merging, and persistence error mapping.
  • Reduced the REST, web tRPC, and worker MCP paths to input adaptation and response mapping, while keeping the database layer focused on persistence.
  • Replaced API error-message pattern matching with stable domain error codes and added contract coverage for equivalent accepted and rejected writes across adapters.

Why this change was made

Custom automation writes had accumulated separate schedule, destination, model, update, and error contracts across several layers. Centralizing those invariants prevents transport-specific drift and makes contract changes local to one owning use case.

Impact

There is no intended user-facing behavior change. Custom automation writes now behave consistently across the web and MCP surfaces, and expected validation failures no longer depend on exact exception wording.

@roomote-community

roomote-community Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

1 issue outstanding. See task

  • apps/web/src/trpc/commands/automations/custom-automations.ts:145 — Editing a Teams destination cannot clear its service URL. The form omits blank URLs, but the new service interprets serviceUrl: undefined as “preserve existing”; that stale URL wins over the current Teams installation URL at run time. Before this refactor the web command rebuilt the target without metadata. Pass an explicit null for full web writes without a service URL, or otherwise distinguish this full-replacement path from partial updates.

Reviewed 581e950

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