fix: Enrich attachment-only task descriptions for title generation#1980
Merged
charlesvien merged 11 commits intomainfrom May 4, 2026
Merged
Conversation
Member
Author
This was referenced May 2, 2026
Contributor
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
apps/code/src/renderer/utils/generateTitle.test.ts:75-94
**Prefer parameterised tests for fallback cases**
These three tests all verify that the `[Attached: <filename>]` hint is returned, and differ only in the setup (binary extension, read throws, read returns null). Per the project's testing conventions, these should be collapsed into a single `it.each` table.
```ts
it.each([
{
label: "binary file",
description: '1. <file path="/tmp/screenshot.png" />',
setup: () => {},
expected: "[Attached: screenshot.png]",
},
{
label: "read throws",
description: '1. <file path="/tmp/missing.ts" />',
setup: () => mockReadAbsoluteFile.mockRejectedValue(new Error("ENOENT")),
expected: "[Attached: missing.ts]",
},
{
label: "read returns null",
description: '1. <file path="/tmp/empty.ts" />',
setup: () => mockReadAbsoluteFile.mockResolvedValue(null),
expected: "[Attached: empty.ts]",
},
])(
"falls back to filename hint — $label",
async ({ description, setup, expected }) => {
setup();
expect(await enrichDescriptionWithFileContent(description)).toBe(expected);
},
);
```
Reviews (1): Last reviewed commit: "Add tests for enrichDescriptionWithFileC..." | Re-trigger Greptile |
jonathanlab
approved these changes
May 4, 2026
Member
Author
Merge activity
|
posthog Bot
pushed a commit
that referenced
this pull request
May 4, 2026
Resolve conflicts in task-creation.ts and task-creation.test.ts. PR #1980 (now in main) implemented this PR's intent — enriching attachment-only descriptions for title generation — via enrichDescriptionWithFileContent in generateTitle.ts and moved auto-title generation to useChatTitleGenerator. The inline expandClipboardTextTags / generateTaskTitle from this PR are redundant and have been dropped, along with the now-unused readClipboardText route. Generated-By: PostHog Code Task-Id: 2a27dd7f-c22d-4ca3-abe8-06ad4b66cfc9
posthog Bot
pushed a commit
that referenced
this pull request
May 4, 2026
Resolve conflicts in task-creation.ts and task-creation.test.ts. PR #1980 (now in main) implemented this PR's intent — enriching attachment-only descriptions for title generation — via enrichDescriptionWithFileContent in generateTitle.ts and moved auto-title generation to useChatTitleGenerator. The inline expandClipboardTextTags / generateTaskTitle from this PR are redundant and have been dropped, along with the now-unused readClipboardText route. Generated-By: PostHog Code Task-Id: 2a27dd7f-c22d-4ca3-abe8-06ad4b66cfc9
posthog Bot
pushed a commit
that referenced
this pull request
May 4, 2026
Resolve conflicts in task-creation.ts and task-creation.test.ts. PR #1980 (now in main) implemented this PR's intent — enriching attachment-only descriptions for title generation — via enrichDescriptionWithFileContent in generateTitle.ts and moved auto-title generation to useChatTitleGenerator. The inline expandClipboardTextTags / generateTaskTitle from this PR are redundant and have been dropped, along with the now-unused readClipboardText route. Generated-By: PostHog Code Task-Id: 2a27dd7f-c22d-4ca3-abe8-06ad4b66cfc9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
Tasks created with only file attachments (pasted text or images) produce generic titles because the LLM has no meaningful text to work with.
Changes
How did you test this?
Manually