Workflow enhacements#454
Conversation
… campaign Adds a TypeScript workflow that orchestrates 9 agents (Claude lead + code-reviewer, 7 Codex workers) across 5 implementation tiers to make the relay broker-sdk workflow system decisively superior to Agno and Swarms AI. Agents: - lead (claude): orchestrates, approves trajectories, reviews each phase - code-reviewer (claude): independent review after every phase - spec-analyst, schema-implementer, engine-implementer, meta-implementer, storage-implementer, deploy-implementer, test-validator (all codex) 23-step DAG with 11 review gates (6 lead + 5 independent code reviews): - Phase 0: codebase analysis + spec approval - Phase 1: TypeScript type system extension (condition/loop/router/hitl/sub-workflow) - Phase 2: execution engine (CEL conditions, session state, input validation) - Phase 3+4: meta-orchestration + storage backends (parallel) - Phase 5: HTTP serve, OTel tracing, CLI improvements - Phase 6: integration validation + final capability audit Key design decisions: - RELAY_API_KEY optional (runner auto-provisions via Relaycast) - All agent tasks use withExit() to call relay_remove_agent MCP tool on completion, resolving waitForExit() via the released event Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…orkflow-superiority-spec
…orkflow-superiority-spec
… self-termination
- Add PTY-based output capture in runner.ts to collect agent terminal output
instead of relying on file-based summaries
- Auto-generate dedicated workflow channels (wf-{name}-{id}) instead of using
shared 'general' channel
- Change agent self-termination from remove_agent MCP call to /exit PTY output
to avoid workspace misalignment issues
- Add run_init handler for agent.release_requested WebSocket events in main.rs
- Add listen --all flag to subscribe to all workspace channels
- Remove RELAY_API_KEY from .mcp.json and snippets.rs (MCP server now reads
from .agent-relay/relaycast.json credential file)
- Parallelize review steps and remove withExit() in workflow-superiority.ts
- Add step output persistence to disk and Relaycast channel messages
- Validate Relaycast API keys before trusting cached credentials
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Import stripAnsi from pty.ts instead of maintaining incomplete duplicate regex - Wrap spawnAndWait in try/finally to prevent log stream fd leaks on errors - Re-key PTY maps if broker assigns a different agent name than requested - Clean up PTY resources in execute()/resume() finally blocks - Fix test asserting RELAY_API_KEY in .mcp.json (now intentionally omitted) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Registers the new workflow building skill in the prpm package manifest. The skill covers WorkflowBuilder API, DAG step dependencies, step output chaining, verification gates, and swarm patterns. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
| headers: { | ||
| authorization: `Bearer ${apiKey}`, | ||
| 'content-type': 'application/json', | ||
| }, |
Check warning
Code scanning / CodeQL
File data in outbound network request Medium
Non-interactive agents run as simple subprocesses (no PTY, no relay messaging) for faster fan-out/map-reduce patterns. Each CLI has a one-shot flag (claude -p, codex exec, gemini -p, etc). Agents with interactive: false are excluded from coordinator topology edges and lead agents are informed which workers can't receive messages. - Add interactive?: boolean to AgentDefinition and AgentOptions - Add opencode and droid to AgentCli union - Add buildNonInteractiveCommand() with CLI flag mapping - Add execNonInteractive() subprocess execution path - Branch in spawnAndWait() based on interactive flag - Exclude non-interactive agents from coordinator topology edges - Append non-interactive awareness to lead agent tasks - Add workers.json interactive metadata field - Update workflow skill documentation - Add unit tests for command builder and topology changes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…sistence Addresses three issues from Devin's code review: 1. Race condition on workers.json (registerWorker/unregisterWorker): - Added in-memory Map to track active workers - Added promise-based mutex to serialize file access - Prevents lost entries when parallel steps run concurrently 2. Log file name mismatch after broker re-keying: - Close old log stream and rename file when broker assigns different name - Open new log stream with correct name - Update listener to use new stream 3. Channel not persisted for resume(): - Persist auto-generated channel back to run config in DB - Ensures resume() reuses the original channel instead of generating new one Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…ement - Update schema.json with interactive field and opencode/droid CLIs - Add non-interactive agents section to workflows README - Set interactive: false on worker agents in all 6 builtin templates - Fix DAG topology to filter non-interactive agents from stepEdges - Add DAG non-interactive test to coordinator tests - Add strong deliverable enforcement instructions for non-interactive tasks Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ss text
- Add abort signal wiring to execNonInteractive so runner.abort() kills child
- Fix buildNonInteractiveAwareness to show actual {{steps.X.output}} refs
- Fix pickHub to prefer interactive agents as hub (avoid non-interactive hubs)
- Add missing {{steps.X.output}} chaining in builtin templates:
- documentation: draft←gather-context, edit←draft
- refactor: refactor-code←design, validate←refactor-code
- security-audit: verify←remediate
- code-review: consolidate←all review passes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| Architecture review: {{steps.architecture-pass.output}} | ||
| Correctness review: {{steps.correctness-pass.output}} | ||
| Security review: {{steps.security-pass.output}} |
There was a problem hiding this comment.
🔴 YAML indentation error causes review outputs to be parsed as step-level keys instead of task content
In the code-review.yaml builtin template, the newly added lines referencing step outputs (Architecture review:, Correctness review:, Security review:) are indented at the same level as the task: key (10 spaces), not inside the YAML block scalar (12 spaces). This means YAML will parse them as new mapping keys at the step object level rather than as part of the task string.
Root Cause and Impact
The task: | block scalar at packages/broker-sdk/src/workflows/builtin-templates/code-review.yaml:66 requires its content to be indented more than the key itself. The original content line Produce merged findings... is correctly at 12 spaces, but the three new lines are at 10 spaces — the same level as task:, agent:, dependsOn:, etc.
YAML parsing will treat the added lines as separate keys in the step mapping:
# What YAML actually sees:
- name: consolidate
task: | # block scalar content is ONLY "Produce merged..."
Produce merged findings, severity levels, and final recommendation.
Architecture review: "{{steps.architecture-pass.output}}" # ← new key!
Correctness review: "{{steps.correctness-pass.output}}" # ← new key!
Security review: "{{steps.security-pass.output}}" # ← new key!Impact: The consolidation step's task will NOT include the review outputs from prior steps. Since the WorkflowStep schema has additionalProperties: false, this would also fail JSON Schema validation. Even without strict validation, the agent performing the consolidation step receives no review context, making the entire code-review workflow's final step useless.
| Architecture review: {{steps.architecture-pass.output}} | |
| Correctness review: {{steps.correctness-pass.output}} | |
| Security review: {{steps.security-pass.output}} | |
| Architecture review: {{steps.architecture-pass.output}} | |
| Correctness review: {{steps.correctness-pass.output}} | |
| Security review: {{steps.security-pass.output}} |
Was this helpful? React with 👍 or 👎 to provide feedback.
…orkforce/relay into feature/workflow-superiority-spec
Summary
This PR introduces significant enhancements to the relay broker-sdk workflow system, making it more robust for multi-agent orchestration.
Key Changes
{{steps.X.output}}wf-{name}-{id}channels for workflow isolation instead of using sharedgeneralchannelremove_agentMCP call to/exitPTY output to avoid workspace misalignment issuesRELAY_API_KEYis now optional - runner auto-provisions via Relaycast and validates API keys before trusting cached credentials@agent-relay/mcpto@relaycast/mcpwith credential file-based authenticationrun_inithandler foragent.release_requestedWebSocket events andlisten --allflagfinallyblocks and PTY map re-keying when broker assigns different agent namesNew Features
WorkflowBuilderAPIworkflow-superiority.tsdemonstrating a 9-agent, 23-step DAG campaignFiles Changed
.claude/skills/writing-agent-relay-workflows/SKILL.mdpackages/broker-sdk/src/workflows/runner.tspackages/broker-sdk/src/examples/workflow-superiority.tssrc/main.rs--allflag.mcp.jsonpackages/broker-sdk/src/relaycast.tsTest plan
wf-{name}-{id}format/exitPTY outputlisten --allflag subscribes to all workspace channels🤖 Generated with Claude Code