Skip to content

feat: hierarchical dispatch model for meta orchestrator#99

Open
m2ux wants to merge 31 commits intomainfrom
feature/hierarchical-dispatch
Open

feat: hierarchical dispatch model for meta orchestrator#99
m2ux wants to merge 31 commits intomainfrom
feature/hierarchical-dispatch

Conversation

@m2ux
Copy link
Copy Markdown
Owner

@m2ux m2ux commented Apr 8, 2026

Summary

  • Implements a persistent master orchestrator model where the meta workflow dispatches client workflows to independent sub-agents instead of abandoning the meta session
  • Adds dispatch_workflow and get_workflow_status MCP tools for creating independent client sessions with parent-child correlation
  • Replaces the old meta activity flow (start-workflowresume-workflow) with dispatch-workflow that manages client lifecycle inline (dispatch → await result → handle checkpoints → evaluate transitions)
  • Sessions are never shared — meta agent holds the meta token, client agents hold their own client tokens

Key Changes

Server code:

  • SessionPayload.psid — optional parent SID field for trace correlation
  • dispatch_workflow tool — creates client session, generates dispatch package (token, prompt, metadata)
  • get_workflow_status tool — polls client session status without requiring its token

Workflow data:

  • New 02-dispatch-workflow.toon activity with 7-step inline dispatch lifecycle
  • Updated 10-orchestrator-management.toon with dispatch-client, handle-client-checkpoint, process-client-result phases
  • Updated 11-worker-management.toon for independent client agents with checkpoint yield protocol
  • Updated 05-worker-prompt-template.md for client agents using their own session tokens
  • New 09-client-dispatch-protocol.md documenting the dispatch → manage → complete lifecycle
  • Updated 03-end-workflow.toon to verify all dispatched clients completed

Tests:

  • 13 new tests covering psid propagation, dispatch session creation, status extraction, parent-child correlation, and recursive dispatch

Test plan

  • npm run typecheck passes
  • npm test passes (28 tests total, 13 new)
  • Manual test: start a meta session, dispatch a client workflow, verify checkpoint yield chain works end-to-end
  • Verify client session independence — no token cross-contamination
  • Verify trace correlation: parent SID appears in client session payload

m2ux added 21 commits April 8, 2026 11:43
- Add psid (parent_sid) to SessionPayload for parent-child session correlation
- Add dispatch_workflow tool: creates independent client sessions with dispatch packages
- Add get_workflow_status tool: polls client workflow status without sharing tokens
- Replace meta workflow activities (start-workflow → dispatch-workflow)
- Update orchestrator/worker management skills for inline dispatch-and-manage pattern
- Add client dispatch protocol documentation
- Update worker prompt template for independent client agents
- Add tests for dispatch, status, and parent-child correlation

Made-with: Cursor
…ma violations

Update test workflow paths from ../workflows to ../.engineering/workflows to
match the current project layout. Update engineering submodule pointer to
include meta workflow fixes (missing version/name on dispatch-workflow, missing
YAML frontmatter on 6 resource files).

Made-with: Cursor
- Make executionModel optional in Zod and JSON schemas
- Remove executionModel from meta workflow
- Update refine guard to handle undefined executionModel
- Fix missing response object in dispatch_workflow tool handler
- Update test to accept workflows without executionModel

Made-with: Cursor
- Ensure all prompt content is loaded from the workflow resource (meta/05)
- Throw error if template fails to load rather than falling back to hardcoded strings
- Add support for {initial_activity} placeholder substitution

Made-with: Cursor
- Update dispatch_workflow tool to use activity-orchestrator prompt
- Update tests for renamed workflow-orchestrator and activity-worker skills
- Update .engineering submodule reference

Made-with: Cursor
m2ux pushed a commit that referenced this pull request Apr 8, 2026
Mike added 8 commits April 8, 2026 20:21
Made-with: Cursor
Made-with: Cursor
Reverts changes made in a previous commit that pointed `WORKFLOW_DIR`
to `.engineering/workflows`. The correct path is `workflows`, which
is an active worktree containing the workflow files.

Made-with: Cursor
The discover tool's output of available_workflows duplicates the
functionality of list_workflows and was confusing. Removing it focuses
discover on providing the server identity and bootstrap procedure.

Made-with: Cursor
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