Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jul 21, 2025

This PR fixes issue #5999 where the Kimi K2 model immediately marks tasks as completed without actually performing any fixes.

Changes Made

  1. Added validation in attemptCompletionTool to check if actual work was done before allowing completion

    • Checks if any tools were used or files were edited
    • Specifically targets Kimi K2 models through case-insensitive model ID detection
  2. Added model-specific instructions in the system prompt for Kimi K2 models

    • Instructs the model to complete implementation before using attempt_completion
    • Emphasizes the need to perform actual work before marking tasks complete
  3. Added telemetry tracking for premature completion attempts

    • Tracks when Kimi K2 models attempt to complete without doing work
    • Helps monitor the effectiveness of this fix
  4. Comprehensive test coverage for the new validation logic

    • Tests various scenarios including tool usage, file edits, and model detection
    • Ensures the fix works correctly for Kimi K2 while not affecting other models

Testing

  • All existing tests pass
  • Added new test suite specifically for Kimi K2 validation
  • Manually tested the validation logic

Fixes #5999


Important

Adds validation to ensure Kimi K2 model performs actions before marking tasks as complete, with model-specific instructions and telemetry tracking.

  • Behavior:
    • Adds validation in attemptCompletionTool to ensure Kimi K2 model performs actions before task completion.
    • Checks for tool usage or file edits before allowing completion.
    • Targets Kimi K2 models using case-insensitive model ID detection.
  • Prompts:
    • Adds Kimi K2 specific instructions in getRulesSection() in rules.ts.
    • Instructs model to complete implementation before using attempt_completion.
  • Telemetry:
    • Tracks premature completion attempts for Kimi K2 models in attemptCompletionTool.
  • Testing:
    • Adds comprehensive tests in attemptCompletionTool.spec.ts for Kimi K2 validation logic.
    • Tests scenarios including tool usage, file edits, and model detection.

This description was created by Ellipsis for 74d6c57. You can customize this summary. It will automatically update as commits are pushed.

…ctions

- Add validation in attempt_completion to check if actual work was done
- Add model-specific instructions in system prompt for Kimi K2
- Track premature completion attempts via telemetry
- Add comprehensive tests for the new validation logic

Fixes #5999
@roomote roomote bot requested review from cte, jr and mrubens as code owners July 21, 2025 09:33
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Jul 21, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 21, 2025
@M-505
Copy link

M-505 commented Jul 21, 2025

will this be merged ?

@daniel-lxs
Copy link
Member

This is not how we should fix this, it seems that this is a problem with the AI model itself, not Roo Code

@daniel-lxs daniel-lxs closed this Jul 22, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 22, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

kimi k2 unable to delegate task and immediatly completing it

5 participants