feat(workflow): script iteration, replay provenance, and call inspection - #108
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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.
Actionable comments posted: 2
🧹 Nitpick comments (2)
src/workflow-tools.ts (1)
360-369: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicate call-summary aggregation logic; see consolidated comment.
Identical counting logic to
formatCallSummaryinsrc/workflow-cli.ts. Also, the parameter typeReturnType<ReturnType<typeof createWorkflowStore>["listAgentCalls"]>could be simplified toWorkflowAgentCallRecord[]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 winDuplicate call-summary aggregation logic.
formatCallSummaryhere duplicatessummarizeCallsinsrc/workflow-tools.ts(identical reused/live/failed/running/total logic againstWorkflowAgentCallRecord[]). Consider extracting a shared helper (e.g., inworkflow-types.tsorworkflow-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
📒 Files selected for processing (13)
skills/dynamic-workflows/SKILL.mdsrc/db/migrations.tssrc/db/schema.tssrc/oauth-store.test.tssrc/workflow-api.tssrc/workflow-cli.tssrc/workflow-contracts.tssrc/workflow-replay.test.tssrc/workflow-replay.tssrc/workflow-store.test.tssrc/workflow-store.tssrc/workflow-tools.tssrc/workflow-types.ts
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
Resuming a workflow after changing its script was difficult to reason about because each invocation did not retain enough source and replay context, and users could not inspect why an agent call was reused or rerun. The skill also advertised a placeholder budget primitive that the runtime did not support.
Make persisted script paths and resume inputs first-class across CLI and MCP, snapshot each invocation, and recompute source identity after edits. Record replay provenance and miss explanations, expose call summaries and detailed inspection commands, and document an inspect → edit → resume recovery loop without changing the workflow primitive surface.
Stack
Based on #101 and merged into #94 before the project-scoped TUI in #111.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation