Skip to content

Add agent templates — split quick-launch from job automation - #515

Merged
selfcontained merged 11 commits into
mainfrom
agt_f57635c9589e/agent-c9589e
May 11, 2026
Merged

Add agent templates — split quick-launch from job automation#515
selfcontained merged 11 commits into
mainfrom
agt_f57635c9589e/agent-c9589e

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Summary

  • Templates are now first-class entities — reusable agent launch configs with prompt, agent type, worktree settings, and optional runtime arguments ({{D:Arg Name}} syntax). Callable templates appear in Cmd+K for quick launch.
  • Jobs now reference a backing template for agent config, keeping automation concerns (schedule, timeout, singleton, structured reporting, auto-archive) separate from launch config.
  • Automations pane replaces the Jobs pane with a tabbed sidebar (Templates | Jobs). Legacy /jobs URLs redirect to /automations/jobs.

Backend

  • New templates table, store, service, and API routes (CRUD + launch)
  • Migration creates backing templates for all existing jobs
  • JobService.runJob reads agent config from backing template; job CRUD auto-syncs the backing template
  • template.changed SSE event for real-time UI updates

Frontend

  • Automations pane with Templates and Jobs tabs
  • Template create/edit dialogs with live {{D:...}} argument detection
  • Template detail view with argument inputs and launch button
  • Cmd+K palette shows callable templates (replaces callable jobs)
  • Nav item renamed from "Jobs" to "Automations"

Other

  • Updated in-app docs (docs/17-jobs.md)
  • Updated E2E tests for new nav structure and callable templates

Closes DIS-140

Test plan

  • pnpm run check — type checking passes
  • pnpm run finalize:web — web build succeeds
  • pnpm run test — all 926 unit tests pass
  • pnpm run test:e2e — all 140 E2E tests pass (10 skipped)
  • Playwright UI validation — Templates tab, Jobs tab, /jobs redirect all render correctly

🤖 Generated with Claude Code

selfcontainedand others added 11 commits May 10, 2026 11:22
Introduces templates as first-class entities for reusable agent launch
configs. Templates appear in Cmd+K, support runtime arguments ({{D:...}}
syntax), and launch normal agent sessions without supervision. Jobs now
reference a backing template for agent config, keeping automation
(schedule, timeout, singleton, reporting) separate from launch config.
- Backend: templates table, store, service, API routes, migration
that creates backing templates for all existing jobs
- Jobs refactor: reads agent config from backing template at run time,
job CRUD auto-syncs backing template
- Frontend: Automations pane with tabbed sidebar (Templates | Jobs),
template create/edit/launch UI, Cmd+K shows callable templates
- Nav: "Jobs" renamed to "Automations", /jobs redirects preserved
- SSE: template.changed event for real-time UI updates
- Docs: updated 17-jobs.md → Automations: Templates & Jobs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Change TemplateListItem outer element from <button> to <div role="button">
to avoid nested <button> DOM validation warning
- Add migration test that seeds jobs pre-0021, applies the template
migration, and verifies backing templates are created correctly with
all config fields preserved
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Create dialog now uses the same components as create-agent: Command
combobox for agent type, PathInput with label, BranchSelect for
worktree branches, bordered checkbox sections with descriptions for
worktree and full access, and a styled textarea for prompt.
Detail pane replaces the read-only view + edit dialog with an
always-editable inline form (matching jobs SettingsTab pattern):
all fields are directly editable with a Save button, plus a
destructive Delete section at the bottom.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Consistent sidebar styling: templates match jobs flat-list pattern with
sliding tab indicator animation (framer-motion layoutId)
- Launch speed: return full agent record from launch endpoint, optimistic
cache update via setQueryData, navigate before awaiting invalidation
- Cmd+K: callable templates replace callable jobs, with arg-aware launch
dialog flow
- Launch dialog: flex-row-reverse for Tab-to-Launch-first, form wrapping
for Enter-to-submit
- Update repo docs (17-jobs.md) and in-product docs (docs-pane.tsx) to
cover the templates/jobs split under Automations
- Fix E2E overflow test for tabbed automations sidebar
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- DELETE /api/v1/templates/:id returns 404/409 instead of blanket 500
- addJob cleans up backing template if job creation fails (orphan guard)
- Extract sanitizeAgentName to shared/lib/agent-strings.ts
- Fix shortPath to use platform-agnostic last-3-segments approach
- Remove duplicate useTemplates() in agents-view; resolve template in
useAgentHotkeys and return it directly
- Add cross-reference comments for mirrored parseTemplateArgs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Consolidate error-code classification into shared helper for all
template routes (404/409/400/500 based on error message)
- Use fresh regex instances in parseTemplateArgs/substituteArgs to
avoid shared /g lastIndex state
- Fix initialPins filter to use nullish check (!=) instead of truthy
check, so empty-string arg values still produce pins
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Show all templates in sidebar (not just callable), fixing unreachable
templates when "Show in command palette" is unchecked
- Add loading skeleton while templates query is in flight, preventing
flash of empty state
- Replace inline "Settings saved" banner with a toast notification
- Increase play button touch target from p-1 to p-2
- Keep delete confirmation dialog open until mutation settles, disable
buttons while pending
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add callable checkbox to template create dialog so users can control
visibility in Cmd+K. Move launch arg inputs inline in the detail pane
header instead of requiring a separate dialog. Add release-readiness
review persona for deployment safety reviews.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Show required arguments as a read-only callout in the template detail
header. The actual arg input form stays in the LaunchTemplateDialog,
keeping the detail pane uncluttered.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Routes the templates migration through assisted-update so the operator
can confirm migration 0021 applied cleanly and the service is healthy.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The job list items have role="button" and names containing "Job",
causing getByRole('button', { name: 'Jobs' }) to match all items.
Use exact: true to target only the tab button.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@selfcontained
selfcontained merged commit aefd785 into mainMay 11, 2026
1 check passed
@selfcontained
selfcontained deleted the agt_f57635c9589e/agent-c9589e branch May 11, 2026 03:59
selfcontained added a commit that referenced this pull request Jul 17, 2026
…istory card (#790)
- Jobs no longer appear in the Cmd+K palette (removed in the #515
template split); reword the 'Show in command palette' bullet to match
actual behavior (callable badge only).
- Job prompts never collect arguments at run time; placeholders are only
substituted from API-saved default values. Preamble wording tightened
(it includes job/run IDs, not the job name).
- Job detail tab is labeled Configure, not Settings.
- Sidebar job cards show status + schedule + enabled state, not finished
time or next fire time; the Jobs overview lists upcoming runs.
- Add ambient tip for job webhook triggers.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for freeto 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

@selfcontained