feat(personas): minimal Mode 1 workflow DSL E2E persona#161
Conversation
Adds personas/e2e-mode1-workflow — a typed Mode 1 (workflow-DSL handler) persona that listens for GitHub `issues.opened` on AgentWorkforce/cloud labeled `workflow-test`, materializes a 3-step deterministic workflow DSL DAG via ctx.files.write, invokes it via ctx.workflow.run, and posts two GitHub comments back via ctx.github.comment carrying the workflow's computed output (the issue body's first line). Exists to prove the Mode 1 path (proactive trigger -> handler -> ctx.workflow.run -> cloud workflows API -> daytona DAG -> completion poll -> back-channel write) end-to-end with the smallest possible workflow — three deterministic steps with inter-step data flow through a known /tmp working dir. No clone, no agent step, no PR machinery. Authored as persona.ts via definePersona, compiled to persona.json via `agentworkforce persona compile`. Mirrors the structure of the sibling e2e-mode2-hello persona but adds the workflow-DSL invocation tier. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reached
More reviews will be available in 54 minutes and 38 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
1 issue found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="personas/e2e-mode1-workflow/agent.ts">
<violation number="1" location="personas/e2e-mode1-workflow/agent.ts:232">
P2: Marker parse break on object output. JSON stringify adds escapes, regex can capture junk. Read plain stdout field before fallback.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| // ─── completion-output helpers ───────────────────────────────────────────── | ||
|
|
||
| function extractFirstLineMarker(output: unknown): string | null { | ||
| const text = typeof output === 'string' ? output : safeStringify(output); |
There was a problem hiding this comment.
P2: Marker parse break on object output. JSON stringify adds escapes, regex can capture junk. Read plain stdout field before fallback.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At personas/e2e-mode1-workflow/agent.ts, line 232:
<comment>Marker parse break on object output. JSON stringify adds escapes, regex can capture junk. Read plain stdout field before fallback.</comment>
<file context>
@@ -0,0 +1,281 @@
+// ─── completion-output helpers ─────────────────────────────────────────────
+
+function extractFirstLineMarker(output: unknown): string | null {
+ const text = typeof output === 'string' ? output : safeStringify(output);
+ if (!text) return null;
+ const match = text.match(/E2E_MODE1_FIRST_LINE=([^\n\r]*)/);
</file context>
Summary
personas/e2e-mode1-workflow— a typed Mode 1 (workflow-DSL) persona that proves thectx.workflow.run(...)execution path end-to-end with the smallest possible workflow.ctx.files.write('workflows/<name>.ts', ...), invokes it viactx.workflow.run(...), awaitscompletion(), then writes back two GitHub comments viactx.github.comment— one ack carrying the run id, one carrying the workflow-computed first line of the issue body.persona.tsviadefinePersona, compiled topersona.jsonviaagentworkforce persona compile. Mirrors the siblinge2e-mode2-hellopersona's shape but adds the workflow-DSL tier on top.Mode 1 vs. Mode 2
Per
project_proactive_agent_three_modes:@agent-relay/sdk/workflowsDSL is a builder (workflow(name).pattern('dag').step(...).step(...).run()) authored as a separate.tsfile underworkflows/. The persona handler is a thin orchestrator that materializes the DSL source and callsctx.workflow.run(name, args), which POSTs the source to the cloud workflows API for execution in daytona.persona-kitdoes NOT have a first-classworkflow:/steps:field onPersonaSpec— Mode 1 lives as an external workflow source invoked by the handler.personas/e2e-mode2-hello. Singleagent.tshandler that does everything inline. No workflow invocation.The split here (workflow DSL does compute; handler does integration writeback via
ctx.github.comment) is the canonical pattern shown incloud-small-issue-codex's production-shipped agent. The DSL has no first-class "post GitHub comment" primitive — providers are reached through the runtime'sctx.<provider>clients on the handler side.The workflow DAG
Three deterministic shell steps with explicit
dependsOnedges that exercise inter-step data flow:extract-body— writesevent.payload.issue.bodyto/tmp/e2e-mode1-<n>/body.txt.acknowledge— depends onextract-body. Reads body.txt's byte count, writes ack.txt. Proves step 2 sees step 1's filesystem effects.summarize— depends onacknowledge. Reads body.txt, extracts the first non-empty line, writes summary.txt AND echoes it to stdout with a stable marker (E2E_MODE1_FIRST_LINE=...) so the handler can recover it fromcompletion.output.Deploy
Live E2E status
Live trigger fire is gated on the cloud-side snapshot fix (cloud#1349, currently open) landing + deploying. The persona is authored, compiled, and successfully deployed to the cloud — but firing a
workflow-test-labeled issue will not exercise the full path until the daytona sandbox can boot the workflow runtime cleanly again.Test plan
persona compileproduces a validpersona.jsonwithonEvent: ./agent.tsand the githubissues.openedtrigger.deploy --mode cloud --on-exists updatereturns a deployment id and reportsok(verified twice — initial + clean redeploy after dropping the unknownissues.labeledtrigger).workflow-testlabel and confirm both comments arrive in step order. Blocked on cloud#1349 deploy.Implementation notes / gotchas
harness: 'codex'+model: 'gpt-5'+systemPromptare stubbed even though this is a pure-handler persona that never callsctx.harness.run. The cloud-side validator requires them (rejects400 invalid_personaotherwise), even thoughpersona-kit's parser is fine with omitting them for handler-style personas. Mirrorse2e-mode2-hello's shape.issues.labeledfrom the triggers (warned by the deploy linter: "not in the known-trigger registry for github"). Re-firing requires close+reopen rather than re-adding the label.🤖 Generated with Claude Code