Skip to content

# Summary#49

Merged
Wangggym merged 2 commits intomasterfrom
ym/Summary
Jan 26, 2026
Merged

# Summary#49
Wangggym merged 2 commits intomasterfrom
ym/Summary

Conversation

@Wangggym
Copy link
Copy Markdown
Owner

@Wangggym Wangggym commented Jan 26, 2026

PR Ready

Types of changes

  • feat
  • refactor

Note

Introduces multi-provider AI support and improves the PR creation workflow with non-interactive options and AI-generated titles.

  • New qkflow ai commands: status, switch, and set to manage providers (auto, cerebras, deepseek, openai), show active provider, and configure keys/URLs
  • Config schema updates: add cerebras_key, cerebras_url, ai_provider; bind env vars; set defaults; persist on save
  • AI client: provider selection logic (auto priority: Cerebras > DeepSeek > OpenAI), URL normalization, and model choices
  • PR creation: new flags --pr-desc, --types, --no-ticket, --title; AI-based title generation with helpers; PR body includes optional description; refined Jira linking and first-time status mapping handling for non-interactive runs; removes web editor/file upload flow
  • config command output: displays AI provider mode, active provider, and related keys/URLs

Written by Cursor Bugbot for commit 708eb01. This will update automatically on new commits. Configure here.

@Wangggym
Copy link
Copy Markdown
Owner Author

Summary

Enhanced qkflow pr create command with non-interactive support for AI-powered PR creation workflow, and added new AI provider management commands.

Changes

  • Added AI provider management commands (qkflow ai)

    • qkflow ai - View current AI provider status
    • qkflow ai switch [provider] - Switch between AI providers (cerebras, deepseek, openai, auto)
    • qkflow ai set [key] [value] - Configure AI provider settings
  • Enhanced pr create command

    • Added --pr-desc flag for passing AI-generated PR descriptions
    • Added --types flag for non-interactive change type selection
    • Removed editor dependency (no more web editor)
    • PR description automatically added as GitHub comment and Jira comment when provided
    • Smart status mapping handling (requires interactive setup first time)
  • Improved AI client

    • Extended AI client to support multiple providers
    • Enhanced configuration management

Context

This change enables automation of PR creation through Cursor Skill integration, allowing AI to automatically generate PR descriptions and determine change types based on code analysis.

Test Plan

  1. Test qkflow ai commands:

    • qkflow ai - Should show current provider status
    • qkflow ai switch cerebras - Should switch provider
    • qkflow ai set cerebras-key test-key - Should set configuration
  2. Test qkflow pr create with new flags:

    • qkflow pr create --types "feat" --pr-desc "Test description"
    • Verify PR is created with provided description
    • Verify description is added as comment
  3. Test interactive mode still works:

    • qkflow pr create (without flags)
    • Should prompt for types and description

@Wangggym Wangggym merged commit f18c8eb into master Jan 26, 2026
1 check passed
@Wangggym Wangggym deleted the ym/Summary branch January 26, 2026 08:09
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 6 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.


// 检查各种可能的格式
if strings.HasPrefix(titleLower, prTypeLower+":") ||
strings.HasPrefix(titleLower, capitalizeFirst(prType)+":") {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Dead code in prefix check condition

Low Severity

The second condition in the OR expression at line 551 (strings.HasPrefix(titleLower, capitalizeFirst(prType)+":")) can never evaluate to true. Since titleLower is always lowercase (produced by strings.ToLower(title)) and capitalizeFirst(prType) always returns a string starting with an uppercase letter, comparing titleLower with capitalizeFirst(prType)+":" will never match. This makes the second half of the OR condition dead code.

Fix in Cursor Fix in Web

if err := config.Save(cfg); err != nil {
ui.Error(fmt.Sprintf("Failed to save configuration: %v", err))
return
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Success message displayed before config save completes

Low Severity

The runAISet function displays success messages (e.g., "Cerebras API key set successfully") in the switch cases before config.Save(cfg) is called. If the save operation fails on line 213, users will see both the success message and the subsequent error message, creating a misleading user experience.

Fix in Cursor Fix in Web

}

// 没有前缀,添加
return fmt.Sprintf("%s: %s", capitalizeFirst(prType), title)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Inconsistent spacing when reformatting title prefixes

Low Severity

The ensureTitlePrefix function uses inconsistent formatting: when reformatting an existing prefix (line 555), it uses "%s:%s" (no space after colon), but when adding a new prefix (line 561), it uses "%s: %s" (with space after colon). This causes titles like "feat:fix bug" to become "Feat:fix bug" while "fix bug" becomes "Feat: fix bug", resulting in inconsistent output formatting.

Fix in Cursor Fix in Web

titleText = line
break
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Title extraction fails with blank line after Summary

Medium Severity

When extracting a title from prDesc, if there's an empty line immediately after "## Summary", the code takes that empty line as titleText, then breaks out of the loop with an empty string. The fallback logic then uses "Summary" as the title instead of the actual content. For input like "## Summary\n\nActual content", the title becomes "Summary" instead of "Actual content".

Fix in Cursor Fix in Web

return s
}
return s[:maxLen-3] + "..."
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

String truncation corrupts multi-byte UTF-8 characters

Medium Severity

The truncateString function uses len(s) (byte count) and byte-based slicing s[:maxLen-3]. For strings containing multi-byte UTF-8 characters (Chinese, emojis, etc.), this can slice in the middle of a character, producing invalid UTF-8. Given the codebase includes AI translation from Chinese and titles may contain non-ASCII characters, this could corrupt PR titles.

Fix in Cursor Fix in Web

if len(editorResult.Files) > 0 {
for _, file := range editorResult.Files {
os.Remove(file)
ui.Success("PR link added to Jira")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Silent failure when Jira client creation fails

Low Severity

The new code block at lines 337-348 silently ignores errors when jira.NewClient() fails. If the client creation fails, the code simply does nothing—no warning or error is shown to the user. This contrasts with the existing pattern at lines 351-355 which explicitly warns users when client creation fails. Users won't know why the PR comment wasn't added to Jira.

Fix in Cursor Fix in Web

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