Skip to content

Routines: stop auto-provisioning delivery workbenches; fix Agents/Routines classification - #277

Merged
TheGreatAxios merged 6 commits into
mainfrom
cl-routines-setup
Aug 22, 2026
Merged

Routines: stop auto-provisioning delivery workbenches; fix Agents/Routines classification#277
TheGreatAxios merged 6 commits into
mainfrom
cl-routines-setup

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

  • Routines never auto-provision a delivery workbench anymore. Creating a routine with no deliveryWorkbenchId, for a workflow whose result requires delivery, used to mint a brand-new workbench named after the routine — the mechanism behind the "Daily digest" / "New Workbench" workbenches polluting a tenant's own workbench list (owner-reported, 10th time). A routine's destination is now always a workbench a person named on the request, or (on Myra's own routine surface) the conversation it was asked from — never one invented on its behalf. Missing a destination for a workflow that needs one is a plain 400, not a silent mint.
  • ensureDefaultRoutines (tenant seed) no longer assumes a workbench. It already had a generic "the definition needs input this preset can't pre-fill" skip path for a 400; this distinguishes the delivery-required 400 and logs an honest, specific message instead of silently getting an auto-provisioned workbench under the old behavior.
  • The Agents page no longer lists routine-only workflows. workbench-digest ("Daily digest") and last-30-days-research ("Last 30 days research") are seeded as routines but were showing up in the Agents list because purposeAgentDefinitions only filtered out workbench-host plumbing, not non-conversational catalog utilities. Fixed by also checking isConversationalWorkflowName — the same test the sidebar's DM list already applies. The actual distinguishing property between an agent and a routine is conversational (can a person DM it), not automatable (can it be scheduled) — those are orthogonal.

What this does NOT do (scope cut for time)

  • No UI picker yet for choosing/changing a routine's destination workbench after creation. deliveryWorkbenchId already exists as the field to extend — the panel (apps/web/src/shell/routine-panel.tsx) and detail page (apps/web/src/pages/routine-detail-page.tsx) still infer it implicitly (the workbench the panel was opened beside, or Myra's own default) rather than offering an explicit "any workbench" picker with edit-afterwards. Needs a follow-up.
  • The "Run now on an unmet-credential routine" → setup-affordance item from the original brief was not reached this pass.

Migration / existing data

Checked the owner's live Postgres (routines.routine): 3 tenants already have "Daily digest" + "Last 30 days research" rows, each pair sharing one already-auto-provisioned delivery_workbench_id per tenant. This change touches no existing rows — those routines keep delivering exactly where they already do. Only future creates (new tenant seeds, or any routine created with no workbench named) stop auto-provisioning; for a brand-new tenant, the two presets will now be skipped at seed time (logged honestly) until someone creates them by hand with a real destination, since there's no "home workbench" to default to at seed time.

Test plan

  • bun test packages/agent-directory packages/routines packages/hub-client — 634 pass, 0 fail
  • bun run typecheck clean in packages/routines, packages/hub-client, packages/agent-directory, apps/hub
  • bunx prettier --write on all changed files (no-op, already formatted)

…s research)

purposeAgentDefinitions dropped workbench-host plumbing but nothing
else, so any non-conversational workflow-catalog utility seeded as a
routine (workbench-digest, last-30-days-research) also passed through
and showed up in the Agents list even though it was never chattable.
Filter on isConversationalWorkflowName, the same test the sidebar's DM
list already applies, so a routine-only workflow only ever shows up on
the Routines page.
A routine created with no deliveryWorkbenchId for a workflow that
requires delivery used to get a brand-new workbench minted on its
behalf, named after the routine — the source of the "Daily digest" /
"New Workbench" workbenches polluting a tenant's own workbench list.
A routine's destination must always be a workbench a person picked or
was actually talking in, never one invented and named after the
routine.

Removes the deliverySpace/DeliverySpacePort auto-provisioning path
from both POST /routines (tenant-session) and Myra's own
workflow-authenticated routine surface. Delivery-target precedence is
now just: the workbench named on the request, then (Myra's surface
only) the creating conversation's own workbench, then a plain 400 —
never a mint-and-compensate fallback.
…sses a workbench

ensureDefaultRoutines named no delivery workbench for the first preset
it seeds, relying on the hub's now-removed auto-provisioning to invent
one. With that gone, distinguish the hub's "deliveryWorkbenchId is
required" 400 from the existing "input required" skip case and log it
plainly: the preset isn't planted until a member creates it by hand
and picks a real destination, rather than a fabricated one.
…vision one

Both routine-creation route mounts wired provisionSpaceWorkbench as
the deliverySpace port. That port no longer exists on either routes
surface, so drop the wiring and the now-unused import.
TheGreatAxios added a commit that referenced this pull request Aug 21, 2026
A concurrent lane's classification fix landed here by mistake; it belongs
to its own change (PR #277) rather than to the tool-package freshness
guard.
@TheGreatAxios
TheGreatAxios merged commit ac2ea8e into main Aug 22, 2026
5 checks passed
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