Skip to content

feat(workflow): expose dynamic workflows through MCP - #98

Merged
Waishnav merged 67 commits into
pr/dw-4-cli-workerfrom
pr/dw-5-mcp-skill
Jul 27, 2026
Merged

Waishnav merged 67 commits into
pr/dw-4-cli-workerfrom
pr/dw-5-mcp-skill

Conversation

@Waishnav

@Waishnav Waishnav commented Jul 21, 2026 •

Copy link
Copy Markdown
Owner

Dynamic Workflows were reachable only from the local CLI, so an MCP client could not start or follow durable runs without dropping down to shell commands. The model also lacked focused guidance for choosing workflows and available local-agent providers.

Expose run, status, and cancellation through MCP while keeping execution in the detached worker, so workflows continue after an MCP request disconnects. Add the Dynamic Workflows skill, seed the bundled agent skills consistently, and introduce runtime provider availability to guide workflow execution.

Stack

Based on #97 and merged into #94 before provider-native structured output in #99.

Waishnav and others added 3 commits July 21, 2026 17:42
Always include bundled skills root when subagents enabled so seeding
subagent-delegation no longer hides later skills. Seed dynamic-workflows
alongside subagent-delegation on init.

Co-Authored-By: Claude <noreply@anthropic.com>
Load ordered enable-list from config/env, probe available providers on
init and doctor, and filter workflow CLI providers by enabled∩live.

