Skip to content

Conversation

@RomneyDa
Copy link
Collaborator

@RomneyDa RomneyDa commented May 27, 2025

Expands edit tool testing, adding full edit tool walkthrough integration tests for multiple scenarios

When auto apply edits was enabled, accept was triggered

  • in edit tool implementation
  • in parallel listeners listening for apply state closed

Updated to only be in parallel listeners.

This required moving around setActive and setInactive dispatches because with nested thunks the stream wrapper would complete and setInactive which would cause subsequent response after tool call to abort.

Also changes StyledMarkdownPreview to force streamId by toolCallId rather than generating a streamId and forcing streamId

@RomneyDa RomneyDa requested a review from a team as a code owner May 27, 2025 19:48
@RomneyDa RomneyDa requested review from sestinj and removed request for a team May 27, 2025 19:48
@cubic-dev-ai
Copy link
Contributor

cubic-dev-ai bot commented May 27, 2025

Your cubic subscription is currently inactive. Please reactivate your subscription to receive AI reviews and use cubic.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label May 27, 2025
@netlify
Copy link

netlify bot commented May 27, 2025

Deploy Preview for continuedev canceled.

Name Link
🔨 Latest commit 55ff11f
🔍 Latest deploy log https://app.netlify.com/projects/continuedev/deploys/685db7c087b7180008482c43
sestinj

This comment was marked as duplicate.

Copy link
Contributor

@sestinj sestinj left a comment

Choose a reason for hiding this comment

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

seems like this fix will work, but not sure how we pin it down from breaking again if there aren't tests. While testing auto-apply seems like overkill given it's an experiment, do we have enough vitest gui tests for the edit file tool that we can be sure this doesn't break something else? I think worth adding one, even if simple

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Jun 6, 2025
@recurseml
Copy link

recurseml bot commented Jun 13, 2025

✨ No issues found! Your code is sparkling clean! ✨

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jun 19, 2025
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Jun 19, 2025
@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 Jun 26, 2025
Copy link
Collaborator Author

@RomneyDa RomneyDa left a comment

Choose a reason for hiding this comment

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

Fills out the GUI integration testing with better utils.
Fixes a bug where setInactive is triggered just before streamResponseAfterToolCall
Moves auto accept edit tool functionality from edit tool implementation to parallel listeners
Changes StyledMarkdownPreview to force streamId by toolCallId rather than generating a streamId and forcing streamId

];
],
];
chatStreamDelay: number = 0;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Expands the abilities of MockIdeMessenger to be able to set the contents returned (similar to MockLLM) and mock delays

configUpdates?: Partial<BrowserSerializedContinueConfig>;
}

export function triggerConfigUpdate({
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Utils for triggering config updates in redux for testing, as well as selecting model, etc.

if (out.status === "error") {
throw new Error(out.error);
}
return {
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 is the main fix, which prevents there being two simultaneous calls to the model which can result in malformed json

generateTitle: true,
}),
);
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

setActive and setInactive are moved to around the actual streams, rather than in the streamThunkWrapper, since the wrapper can wrap chains of thunks, which causes setInactive to be prematurely triggered

globals: true,
environment: "jsdom",
setupFiles: "./src/util/test/setupTests.ts",
onConsoleLog(log, type) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ignore redundant/unecessary logs for our setup

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Allows selection of main editor in integration test utils

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Expands abilities of MockIdeMessenger, and streamlines data mocking for messaging

toolCallId: currentToolCallApplyState.toolCallId!,
}),
);
if (state.status === "done" && autoAcceptEditToolDiffs) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

auto accept edit tool implementation moved from edit tool to here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Chat test is unchanged other than using the new utils.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Apply test is unchanged other than using the new utils

@RomneyDa
Copy link
Collaborator Author

@sestinj tests have been added

@RomneyDa RomneyDa changed the title Fix auto-apply duplicate responses Expand Edit Tool tests, fix auto-apply duplicate responses Jun 26, 2025
Copy link
Contributor

@sestinj sestinj left a comment

Choose a reason for hiding this comment

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

Assuming this has been tested manually in debug mode, this is ready to merge

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 26, 2025
@RomneyDa RomneyDa merged commit 3cd9379 into main Jun 26, 2025
38 checks passed
@RomneyDa RomneyDa deleted the dallin/auto-apply-fix branch June 26, 2025 22:59
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs Jun 26, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jun 26, 2025
@sestinj
Copy link
Contributor

sestinj commented Jul 22, 2025

🎉 This PR is included in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm This PR has been approved by a maintainer released size:XXL This PR changes 1000+ lines, ignoring generated files.

3 participants