Skip to content

Conversation

@hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Sep 25, 2025


Important

Ensure initial user message is included in LLM summarization input and update prompt to capture it in index.ts.

  • Behavior:
    • Include initial user message in LLM summarization input by changing slice in summarizeConversation() in index.ts.
    • Update SUMMARY_PROMPT in index.ts to explicitly require initial user ask inclusion.
  • Tests:
    • Add unit test in index.spec.ts to verify initial ask is present in summarization input when no prior summary exists.

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

Copilot AI review requested due to automatic review settings September 25, 2025 02:20
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Sep 25, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug in the conversation condensation logic where the initial user ask was excluded from summarization, causing task resumptions to re-answer the original question instead of continuing work. The fix includes the first user message in the summarization input and hardens the prompt to explicitly capture the initial ask.

Key changes:

  • Modified message slicing to include the first user message in summarization input
  • Enhanced the summary prompt to explicitly require including the initial user ask
  • Added test coverage to verify the initial ask is present in summarization input

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/core/condense/index.ts Changed message slicing logic and hardened summary prompt to include initial user ask
src/core/condense/tests/index.spec.ts Added test to verify initial user message is included in summarization input
pr-body.md Added PR description file

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Sep 25, 2025
Copy link
Contributor

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

I found some issues that need attention:

  • Remove pr-body.md (artifact).
  • Update outdated comment near messagesToSummarize.
  • Consider refining SUMMARY_PROMPT wording.
  • Add a test covering presence of earlier summary.

Additional note: typo 'summaryMesage' near countTokens comment should be 'summaryMessage'.

const mockCallArgs = (maybeRemoveImageBlocks as Mock).mock.calls[0][0] as any[]
expect(mockCallArgs[mockCallArgs.length - 1]).toEqual(expectedFinalMessage)
})
it("should include the original first user message in summarization input", async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding a complementary test where an earlier summary exists to assert the original first ask remains present in the summarization input across both manual and automatic condense flows.

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Sep 25, 2025
Copy link
Collaborator

@mrubens mrubens left a comment

Choose a reason for hiding this comment

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

Looks like we lost a newline in the prompt, looks good otherwise

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 25, 2025
@hannesrudolph hannesrudolph merged commit 2f1b94f into main Sep 25, 2025
8 of 9 checks passed
@hannesrudolph hannesrudolph deleted the fix/issue-8293-condense-initial-ask branch September 25, 2025 05:14
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Sep 25, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Sep 25, 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. lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants