Repository navigation
feat: summarize initial prompt to generate task title in background - #2363
daewoongoh wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one): 1
Please check the settings in the CodeRabbit UI or the
|
Review statusThanks for contributing. This comment tracks the review sequence and the next action. Current step: Fix the failing required CI checks; awaiting-maintainer requires CI and automated review completion. Review-state labels are managed by this workflow; do not edit them manually. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Changed-code mutation testingReport for PR head
Details: mutants, guidance, and reproductionChanged-code mutation testing
Focused tests
All surviving and uncovered mutantsWarning annotations highlight up to 20 unique locations (maximum 7 per file). This summary lists every advisory mutant. extension
|
Line | Status | Mutator | Replacement |
|---|---|---|---|
3203 | Survived | ConditionalExpression | false |
3203 | Survived | LogicalOperator | this.abort && this.abandoned |
3217 | Survived | ConditionalExpression | false |
3217 | Survived | LogicalOperator | (controller.signal.aborted || this.abort) && this.abandoned |
3217 | Survived | ConditionalExpression | false |
3217 | Survived | LogicalOperator | controller.signal.aborted && this.abort |
3222 | Survived | ConditionalExpression | false |
3227 | NoCoverage | UpdateOperator | i-- |
3227 | Survived | ConditionalExpression | false |
3227 | Survived | EqualityOperator | i <= 20 |
3227 | Survived | EqualityOperator | i >= 20 |
3228 | Survived | ConditionalExpression | false |
3228 | Survived | LogicalOperator | (controller.signal.aborted || this.abort) && this.abandoned |
3228 | Survived | ConditionalExpression | false |
3228 | Survived | LogicalOperator | controller.signal.aborted && this.abort |
3231 | Survived | ConditionalExpression | true |
3231 | Survived | ConditionalExpression | false |
3239 | Survived | OptionalChaining | existing.title |
3243 | Survived | ConditionalExpression | false |
3243 | Survived | LogicalOperator | (controller.signal.aborted || this.abort) && this.abandoned |
3243 | Survived | ConditionalExpression | false |
3243 | Survived | LogicalOperator | controller.signal.aborted && this.abort |
3249 | NoCoverage | StringLiteral | `` |
3251 | Survived | ConditionalExpression | true |
src/core/task/taskTitleGenerator.ts
Line | Status | Mutator | Replacement |
|---|---|---|---|
24 | Survived | MethodExpression | cleaned.replace(/^["'`]|["'`]$/g, "") |
24 | Survived | Regex | /["'`]|["'`]$/g |
24 | Survived | Regex | /^["'`]|["'`]/g |
26 | Survived | MethodExpression | cleaned.replace(/[.!?]+$/, "") |
26 | Survived | Regex | /[.!?]+/ |
28 | Survived | ConditionalExpression | true |
28 | Survived | EqualityOperator | cleaned.length >= MAX_TITLE_LENGTH |
29 | Survived | MethodExpression | cleaned.slice(0, MAX_TITLE_LENGTH) |
45 | Survived | OptionalChaining | prompt.trim |
62 | Survived | BlockStatement | {} |
63 | Survived | CallExpression | ; |
66 | Survived | ConditionalExpression | false |
67 | Survived | StringLiteral | "" |
67 | Survived | ObjectLiteral | {} |
67 | Survived | BooleanLiteral | false |
84 | Survived | ConditionalExpression | false |
84 | Survived | LogicalOperator | controller.signal.aborted && parentSignal?.aborted |
92 | Survived | StringLiteral | "" |
95 | Survived | CallExpression | ; |
96 | Survived | ConditionalExpression | false |
97 | Survived | StringLiteral | "" |
webview
webview-ui/src/context/ExtensionStateContext.tsx
Line | Status | Mutator | Replacement |
|---|---|---|---|
617 | Survived | ConditionalExpression | true |
617 | Survived | ConditionalExpression | false |
617 | Survived | EqualityOperator | prevState.currentTaskItem?.id !== item.id |
Resolve a mutation gap
Add or strengthen a focused test that fails under the mutation. If the mutant is equivalent, request maintainer approval for the narrowest mutator-specific exclusion and explain why it cannot change behavior:
// Stryker disable next-line ConditionalExpression: normalized input cannot reach the alternate branch
const result = condition ? value : fallbackBroad all exclusions and exclusions without a concrete reason are reported as advisories.
Reproduce locally
From a full checkout containing both commits:
pnpm install --frozen-lockfile
node scripts/stryker-diff.mjs ci --base 73931fe8be253b93ec11103a0672c615e849f895 --head 3668f246525357568be1e745dd37d531d3fd1633Mutation reports
- extension:
reports/mutation/extension/mutation.html - webview:
reports/mutation/webview/mutation.html
The workflow uploads generated reports in the changed-code-mutation-report artifact. A direct artifact link appears below after upload.
Advisory findings
src/core/task/Task.ts:4501: mutation exclusions must use "// Stryker disable next-line MutatorName: concrete reason"; broad or unreasoned exclusions are not allowed.
Related GitHub Issue
Closes: #2333
Description
This PR implements automatic background title generation for new root tasks with minimal changes.
Key design points:
Task.startTask, title generation starts as a fire-and-forget background operation afterthe first message is saved. It does not block the agent loop or delay startup. Subtasks and resumed history tasks skip
title generation.
singleCompletionHandlerwith a strict 10-secondtimeout. Prompts longer than 1,000 characters are trimmed before sending to prevent token waste and latency. Generated
titles are clamped to a maximum of 50 characters.
cancelCurrentRequest,requestAbort, ordispose),titleAbortControllerimmediately aborts the underlying network transport. The task title safely falls back to theoriginal prompt without overwriting.
renameTaskWithId. If a user manually renames thetask before generation finishes, the manual title is preserved.
src/shared/support-prompt.tswith linear string trimming (indexOf/slice)rather than vulnerable regular expressions.
ExtensionStateContextso the generated title immediately reflects in both the chatheader (
TaskHeader) and the recent task list (HistoryPreview).Test Procedure
• Start a new task with a long prompt. Observe that the agent starts immediately and the header updates to a concise
summary title shortly after.
• Start a task and click Cancel immediately. Verify that title generation aborts and the prompt remains the title.
• Check the chat home screen (recent task list) to confirm the title displays properly.
Pre-Submission Checklist
[✓] Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
[✓] Scope: My changes are focused on the linked issue (one major feature/fix per PR).
[✓] Self-Review: I reviewed my own code with care.
[✓] Writing Style: The PR title and description use Simplified Technical English (ASD-STE100): short sentences, plain words,
active voice, one idea per sentence, no contractions.
[✓] Testing: New and/or updated tests have been added to cover my changes (if applicable).
[✓] Test Helpers (test changes only): Shared test helpers (src/test-utils/, @/utils/test-utils) are used only for mechanical
duplication; test intent and scenario-specific mocks remain visible.
[ ] Visual Snapshot (UI changes only): Not applicable. Existing UI components are reused.
[✓] Documentation Impact: I checked if my changes need documentation updates (see "Documentation Updates" section below).
[✓] Contribution Guidelines: I read and agree to the Contributor Guidelines /CONTRIBUTING.md.
Videos (interaction / animation only)
Documentation Updates
[✓] No documentation updates are required.
Additional Notes
• All 66 added/affected unit tests pass.
• No as any or ESLint suppression count increases.
Get in Touch
hehegwk_2384