Expose job & template CRUD as MCP tools for agents (#DIS-163) - #593
Merged
Conversation
Add 11 MCP tools that let agents create, read, update, delete, and run jobs and templates directly. Tools are available to both regular agents and job agents, but excluded from persona/review agents. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
3 tasks
selfcontained added a commit
that referenced
this pull request
Aug 8, 2026
Architecture review flagged two literal-reading hazards: the Linux staging/activation steps were phrased unconditionally, so an already-fixed Linux entrypoint could be steered into a manual cutover that bypasses the managed update; and the platform-generic .previous preservation step, read after the Linux cutover, would overwrite the run's only rollback artifact with the target binary. Instructions are now explicit branches: Branch A (Linux already-fixed: managed update only), Branch B (Linux legacy pinned: staged cutover before first restart, with "never overwrite the .previous this step created"), Branch C (macOS bridge, including the deleted-inode .previous recovery and plist work), plus shared restart-safety, hygiene, and verification steps keyed to their branches. architecture-review #593 items #1263 #1264. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
selfcontained added a commit
that referenced
this pull request
Aug 8, 2026
…896) * Harden assisted update against legacy pinned-symlink Linux installs On ≤v0.31.x Linux installs whose ExecStart resolves through a symlink hard-pinned to a versioned dist/bun binary, the managed-update-first ordering in migration 0010 extracted the target release but restarted back into the old runtime, whose boot-time release-binary pruning then deleted the new artifact — while validations false-greened because they trusted release.json rather than the running executable. - Reorder migration 0010 for Linux legacy shapes: inspect the entrypoint first and perform the fixed-runtime cutover (stage exact checksum- verified target, preserve .previous, activate fixed path, repoint ExecStart) BEFORE the first restart; macOS keeps the launchd bridge. Adds legacy bin/dispatch symlink + unit-backup hygiene and makes rollback prefer the fixed runtime .previous over legacy unit backups. - New running_version required check that proves the actually running executable via the X-Dispatch-Version header; the assisted framework enforces it implicitly at launch and at check-run time (manifests can't name it yet — pre-v0.33 parsers reject unknown check names). - expected_runtime_artifact now uses lstat and rejects a symlinked fixed runtime path. - Manifest requiredChecks schema accepts unknown well-formed names so future check additions can't silently drop a whole migration on older installs; unknown names fail closed at run time instead. A test guards that shipped manifests stay within the legacy-parser-safe set. - VM fixture script (scripts/vm-fixtures/legacy-pinned-symlink.sh) that converts a healthy Linux install into the pinned-symlink legacy shape for the documented VM validation row. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Ensure KillMode=process lands before 0010's Linux cutover restart On a legacy host both fixed-runtime-entrypoint (0010) and agent-restart-safety (0011) are pending and run in numeric order, so 0010's new cutover restart happened before 0011 added KillMode=process — terminating the tmux-backed assisted agent inside dispatch.service's control group at exactly that first restart. 0010 now adds KillMode=process + daemon-reload as a required pre-restart step (the only permitted unit change besides the ExecStart repoint), intentionally front-running 0011. 0011's alreadySatisfied is now config-based (systemctl show -p KillMode, no behavioral restart probe), non-systemd hosts are an explicit no-op terminal state, and its instructions acknowledge 0010 may have already applied the setting. Review feedback from the Ubuntu VM validation agent on PR #896. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Preflight fixture dependencies before destructive conversion python3 was first invoked after the fixture had already pinned the symlink, rewritten the unit, and removed the fixed runtime — a VM without Python would be stranded half-converted with migrations still marked applied. Preflight python3/systemctl/sed/ln/cp and the user systemd manager before touching anything, and make the applied-migrations rewrite atomic (tmp + os.replace). infra-review #592 item #1262. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Make 0010's platform/shape branches explicit Architecture review flagged two literal-reading hazards: the Linux staging/activation steps were phrased unconditionally, so an already-fixed Linux entrypoint could be steered into a manual cutover that bypasses the managed update; and the platform-generic .previous preservation step, read after the Linux cutover, would overwrite the run's only rollback artifact with the target binary. Instructions are now explicit branches: Branch A (Linux already-fixed: managed update only), Branch B (Linux legacy pinned: staged cutover before first restart, with "never overwrite the .previous this step created"), Branch C (macOS bridge, including the deleted-inode .previous recovery and plist work), plus shared restart-safety, hygiene, and verification steps keyed to their branches. architecture-review #593 items #1263 #1264. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
list_jobs,get_job,create_job,update_job,delete_job,run_job,list_templates,get_template,create_template,update_template,delete_template) that let agents manage jobs and templates programmaticallyImplementation
crud-tools.ts: Registers all 11 tools with Zod schemas, following the existing tool registration pattern (brain-tools, job-tools, etc.)server.ts(MCP): Adds tool names toAGENT_TOOLSandJOB_TOOLSsets, addscrudToolsfield toMcpRequestContext, callsregisterCrudToolsroutes/mcp.ts: AddstemplateServiceto deps, builds CRUD callbacks viabuildCrudCallbacks()helper, wires into both job-scoped and agent-scoped MCP routesserver.ts(main): PassestemplateServiceinto MCP route depsgetJobById/getJobByNametoJobServiceandgetTemplateByNametoTemplateServicefor ID and name-based lookupsTest plan
pnpm run check)pnpm run test)pnpm run test:e2e— 155 passed, 12 pre-existing skips)create_job→list_jobs→get_job→update_job→delete_jobcreate_template→list_templates→get_template→update_template→delete_template