-
Notifications
You must be signed in to change notification settings - Fork 415
Enhancing task fixes with validation and retry #1630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughRestructures AI task configs into separate transform and workflow modules, adds an early-character streaming validator with retry/abort semantics, updates task-config types to use transformed args, adjusts task execution and UI header tooltip handling, and performs widespread dependency version bumps. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant Validator as EarlyValidatorFn
participant Wrapper as withEarlyValidationRetry
participant Stream as executeStream
participant OnRetry as onRetry
Caller->>Wrapper: iterate generator (options: minChar, maxChar, maxRetries)
loop attempts (<= maxRetries)
Wrapper->>Stream: call executeStream(signal, attemptContext)
loop stream chunks
Stream-->>Wrapper: yield TextStreamPart (text-delta / other)
Wrapper->>Wrapper: buffer text-delta, track trimmed length
alt buffered length >= minChar
Wrapper->>Validator: validate(accumulatedText)
alt validator returns valid
Validator-->>Wrapper: { valid: true }
Wrapper-->>Caller: yield buffered chunks (when flush conditions met)
else validator returns invalid
Validator-->>Wrapper: { valid: false, feedback }
Wrapper->>Stream: abort current stream (signal.abort)
alt retries remain
Wrapper->>OnRetry: call onRetry(feedback, attempt)
OnRetry-->>Wrapper: continue (store previousFeedback)
else no retries left
Wrapper-->>Caller: throw validation error
end
end
end
end
alt stream ends and no retry
Wrapper-->>Caller: complete
end
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes
Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (1 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/desktop/src/store/zustand/ai-task/task-configs/enhance-transform.ts (1)
173-188: Prevent NaNs when transcript start times are missing.
Math.min(...Array.from(transcriptMap.values()))producesNaNas soon as one transcript lacks astarted_atvalue (the map storesundefined, andMath.min(undefined, …)⇒NaN). Once that happens everystart_ms/end_mswe emit becomesNaN, so the downstream enhance workflow receives unusable timing data. Please coerce the stored values to numbers (e.g. default to0) before computing the minimum.Apply this diff:
- const sessionStartMs = transcriptIds.length > 0 - ? Math.min(...Array.from(transcriptMap.values())) - : 0; + const transcriptStarts = Array.from(transcriptMap.values()).map((value) => + typeof value === "number" ? value : 0, + ); + const sessionStartMs = transcriptStarts.length > 0 + ? Math.min(...transcriptStarts) + : 0;
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (20)
apps/desktop/package.json(4 hunks)apps/desktop/src/components/main/body/sessions/note-input/header.tsx(3 hunks)apps/desktop/src/store/zustand/ai-task/shared/validate.test.ts(1 hunks)apps/desktop/src/store/zustand/ai-task/shared/validate.ts(1 hunks)apps/desktop/src/store/zustand/ai-task/task-configs/enhance-transform.ts(3 hunks)apps/desktop/src/store/zustand/ai-task/task-configs/enhance-workflow.ts(1 hunks)apps/desktop/src/store/zustand/ai-task/task-configs/index.ts(4 hunks)apps/desktop/src/store/zustand/ai-task/task-configs/title-transform.ts(1 hunks)apps/desktop/src/store/zustand/ai-task/task-configs/title-workflow.ts(1 hunks)apps/desktop/src/store/zustand/ai-task/task-configs/title.ts(0 hunks)apps/desktop/src/store/zustand/ai-task/tasks.ts(2 hunks)apps/pro/package.json(1 hunks)apps/web/package.json(2 hunks)package.json(1 hunks)packages/codemirror/package.json(1 hunks)packages/db/package.json(1 hunks)packages/obsidian/package.json(1 hunks)packages/tiptap/package.json(2 hunks)packages/ui/package.json(2 hunks)packages/utils/package.json(1 hunks)
💤 Files with no reviewable changes (1)
- apps/desktop/src/store/zustand/ai-task/task-configs/title.ts
🧰 Additional context used
🧬 Code graph analysis (7)
apps/desktop/src/store/zustand/ai-task/task-configs/title-transform.ts (1)
apps/desktop/src/store/zustand/ai-task/task-configs/index.ts (3)
TaskConfig(64-73)TaskArgsMap(15-18)TaskArgsMapTransformed(20-53)
apps/desktop/src/components/main/body/sessions/note-input/header.tsx (3)
packages/ui/src/components/ui/tooltip.tsx (3)
Tooltip(32-32)TooltipTrigger(32-32)TooltipContent(32-32)packages/ui/src/components/ui/popover.tsx (1)
PopoverTrigger(29-29)packages/utils/src/cn.ts (1)
cn(20-22)
apps/desktop/src/store/zustand/ai-task/task-configs/title-workflow.ts (1)
apps/desktop/src/store/zustand/ai-task/task-configs/index.ts (2)
TaskConfig(64-73)TaskArgsMapTransformed(20-53)
apps/desktop/src/store/zustand/ai-task/task-configs/index.ts (5)
apps/desktop/src/store/tinybase/schema-external.ts (1)
Template(123-123)apps/desktop/src/store/zustand/ai-task/task-configs/enhance-workflow.ts (1)
enhanceWorkflow(10-13)apps/desktop/src/store/zustand/ai-task/task-configs/enhance-transform.ts (1)
enhanceTransform(6-8)apps/desktop/src/store/zustand/ai-task/task-configs/title-workflow.ts (1)
titleWorkflow(6-9)apps/desktop/src/store/zustand/ai-task/task-configs/title-transform.ts (1)
titleTransform(4-6)
apps/desktop/src/store/zustand/ai-task/task-configs/enhance-transform.ts (1)
apps/desktop/src/store/zustand/ai-task/task-configs/index.ts (3)
TaskConfig(64-73)TaskArgsMap(15-18)TaskArgsMapTransformed(20-53)
apps/desktop/src/store/zustand/ai-task/shared/validate.test.ts (1)
apps/desktop/src/store/zustand/ai-task/shared/validate.ts (2)
EarlyValidatorFn(3-3)withEarlyValidationRetry(5-90)
apps/desktop/src/store/zustand/ai-task/task-configs/enhance-workflow.ts (4)
apps/desktop/src/store/zustand/ai-task/task-configs/index.ts (2)
TaskConfig(64-73)TaskArgsMapTransformed(20-53)apps/desktop/src/store/zustand/ai-task/shared/transform_impl.ts (1)
trimBeforeMarker(4-70)apps/desktop/src/store/tinybase/schema-external.ts (1)
templateSectionSchema(75-78)apps/desktop/src/store/zustand/ai-task/shared/validate.ts (2)
withEarlyValidationRetry(5-90)EarlyValidatorFn(3-3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: ci (macos, macos-14)
🔇 Additional comments (9)
packages/db/package.json (1)
23-23: LGTM. Simple patch-level update to @types/node with no conflicts.package.json (1)
8-8: LGTM. Minor version bump for turbo build orchestration tool is safe.apps/pro/package.json (1)
11-13: LGTM. Minor/patch-level updates to Hono MCP integration and Model Context Protocol SDK.packages/obsidian/package.json (1)
20-20: LGTM. Patch update to @tanstack/react-query, consistent with other packages.apps/desktop/package.json (2)
18-25: Significant major version upgrades require verification. React 19.2.0, xstate 5.24.0, and zod 4.1.12 each introduce breaking changes. Verify that:
- React 19 migration is complete (ref callbacks, removed propTypes, JSX transform, etc. per React 19 docs)
- xstate 5.24.0 state machine configurations are updated
- zod 4.1.12 schema definitions use unified error customization where applicable
Also applies to: 53-56, 71-71, 76-76, 82-83, 90-91
96-98: @tanstack/router-plugin and router-devtools bumped to 1.134.12. Ensure this version is compatible with @tanstack/react-router@^1.134.12 in dependencies (line 55).packages/utils/package.json (1)
7-7: LGTM. Patch-level updates to AI SDK packages, aligned with new validation/retry features in desktop app.Also applies to: 15-15
packages/ui/package.json (1)
23-37: LGTM. Patch/minor updates to Radix UI components, form handling, and type definitions. All changes are safe and maintain React 19 compatibility.Also applies to: 47-47, 54-55
packages/codemirror/package.json (1)
15-19: LGTM. Patch-level updates to CodeMirror editor dependencies and tooling. peerDependencies correctly aligned with React 19.Also applies to: 22-22, 25-25
No description provided.