Skip to content

fix(mode-switch)-tools-calls-broken #5528

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

Merged

Conversation

chezsmithy
Copy link
Contributor

@chezsmithy chezsmithy commented May 6, 2025

Description

Resolves: #5510

  • Currently if the user is in agent mode and uses tools and swtiches back to chat mode a tools call error occurs.
  • Added separate default system messages for Chat and Agent mode.
  • Updated the Default chat message to suggest applying edits using Agent Mode, or the Apply Button.

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Screenshots

[ For visual changes, include screenshots. Screen recordings are particularly helpful, and appreciated! ]

Testing instructions

  1. Start in Agent mode and add a power function to @test.js.
  2. Note the change is done as expected.
  3. Now ask to remove the function.
  4. Note the change is done as expected.
  5. Switch to chat mode.
  6. Ask to add the power function to @test.js
  7. Note that the edit isn't made, just a suggestion is presented.
  8. Ask for the edit to be applied.
  9. Note that switching to agent mode, or using the apply button is suggested.
  10. Switch back to agent mode.
  11. Ask for the edit to be applied.
  12. Note the edit is applied.

@chezsmithy chezsmithy requested a review from a team as a code owner May 6, 2025 07:25
@chezsmithy chezsmithy requested review from tomasz-stefaniak and removed request for a team May 6, 2025 07:25
Copy link

netlify bot commented May 6, 2025

Deploy Preview for continuedev canceled.

Name Link
🔨 Latest commit 1e87618
🔍 Latest deploy log https://app.netlify.com/sites/continuedev/deploys/681bcffc0622b2000877718a

@chezsmithy
Copy link
Contributor Author

@Patrick-Erichsen @tomasz-stefaniak FYI based on issues I am attempting to resolve. Note this is the current top complaint from my team that uses continue.

@Patrick-Erichsen
Copy link
Collaborator

Patrick-Erichsen commented May 6, 2025

Hey @chezsmithy , thanks for the PR!

Chatted this over with @sestinj this morning - we both agreed that the chat/agent system messages are a great addition, but the tool calling in Chat mode we'd like to avoid. I can see the value in having the subset of tools available in Chat, but the problem is that exposing these tools makes the models way too eager to use tools instead of just answering questions directly, which is the intended behavior for Chat. E.g. I tried to ask a simple question with 3.7 Sonnet and instead it searched my codebase, couldn't find the answer, then searched the web, etc

With that being said, a few points of feedback on the system message updates:

  • Can we update the rule title in the GUI so that instead of always Default chat system message, it says Default agent system message when in agent mode?
  • In general I think the agent system message could be shortened a bit
  • The "lazy edits" part of both sys msgs should be pulled out into a variable and reused in both to make sure they use the same instructions for this
  • Chat prompt should have clearer instructions that the user can use the "Apply" button (I was told to copy/paste when asking for an edit, when I should be told to use the Apply button)

@chezsmithy
Copy link
Contributor Author

chezsmithy commented May 7, 2025

@Patrick-Erichsen @tomasz-stefaniak ok, I've made the suggested changes and cleaned up. I've got a problem with a failing GUI test. Now that tool calls are explicitly blocked in chat mode I need a way to add the Mode selector to the GUI test. I tried to do that, but can't quite seem to get the syntax right. Could you please review and suggest how I might resolve the GUI test issue? Thx!

@Patrick-Erichsen
Copy link
Collaborator

Patrick-Erichsen commented May 7, 2025

@chezsmithy pushed up a fix that will hopefully resolve it, your syntax was correct, I think we just needed to hardcode the capabilities for the model to allow for tool_use 👍 thanks for updating the tests!

We chatted more as a team yesterday on the ability to have tool calling outside of Agent mode. I think it's likely we'll move in that direction in the near term, but we might approach it differently than just an additional mode. In general though I think we're all aligned that there's value in a "safe" mode to explore the codebase, plan, pull in context from MCPs, etc, that doesn't allow for code edits.

Copy link
Collaborator

@Patrick-Erichsen Patrick-Erichsen left a comment

Choose a reason for hiding this comment

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

🚀

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label May 7, 2025
@Patrick-Erichsen Patrick-Erichsen merged commit ec0180b into continuedev:main May 7, 2025
32 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Issues and PRs May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Switching between agent and chat mode results in a tools use error message
2 participants