8000 Only send environment details in last user message by cte · Pull Request #3101 · RooCodeInc/Roo-Code · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Only send environment details in last user message #3101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

cte
Copy link
Collaborator
@cte cte commented May 1, 2025

Context

Inspired by #3082, I decided to try a different variation of environment details de-duplication. I confirmed that it doesn't present cache issues:

Screenshot 2025-05-01 at 2 08 09 PM

I'm not sure if there are other implications from the removing all of the redundant environment details blocks, so we'll have to verify that this is okay.


Important

Environment details are now appended only to the last user message in Cline.ts, with updates to message processing and tests.

  • Behavior:
    • Environment details are now only included in the last user message in Cline.ts.
    • processMessages() in Cline.ts updated to append environment details to the last user message.
    • addCacheBreakpoints() in anthropic.ts modified to handle cache control for user messages.
  • Functions:
    • attemptApiRequest() in Cline.ts now takes environmentDetails as a parameter.
    • getEnvironmentDetails() in Cline.ts is called before API requests to fetch environment details.
  • Tests:
    • Updated Cline.test.ts to mock getEnvironmentDetails() and test message processing logic.

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

Copy link
changeset-bot bot commented May 1, 2025

⚠️ No Changeset found

Latest commit: 12d2404

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels May 1, 2025
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
case "claude-3-opus-20240229":
case "claude-3-haiku-20240307":
betas.push("prompt-caching-2024-07-31")
return { headers: { "anthropic-beta": betas.join(",") } }
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This isn't in beta anymore; we don't need the header.

})(),
)
system = [{ text: systemPrompt, type: "text", cache_control: { type: "ephemeral" } }]
addCacheBreakpoints(messages)
Copy link

Choose a reason for hiding this comment

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

The call was changed from reassigning messages (messages = addCacheBreakpoints(messages)) to just calling addCacheBreakpoints(messages), which now mutates the array in place. Ensure that downstream code expects in-place modification rather than a new array, and consider documenting this side-effect.

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Base automatically changed from cte/tidy-cline to main May 5, 2025 16:11
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels May 5, 2025
@cte cte marked this pull request as draft May 5, 2025 16:30
@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap May 5, 2025
@hannesrudolph hannesrudolph moved this from PR [Pre Approval Review] to PR [Draft/WIP] in Roo Code Roadmap May 10, 2025
@hannesrudolph hannesrudolph moved this from New to PR [Draft/WIP] in Roo Code Roadmap May 20, 2025
@hannesrudolph hannesrudolph moved this from PR [Draft / In Progress] to TEMP in Roo Code Roadmap May 26, 2025
@daniel-lxs daniel-lxs moved this from TEMP to PR [Draft / In Progress] in Roo Code Roadmap May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PR - Draft / In Progress size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
Status: PR [Draft / In Progress]
Development

Successfully merging this pull request may close these issues.

2 participants
0