Skip to content

Commit 0a5c34a

Browse files
authored
Merge branch 'RooCodeInc:main' into fco-feature-branch
2 parents da72d8f + 48d592f commit 0a5c34a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1465
-203
lines changed

.roo/rules-merge-resolver/1_workflow.xml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@
3030
<tools>
3131
<tool>gh pr checkout [PR_NUMBER] --force</tool>
3232
<tool>git fetch origin main</tool>
33-
<tool>git rebase origin/main</tool>
33+
<tool>GIT_EDITOR=true git rebase origin/main</tool>
3434
</tools>
3535
<details>
3636
Force checkout the PR branch to ensure clean state
3737
Fetch the latest main branch
3838
Attempt to rebase onto main to reveal conflicts
39+
Use GIT_EDITOR=true to ensure non-interactive rebase
3940
</details>
4041
</step>
4142

@@ -108,8 +109,8 @@
108109
</command>
109110

110111
<command name="rebase_main">
111-
<syntax>git rebase origin/main</syntax>
112-
<purpose>Rebase current branch onto main to reveal conflicts</purpose>
112+
<syntax>GIT_EDITOR=true git rebase origin/main</syntax>
113+
<purpose>Rebase current branch onto main to reveal conflicts (non-interactive)</purpose>
113114
</command>
114115

115116
<command name="get_blame_info">
@@ -133,6 +134,20 @@
133134
</command>
134135
</git_commands>
135136

137+
<command name="continue_rebase">
138+
<syntax>GIT_EDITOR=true git rebase --continue</syntax>
139+
<purpose>Continue rebase after resolving conflicts (non-interactive)</purpose>
140+
</command>
141+
</git_commands>
142+
143+
<environment_variables>
144+
<variable name="GIT_EDITOR">
145+
<value>true</value>
146+
<purpose>Set to 'true' (a no-op command) to prevent interactive prompts during rebase operations</purpose>
147+
<usage>Prefix git rebase commands with GIT_EDITOR=true to ensure non-interactive execution</usage>
148+
</variable>
149+
</environment_variables>
150+
136151
<completion_criteria>
137152
<criterion>All merge conflicts have been resolved</criterion>
138153
<criterion>Resolved files have been staged</criterion>

.roo/rules-merge-resolver/3_tool_usage.xml

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
<practice>Chain git commands with && for efficiency</practice>
2727
<practice>Use --format options for structured output</practice>
2828
<practice>Capture command output for parsing</practice>
29+
<practice>Use GIT_EDITOR=true for non-interactive git rebase operations</practice>
30+
<practice>Set environment variables inline to avoid prompts during automation</practice>
2931
</best_practices>
3032

3133
<common_commands>
@@ -46,7 +48,7 @@
4648

4749
<command>
4850
<purpose>Rebase onto main to reveal conflicts</purpose>
49-
<syntax>git rebase origin/main</syntax>
51+
<syntax>GIT_EDITOR=true git rebase origin/main</syntax>
5052
</command>
5153

5254
<command>
@@ -71,7 +73,7 @@
7173

