Skip to content

Conversation

@zhing2006
Copy link
Contributor

@zhing2006 zhing2006 commented Jan 25, 2026

Summary

  • Add \s* to parseTasksFile regex to handle trailing whitespace in task lines
  • Add missing projectRoot argument to resolveSchema call in generateApplyInstructions

Test plan

  • Verify task parsing works with lines containing trailing whitespace
  • Verify generateApplyInstructions correctly resolves schema with project root

Summary by CodeRabbit

  • Bug Fixes
    • Improved task parsing to gracefully handle trailing whitespace in task items
    • Enhanced schema resolution to better utilize project context for improved accuracy

✏️ Tip: You can customize this high-level summary in your review settings.

- Add \s* to parseTasksFile regex to handle trailing whitespace in task lines
- Add missing projectRoot argument to resolveSchema call in generateApplyInstructions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@zhing2006 zhing2006 requested a review from TabishB as a code owner January 25, 2026 02:35
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 25, 2026

📝 Walkthrough

Walkthrough

Updated task parsing regex in workflow instructions to handle trailing whitespace at line endings. Modified the apply-instruction schema lookup to pass the projectRoot parameter to resolveSchema, enabling schema resolution with project context awareness.

Changes

Cohort / File(s) Summary
Workflow instruction schema resolution
src/commands/workflow/instructions.ts
Updated task parsing regex to tolerate trailing whitespace; adjusted apply-instruction schema lookup to include projectRoot parameter for context-aware schema resolution

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

🐰 A regex brushed clean of trailing space dust,
And projectRoot passed down—oh, such trust!
Schema knows context, instructions align,
Small tweaks, big clarity—this code will shine! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the two main changes: fixing regex trailing whitespace handling and adding a missing projectRoot parameter.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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 and usage tips.

@vibe-kanban-cloud
Copy link

Review Complete

Your review story is ready!

View Story

Comment !reviewfast on this PR to re-generate the story.

@greptile-apps
Copy link

greptile-apps bot commented Jan 25, 2026

Greptile Overview

Greptile Summary

Fixed two issues in the workflow instructions module: updated the task parsing regex to properly handle trailing whitespace in task lines, and added the missing projectRoot parameter to the resolveSchema() call to enable correct project-local schema resolution.

  • Regex fix (line 224): Added \s* suffix to the checkbox matching pattern, allowing task lines with trailing whitespace to be properly parsed
  • Parameter fix (line 317): Added projectRoot argument to resolveSchema() call, matching the pattern used throughout the codebase for project-local schema resolution

Both changes are focused bug fixes that improve robustness without altering functionality.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Both changes are straightforward bug fixes with clear intent: the regex fix enables parsing of task lines with trailing whitespace (a common edge case), and the projectRoot parameter addition aligns with the established pattern used in 3 other locations in the codebase. The fixes are minimal, targeted, and improve robustness without introducing new functionality or complexity.
  • No files require special attention

Important Files Changed

Filename Overview
src/commands/workflow/instructions.ts Fixed regex to handle trailing whitespace in task parsing and added missing projectRoot parameter to resolveSchema call

Sequence Diagram

sequenceDiagram
    participant User
    participant applyInstructionsCommand
    participant generateApplyInstructions
    participant resolveSchema
    participant parseTasksFile
    participant TaskFile as tasks.md

    User->>applyInstructionsCommand: Request apply instructions
    applyInstructionsCommand->>generateApplyInstructions: Call with projectRoot, changeName
    generateApplyInstructions->>resolveSchema: Call with schemaName, projectRoot
    Note over resolveSchema: FIX: Now receives projectRoot parameter<br/>for project-local schema resolution
    resolveSchema-->>generateApplyInstructions: Return schema config
    generateApplyInstructions->>TaskFile: Read tracking file (if exists)
    TaskFile-->>generateApplyInstructions: Return file content
    generateApplyInstructions->>parseTasksFile: Parse task content
    Note over parseTasksFile: FIX: Regex now handles trailing<br/>whitespace with \s*$ pattern
    parseTasksFile-->>generateApplyInstructions: Return parsed tasks
    generateApplyInstructions-->>applyInstructionsCommand: Return ApplyInstructions
    applyInstructionsCommand-->>User: Display instructions
Loading

Copy link
Contributor

@TabishB TabishB left a comment

Choose a reason for hiding this comment

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

Thank you for the fix 🫶

@TabishB TabishB merged commit 26ed336 into Fission-AI:main Jan 25, 2026
10 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.

2 participants