Skip to content

feat(workflow): script iteration, replay provenance, and call inspection - #108

Merged
Waishnav merged 53 commits into
pr/dw-8-result-errorsfrom
pr/dw-9-resume-iteration-inspection
Jul 27, 2026
Merged

feat(workflow): script iteration, replay provenance, and call inspection#108
Waishnav merged 53 commits into
pr/dw-8-result-errorsfrom
pr/dw-9-resume-iteration-inspection

Conversation

@Waishnav

@Waishnav Waishnav commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • stop promoting the placeholder budget primitive in the Dynamic Workflows skill
  • make persisted workflow scripts first-class across CLI/MCP, including scriptPath + resumeFromRunId
  • recompute script hashes after edits and snapshot every invocation into its own run directory
  • persist replay provenance and miss explanations (same_index vs compatible_key)
  • add workflow calls / workflow call inspection commands and MCP call summaries
  • teach the edit → inspect → resume recovery loop and filesystem side-effect caveat

Stack

Test plan

  • npm run typecheck
  • npm test
  • npm run build
  • git diff --check
  • replay tests cover same-index, compatible-key, consumed results, and changed prompt explanations
  • store tests cover prompt/schema/replay/error provenance persistence

Summary by CodeRabbit

  • New Features

    • Added commands to inspect workflow calls and detailed call results.
    • Workflow status and tool responses now include agent-call summaries.
    • Workflows can be resumed with an updated script source.
    • Replay tracking now shows whether results were reused and their source.
  • Bug Fixes

    • Improved replay matching for reordered or changed workflow calls.
    • Failed and cancelled runs now resume as new runs with clearer diagnostics.
  • Documentation

    • Updated workflow CLI usage, replay guidance, and API examples.

@coderabbitai

coderabbitai Bot commented Jul 25, 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: 018239d9-a2c1-48f8-80f8-b95cd983032f

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-9-resume-iteration-inspection

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
src/workflow-tools.ts (1)

360-369: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate call-summary aggregation logic; see consolidated comment.

Identical counting logic to formatCallSummary in src/workflow-cli.ts. Also, the parameter type ReturnType<ReturnType<typeof createWorkflowStore>["listAgentCalls"]> could be simplified to WorkflowAgentCallRecord[] for readability.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/workflow-tools.ts` around lines 360 - 369, Remove the duplicate
summarizeCalls aggregation in summarizeCalls and reuse the consolidated
formatCallSummary logic from workflow-cli.ts. Simplify the call parameter type
to WorkflowAgentCallRecord[] while preserving the existing reused, live, failed,
running, and total counts.
src/workflow-cli.ts (1)

584-592: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate call-summary aggregation logic.

formatCallSummary here duplicates summarizeCalls in src/workflow-tools.ts (identical reused/live/failed/running/total logic against WorkflowAgentCallRecord[]). Consider extracting a shared helper (e.g., in workflow-types.ts or workflow-store.ts) both files can import.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/workflow-cli.ts` around lines 584 - 592, Consolidate the duplicated
call-summary aggregation by extracting the shared
reused/live/failed/running/total logic from formatCallSummary and summarizeCalls
into one reusable helper in an appropriate shared module. Update both callers to
use that helper while preserving the existing summary values and output
formatting.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/workflow-cli.ts`:
- Around line 143-156: Update the nameHint assignment in the workflow resume
flow so an override using file or name uses resolved.nameHint, while a plain
resume preserves prior.name. Remove the unreachable "nameHint" in resolved
fallback check, and apply the same behavior consistently with the corresponding
workflow-tools logic.

In `@src/workflow-tools.ts`:
- Around line 113-136: Update the resume else-branch in the workflow setup to
use the freshly resolved file’s nameHint from readWorkflowScriptFileResult.value
when an explicit overridePath is provided, while preserving prior.name when
resuming without an override. Keep source, scriptHash, and priorScriptPath
handling unchanged.

---

Nitpick comments:
In `@src/workflow-cli.ts`:
- Around line 584-592: Consolidate the duplicated call-summary aggregation by
extracting the shared reused/live/failed/running/total logic from
formatCallSummary and summarizeCalls into one reusable helper in an appropriate
shared module. Update both callers to use that helper while preserving the
existing summary values and output formatting.

In `@src/workflow-tools.ts`:
- Around line 360-369: Remove the duplicate summarizeCalls aggregation in
summarizeCalls and reuse the consolidated formatCallSummary logic from
workflow-cli.ts. Simplify the call parameter type to WorkflowAgentCallRecord[]
while preserving the existing reused, live, failed, running, and total counts.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8e5e8ac0-3761-4e3b-a7ba-4475c6d0a786

📥 Commits

Reviewing files that changed from the base of the PR and between d5b00f5 and 058297b.

📒 Files selected for processing (13)
  • skills/dynamic-workflows/SKILL.md
  • src/db/migrations.ts
  • src/db/schema.ts
  • src/oauth-store.test.ts
  • src/workflow-api.ts
  • src/workflow-cli.ts
  • src/workflow-contracts.ts
  • src/workflow-replay.test.ts
  • src/workflow-replay.ts
  • src/workflow-store.test.ts
  • src/workflow-store.ts
  • src/workflow-tools.ts
  • src/workflow-types.ts

Comment thread src/workflow-cli.ts Outdated
Comment thread src/workflow-tools.ts
Waishnav added 27 commits July 27, 2026 12:43
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
@Waishnav
Waishnav merged commit 1a6764d into pr/dw-8-result-errors Jul 27, 2026
4 checks passed
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