7274
<command>
7375
<purpose>Continue rebase after resolution</purpose>
74-
<syntax>git rebase --continue</syntax>
76+
<syntax>GIT_EDITOR=true git rebase --continue</syntax>
7577
</command>
7678
</common_commands>
7779
</tool>
@@ -152,7 +154,7 @@ const config = {
152154
<step>execute_command - Get PR info with gh CLI</step>
153155
<step>execute_command - Checkout PR with gh pr checkout --force</step>
154156
<step>execute_command - Fetch origin main</step>
155-
<step>execute_command - Rebase onto origin/main</step>
157+
<step>execute_command - Rebase onto origin/main with GIT_EDITOR=true</step>
156158
<step>execute_command - Check for conflicts with git status</step>
157159
</sequence>
158160
</pattern>
@@ -178,13 +180,22 @@ const config = {
178180
<pattern name="complete_rebase">
179181
<sequence>
180182
<step>execute_command - Check all conflicts resolved</step>
181-
<step>execute_command - Continue rebase with git rebase --continue</step>
183+
<step>execute_command - Continue rebase with GIT_EDITOR=true git rebase --continue</step>
182184
<step>execute_command - Verify clean status</step>
183185
</sequence>
184186
</pattern>
185187
</tool_combination_patterns>
186188

187189
<error_handling>
190+
<scenario name="interactive_prompt_blocking">
191+
<description>Git commands waiting for interactive input</description>
192+
<approach>
193+
Use GIT_EDITOR=true to bypass editor prompts
194+
Set GIT_SEQUENCE_EDITOR=true for sequence editing
195+
Consider --no-edit flag for commit operations
196+
</approach>
197+
</scenario>
198+
188199
<scenario name="no_conflicts_after_rebase">
189200
<description>Rebase completes without conflicts</description>
190201
<approach>
@@ -225,4 +236,42 @@ const config = {
225236
</approach>
226237
</scenario>
227238
</error_handling>
239+
240+
<non_interactive_operations>
241+
<overview>
242+
Ensuring git operations run without requiring user interaction is critical
243+
for automated conflict resolution. The mode uses environment variables to
244+
bypass interactive prompts.
245+
</overview>
246+
247+
<techniques>
248+
<technique name="GIT_EDITOR">
249+
<description>Set to 'true' (a no-op command) to skip editor prompts</description>
250+
<usage>GIT_EDITOR=true git rebase --continue</usage>
251+
<when>During rebase operations that would normally open an editor</when>
252+
</technique>
253+
254+
<technique name="GIT_SEQUENCE_EDITOR">
255+
<description>Skip interactive rebase todo editing</description>
256+
<usage>GIT_SEQUENCE_EDITOR=true git rebase -i HEAD~3</usage>
257+
<when>When interactive rebase is triggered but no editing needed</when>
258+
</technique>
259+
260+
<technique name="commit_flags">
261+
<description>Use flags to avoid interactive prompts</description>
262+
<examples>
263+
<example>git commit --no-edit (use existing message)</example>
264+
<example>git merge --no-edit (skip merge message editing)</example>
265+
<example>git cherry-pick --no-edit (keep original message)</example>
266+
</examples>
267+
</technique>
268+
</techniques>
269+
270+
<best_practices>
271+
<practice>Always test commands locally first to identify potential prompts</practice>
272+
<practice>Combine environment variables when multiple editors might be invoked</practice>
273+
<practice>Document why non-interactive mode is used in comments</practice>
274+
<practice>Have fallback strategies if automation fails</practice>
275+
</best_practices>
276+
</non_interactive_operations>
228277
</merge_resolver_tool_usage>

.roo/rules-merge-resolver/4_complete_example.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ From github.com:user/repo
5454

5555
<tool_use><![CDATA[
5656
<execute_command>
57-
<command>git rebase origin/main</command>
57+
<command>GIT_EDITOR=true git rebase origin/main</command>
5858
</execute_command>
5959
]]></tool_use>
6060
<expected_output><![CDATA[
@@ -251,7 +251,7 @@ abc123 Fix: Add listener cleanup to prevent memory leak
251251

252252
<tool_use><![CDATA[
253253
<execute_command>
254-
<command>git rebase --continue</command>
254+
<command>GIT_EDITOR=true git rebase --continue</command>
255255
</execute_command>
256256
]]></tool_use>
257257
<expected_output><![CDATA[
@@ -309,7 +309,8 @@ Both the feature refactor and the critical bugfix have been preserved in the res
309309
<takeaway>Use git blame and commit messages to understand the history</takeaway>
310310
<takeaway>Combine non-conflicting improvements when possible</takeaway>
311311
<takeaway>Prioritize bugfixes while accommodating refactors</takeaway>
312-
<takeaway>Complete the rebase process with git rebase --continue</takeaway>
312+
<takeaway>Use GIT_EDITOR=true to ensure non-interactive rebase operations</takeaway>
313+
<takeaway>Complete the rebase process with GIT_EDITOR=true git rebase --continue</takeaway>
313314
<takeaway>Validate that both sets of changes work together</takeaway>
314315
</key_takeaways>
315316
</merge_resolver_example>

apps/web-roo-code/src/app/evals/plot.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,13 @@ export const Plot = ({ tableData }: PlotProps) => {
175175
<>
176176
<div className="pt-4 pb-8 font-mono">Cost x Score</div>
177177
<ChartContainer config={chartConfig} className="h-[500px] w-full">
178-
<ScatterChart margin={{ top: 0, right: 0, bottom: 0, left: 20 }}>
178+
<ScatterChart margin={{ top: 20, right: 0, bottom: 0, left: 20 }}>
179179
<XAxis
180180
type="number"
181181
dataKey="cost"
182182
name="Cost"
183183
domain={[
184-
(dataMin: number) => Math.round((dataMin - 5) / 5) * 5,
184+
(dataMin: number) => Math.max(0, Math.round((dataMin - 5) / 5) * 5),
185185
(dataMax: number) => Math.round((dataMax + 5) / 5) * 5,
186186
]}
187187
tickFormatter={(value) => formatCurrency(value)}

packages/types/npm/package.metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@roo-code/types",
3-
"version": "1.74.0",
3+
"version": "1.75.0",
44
"description": "TypeScript type definitions for Roo Code.",
55
"publishConfig": {
66
"access": "public",

packages/types/src/cloud.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ export type UserFeatures = z.infer<typeof userFeaturesSchema>
162162

163163
export const userSettingsConfigSchema = z.object({
164164
extensionBridgeEnabled: z.boolean().optional(),
165+
taskSyncEnabled: z.boolean().optional(),
165166
})
166167

167168
export type UserSettingsConfig = z.infer<typeof userSettingsConfigSchema>

src/core/webview/__tests__/ClineProvider.spec.ts

Lines changed: 20 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,19 +1352,11 @@ describe("ClineProvider", () => {
13521352
text: "Edited message content",
13531353
})
13541354

1355-
// Verify correct messages were kept (only messages before the edited one)
1356-
expect(mockCline.overwriteClineMessages).toHaveBeenCalledWith([
1357-
mockMessages[0],
1358-
mockMessages[1],
1359-
mockMessages[2],
1360-
])
1355+
// Verify correct messages were kept - delete from the preceding user message to truly replace it
1356+
expect(mockCline.overwriteClineMessages).toHaveBeenCalledWith([])
13611357

1362-
// Verify correct API messages were kept (only messages before the edited one)
1363-
expect(mockCline.overwriteApiConversationHistory).toHaveBeenCalledWith([
1364-
mockApiHistory[0],
1365-
mockApiHistory[1],
1366-
mockApiHistory[2],
1367-
])
1358+
// Verify correct API messages were kept
1359+
expect(mockCline.overwriteApiConversationHistory).toHaveBeenCalledWith([])
13681360

13691361
// The new flow calls webviewMessageHandler recursively with askResponse
13701362
// We need to verify the recursive call happened by checking if the handler was called again
@@ -3112,7 +3104,7 @@ describe("ClineProvider - Comprehensive Edit/Delete Edge Cases", () => {
31123104
mockCline.apiConversationHistory = [{ ts: 1000 }, { ts: 2000 }, { ts: 3000 }] as any[]
31133105
mockCline.overwriteClineMessages = vi.fn()
31143106
mockCline.overwriteApiConversationHistory = vi.fn()
3115-
mockCline.handleWebviewAskResponse = vi.fn()
3107+
mockCline.submitUserMessage = vi.fn()
31163108

31173109
await provider.addClineToStack(mockCline)
31183110
;(provider as any).getTaskWithId = vi.fn().mockResolvedValue({
@@ -3142,9 +3134,11 @@ describe("ClineProvider - Comprehensive Edit/Delete Edge Cases", () => {
31423134
text: "Edited message with preserved images",
31433135
})
31443136

3145-
// Verify messages were edited correctly - messages up to the edited message should remain
3146-
expect(mockCline.overwriteClineMessages).toHaveBeenCalledWith([mockMessages[0], mockMessages[1]])
3147-
expect(mockCline.overwriteApiConversationHistory).toHaveBeenCalledWith([{ ts: 1000 }, { ts: 2000 }])
3137+
// Verify messages were edited correctly - the ORIGINAL user message and all subsequent messages are removed
3138+
expect(mockCline.overwriteClineMessages).toHaveBeenCalledWith([mockMessages[0]])
3139+
expect(mockCline.overwriteApiConversationHistory).toHaveBeenCalledWith([{ ts: 1000 }])
3140+
// Verify submitUserMessage was called with the edited content
3141+
expect(mockCline.submitUserMessage).toHaveBeenCalledWith("Edited message with preserved images", undefined)
31483142
})
31493143

31503144
test("handles editing messages with file attachments", async () => {
@@ -3166,7 +3160,7 @@ describe("ClineProvider - Comprehensive Edit/Delete Edge Cases", () => {
31663160
mockCline.apiConversationHistory = [{ ts: 1000 }, { ts: 2000 }, { ts: 3000 }] as any[]
31673161
mockCline.overwriteClineMessages = vi.fn()
31683162
mockCline.overwriteApiConversationHistory = vi.fn()
3169-
mockCline.handleWebviewAskResponse = vi.fn()
3163+
mockCline.submitUserMessage = vi.fn()
31703164

31713165
await provider.addClineToStack(mockCline)
31723166
;(provider as any).getTaskWithId = vi.fn().mockResolvedValue({
@@ -3197,11 +3191,7 @@ describe("ClineProvider - Comprehensive Edit/Delete Edge Cases", () => {
31973191
})
31983192

31993193
expect(mockCline.overwriteClineMessages).toHaveBeenCalled()
3200-
expect(mockCline.handleWebviewAskResponse).toHaveBeenCalledWith(
3201-
"messageResponse",
3202-
"Edited message with file attachment",
3203-
undefined,
3204-
)
3194+
expect(mockCline.submitUserMessage).toHaveBeenCalledWith("Edited message with file attachment", undefined)
32053195
})
32063196
})
32073197

@@ -3293,7 +3283,7 @@ describe("ClineProvider - Comprehensive Edit/Delete Edge Cases", () => {
32933283
await messageHandler({ type: "editMessageConfirm", messageTs: 2000, text: "Edited message" })
32943284

32953285
// The error should be caught and shown
3296-
expect(vscode.window.showErrorMessage).toHaveBeenCalledWith("Error editing message: Connection lost")
3286+
expect(vscode.window.showErrorMessage).toHaveBeenCalledWith("errors.message.error_editing_message")
32973287
})
32983288
})
32993289

@@ -3416,7 +3406,7 @@ describe("ClineProvider - Comprehensive Edit/Delete Edge Cases", () => {
34163406
text: "Edited message",
34173407
})
34183408

3419-
expect(vscode.window.showErrorMessage).toHaveBeenCalledWith("Error editing message: Unauthorized")
3409+
expect(vscode.window.showErrorMessage).toHaveBeenCalledWith("errors.message.error_editing_message")
34203410
})
34213411

34223412
describe("Malformed Requests and Invalid Formats", () => {
@@ -3640,7 +3630,7 @@ describe("ClineProvider - Comprehensive Edit/Delete Edge Cases", () => {
36403630

36413631
// Verify cleanup was attempted before failure
36423632
expect(cleanupSpy).toHaveBeenCalled()
3643-
expect(vscode.window.showErrorMessage).toHaveBeenCalledWith("Error editing message: Operation failed")
3633+
expect(vscode.window.showErrorMessage).toHaveBeenCalledWith("errors.message.error_editing_message")
36443634
})
36453635

36463636
test("validates proper cleanup during failed delete operations", async () => {
@@ -3680,9 +3670,7 @@ describe("ClineProvider - Comprehensive Edit/Delete Edge Cases", () => {
36803670

36813671
// Verify cleanup was attempted before failure
36823672
expect(cleanupSpy).toHaveBeenCalled()
3683-
expect(vscode.window.showErrorMessage).toHaveBeenCalledWith(
3684-
"Error deleting message: Delete operation failed",
3685-
)
3673+
expect(vscode.window.showErrorMessage).toHaveBeenCalledWith("errors.message.error_deleting_message")
36863674
})
36873675
})
36883676

@@ -3705,7 +3693,7 @@ describe("ClineProvider - Comprehensive Edit/Delete Edge Cases", () => {
37053693
mockCline.apiConversationHistory = [{ ts: 1000 }, { ts: 2000 }] as any[]
37063694
mockCline.overwriteClineMessages = vi.fn()
37073695
mockCline.overwriteApiConversationHistory = vi.fn()
3708-
mockCline.handleWebviewAskResponse = vi.fn()
3696+
mockCline.submitUserMessage = vi.fn()
37093697

37103698
await provider.addClineToStack(mockCline)
37113699
;(provider as any).getTaskWithId = vi.fn().mockResolvedValue({
@@ -3734,11 +3722,7 @@ describe("ClineProvider - Comprehensive Edit/Delete Edge Cases", () => {
37343722
await messageHandler({ type: "editMessageConfirm", messageTs: 2000, text: largeEditedContent })
37353723

37363724
expect(mockCline.overwriteClineMessages).toHaveBeenCalled()
3737-
expect(mockCline.handleWebviewAskResponse).toHaveBeenCalledWith(
3738-
"messageResponse",
3739-
largeEditedContent,
3740-
undefined,
3741-
)
3725+
expect(mockCline.submitUserMessage).toHaveBeenCalledWith(largeEditedContent, undefined)
37423726
})
37433727

37443728
test("handles deleting messages with large payloads", async () => {
@@ -3918,7 +3902,7 @@ describe("ClineProvider - Comprehensive Edit/Delete Edge Cases", () => {
39183902
] as any[]
39193903
mockCline.overwriteClineMessages = vi.fn()
39203904
mockCline.overwriteApiConversationHistory = vi.fn()
3921-
mockCline.handleWebviewAskResponse = vi.fn()
3905+
mockCline.submitUserMessage = vi.fn()
39223906

39233907
await provider.addClineToStack(mockCline)
39243908
;(provider as any).getTaskWithId = vi.fn().mockResolvedValue({
@@ -3951,7 +3935,7 @@ describe("ClineProvider - Comprehensive Edit/Delete Edge Cases", () => {
39513935

39523936
// Should handle future timestamps correctly
39533937
expect(mockCline.overwriteClineMessages).toHaveBeenCalled()
3954-
expect(mockCline.handleWebviewAskResponse).toHaveBeenCalled()
3938+
expect(mockCline.submitUserMessage).toHaveBeenCalled()
39553939
})
39563940
})
39573941
})

0 commit comments

Comments
 (0)