Co-Authored-By: Claude <noreply@anthropic.com>
Gate on config.subagents. run_workflow spawns the same detached worker
as CLI; status long-polls journal events; cancel requests cooperative stop.

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 21, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 38401585-7d31-43df-a24e-6165b003ebcd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pr/dw-5-mcp-skill

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread src/workflow-tools.ts
title: "Workflow status",
description: "Drain events for a workflow run; optional long-poll yield.",
inputSchema: {
runId: z.string(),

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Status is authorized only by a global runId and is not scoped back to the open workspace. Please include workspaceId (or enforce equivalent ownership) and verify the run's workspaceId/root before returning events. The same check is needed for cancel and resume.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentionally not adopting mandatory workspace-scoped status/cancel authorization. DevSpace workflows are also a portable dynamic-workflow layer for Cursor, Pi, OpenCode, and other harnesses that may invoke CLI/MCP without owning a DevSpace workspaceId. runId remains the durable cross-harness handle by product decision. Filesystem confinement is handled separately through project-local workflow resolution rather than making workspace IDs mandatory.

Comment thread src/workflow-tools.ts Outdated
const run = store.requestCancel(runId);
if (run.pid && (run.status === "running" || run.status === "starting")) {
try {
process.kill(run.pid, "SIGTERM");

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P0] MCP cancellation has no grace-period supervision or hard-kill/terminal fallback. It sends one SIGTERM and can leave the database row running forever if the worker dies before journaling. Please reuse the same shared cancellation supervisor as the CLI and guarantee run_cancelled plus terminal status.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed by follow-up PR #115. MCP and CLI now call the same cancelWorkflowRun() supervisor, including cooperative grace, cross-platform process-tree termination, hard-kill escalation, and an atomic run_cancelled terminal fallback. MCP cancellation no longer returns after a single best-effort SIGTERM.

@Waishnav

Copy link
Copy Markdown
Owner Author

agentProviders.enabled is currently applied inside workflow execution, but the rest of the agent surface is inconsistent: open_workspace still advertises every live provider and one-shot agent paths can use providers that the user disabled. Please centralize provider policy and reuse it for workflows, agents run, open_workspace, and doctor.

This PR also needs integration coverage for MCP disconnect survival, cancellation reaching a terminal state, paginated terminal event draining, and provider-config filtering.

Waishnav added 3 commits July 21, 2026 22:55
Wire LocalAgentRunInput.schema through CodexSdkLocalAgentRuntime to
thread.run turn options, and surface parsed structured output.
Pass JSON Schema via outputFormat on query options and prefer
structured_output from result messages. OpenCode stays prompt-path only.
Hardcode NATIVE_SCHEMA_PROVIDERS; attempt 0 uses adapter schema without
prompt bloat, then prompt-repair retries with Ajv. Wire schema through
runProvider / CLI worker. Document in skill.
Waishnav added 24 commits July 27, 2026 13:01
refactor(agents): unify provider resolution and subagent guidance
feat(workflow): support agent profiles and project workflows
fix(workflow): replay deterministic call prefixes
fix(workflow): supervise cancellation and terminal lifecycle
feat(workflow): isolate workflow script execution
feat(ui): live workspace and workflow dashboards
feat(workflow): read-only project workflow TUI
feat(workflow): script iteration, replay provenance, and call inspection
refactor(workflow): model operational failures with better-result
refactor(workflow): strengthen contracts and zod boundaries
feat(agents): native schema for codex/claude agent({ schema })
@Waishnav
Waishnav marked this pull request as ready for review July 27, 2026 15:05
@Waishnav
Waishnav merged commit 171d43f into pr/dw-4-cli-worker Jul 27, 2026
1 check was pending
@Waishnav Waishnav changed the title feat(workflow): MCP tools, skill, agentProviders feat(workflow): expose dynamic workflows through MCP Jul 30, 2026
SoloistHart pushed a commit to SoloistHart/autoclip that referenced this pull request Sep 27, 2026
…veable in Docker / script mode (Waishnav#100) (Waishnav#102)

* fix(frontend): survive browser page translation instead of crashing the whole tree (Waishnav#100)

Chrome / Edge 'Translate this page' replaces text nodes with <font> wrappers;
React's next removeChild / insertBefore on those nodes throws NotFoundError and
the ErrorBoundary unmounts everything. Guard both DOM methods before mount
(per react/react#11538) so displaced nodes are skipped rather than fatal.

ErrorBoundary now detects the translation case and tells the user (zh/en) to
turn translation off; its fallback page is redone per DESIGN.md (no purple
gradient / AntD Result, single-tone card + Btn primitives) and 'back home'
actually navigates under HashRouter.

Co-authored-by: Kris K <zhouxiaoka@users.noreply.github.com>

* feat(settings): make the settings page work in Docker / script mode (Waishnav#100)

GET/PUT /settings, /test-api, /current-provider, /compatible-models,
/available-models, /validation, /reset and DELETE / no longer require desktop
mode. settings.json lands in get_data_directory() (./data in Docker) and the
API process + Celery worker already hot-reload on mtime, so the same code path
works for every deployment shape. Desktop-only endpoints (data-dir migration,
backup/restore, import/export, config sync) keep the guard.

When no settings.json exists yet, GET /settings reflects the provider / model /
base_url the LLM manager actually resolved from env (LLM_PROVIDER etc.) instead
of always showing dashscope.

Frontend SettingsPage drops the web-mode read-only short-circuit; also removes
the unused eslint-disable directive that has kept CI red on main (Waishnav#99).

Adds backend/tests/test_settings_web_mode.py (6 cases).

Co-authored-by: Kris K <zhouxiaoka@users.noreply.github.com>

* docs: record Waishnav#100 fix, 2026-09-20 issue/PR triage and schedule feature requests into v1.3 / v1.4

HANDOFF: root-cause note for Waishnav#100, per-issue disposition table, external PR
decisions (Waishnav#97 Waishnav#98 Waishnav#99 merge, Waishnav#101 hold for i18n scaffold), and new v1.3 items
(fail-like-failure, i18n scaffold, dashscope intl, DESIGN.md debt list) plus
v1.4 items (pluggable ASR / scoring backends, Sentry). DOCKER.md: settings can
now be saved from the web UI; env vars are defaults only.

Co-authored-by: Kris K <zhouxiaoka@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Kris K <zhouxiaoka@users.noreply.github.com>
SoloistHart pushed a commit to SoloistHart/autoclip that referenced this pull request Sep 27, 2026
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