Skip to content

Commit 35486af

Browse files
authored
Merge pull request #241 from cloudflare/nightly
Nightly -> Main release
2 parents f7cc7ea + a28bf9f commit 35486af

Some content is hidden

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

52 files changed

+2100
-1414
lines changed

.github/workflows/claude-issue-triage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ jobs:
165165
166166
### STAGE 3: Solution Proposal (CONDITIONAL)${{ steps.analyze.outputs.severity == 'high' && '\n\n**⚠️ REQUIRED** - Critical issue, must propose fix' || '\n\n**OPTIONAL** - Propose fix if solution is clear and straightforward' }}
167167
168-
${{ steps.analyze.outputs.severity == 'high' && '**You MUST propose a fix for this critical issue:**' || '**Propose a fix only if:**\n- Root cause is clear\n- Fix is straightforward (< 50 lines changed)\n- You\'re confident it won\'t introduce regressions' }}
168+
${{ steps.analyze.outputs.severity == 'high' && '**You MUST propose a fix for this critical issue:**' || '**Propose a fix only if:**\n- Root cause is clear\n- Fix is straightforward (< 50 lines changed)\n- You''re confident it won''t introduce regressions' }}
169169
170170
#### 3.1 Design the Fix
171171
@@ -249,7 +249,7 @@ jobs:
249249
250250
**Comment Structure** (adapt based on investigation depth):
251251
252-
${{ steps.analyze.outputs.should_investigate == 'true' && '**For investigated issues:**\n\n```markdown\n## Investigation Results\n\nThanks for reporting this, @${{ github.event.issue.user.login }}! I\'ve performed a thorough analysis.\n\n### Classification\n- **Type:** [bug/feature/etc]\n- **Severity:** [P0-critical/P1-high/etc]\n- **Component:** [worker/ui/etc]\n\n### Root Cause Analysis\n[Detailed explanation of what\'s causing the issue]\n\n**Location:** `path/to/file.ts:123`\n\n**Introduced in:** PR #XXX (if found) or Commit ABC123\n\n### Proposed Solution\n[Explain the fix approach]\n\n### Status\n- ✅ PR #XXX created with proposed fix (if applicable)\n- ⏳ Requires manual review and testing\n- 📋 Added to backlog for team review (if no PR)\n\n### Next Steps\n[What happens next - PR review, team discussion, etc.]\n```' || '**For standard triage:**\n\n```markdown\nThanks for reporting this, @${{ github.event.issue.user.login }}!\n\n### Classification\n- **Labels:** [list applied labels]\n- **Priority:** [explanation of priority]\n\n[Context-specific response based on issue type]\n\n### Next Steps\nThe team will review this and provide updates.\n```' }}
252+
${{ steps.analyze.outputs.should_investigate == 'true' && '**For investigated issues:**\n\n```markdown\n## Investigation Results\n\nThanks for reporting this, @${{ github.event.issue.user.login }}! I''ve performed a thorough analysis.\n\n### Classification\n- **Type:** [bug/feature/etc]\n- **Severity:** [P0-critical/P1-high/etc]\n- **Component:** [worker/ui/etc]\n\n### Root Cause Analysis\n[Detailed explanation of what''s causing the issue]\n\n**Location:** `path/to/file.ts:123`\n\n**Introduced in:** PR #XXX (if found) or Commit ABC123\n\n### Proposed Solution\n[Explain the fix approach]\n\n### Status\n- ✅ PR #XXX created with proposed fix (if applicable)\n- ⏳ Requires manual review and testing\n- 📋 Added to backlog for team review (if no PR)\n\n### Next Steps\n[What happens next - PR review, team discussion, etc.]\n```' || '**For standard triage:**\n\n```markdown\nThanks for reporting this, @${{ github.event.issue.user.login }}!\n\n### Classification\n- **Labels:** [list applied labels]\n- **Priority:** [explanation of priority]\n\n[Context-specific response based on issue type]\n\n### Next Steps\nThe team will review this and provide updates.\n```' }}
253253
254254
---
255255

.github/workflows/claude-reviews.yml

Lines changed: 40 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -45,32 +45,6 @@ jobs:
4545
env:
4646
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4747

48-
- name: Minimize Old Review Comments
49-
run: |
50-
echo "Collapsing previous review comments from github-actions[bot]..."
51-
52-
# Get all comments from github-actions[bot] on this PR
53-
OLD_REVIEWS=$(gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
54-
--jq '[.[] | select(.user.login == "github-actions[bot]") | select(.body | contains("## Code Review") or contains("🔒 **CRITICAL PATH SECURITY REVIEW**") or contains("## 🔍 Code Quality & Security Review")) | .id]')
55-
56-
if [ -n "$OLD_REVIEWS" ] && [ "$OLD_REVIEWS" != "[]" ]; then
57-
echo "Found old review comments to collapse"
58-
echo "$OLD_REVIEWS" | jq -r '.[]' | while read comment_id; do
59-
echo "Collapsing comment $comment_id"
60-
gh api repos/${{ github.repository }}/issues/comments/$comment_id -X PATCH \
61-
-f body="<details><summary>🔒 Previous review (outdated)</summary>
62-
63-
This review has been superseded by a newer review.
64-
</details>" || echo "Failed to collapse comment $comment_id"
65-
done
66-
echo "✓ Old comments collapsed"
67-
else
68-
echo "No old review comments found"
69-
fi
70-
env:
71-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72-
continue-on-error: true
73-
7448
- name: Run Comprehensive Review
7549
uses: anthropics/claude-code-action@v1
7650
with:
@@ -137,16 +111,8 @@ jobs:
137111
[Overall assessment with approval/disapproval reasoning]
138112
```
139113
140-
5. Post review (MANDATORY FINAL STEP - use single efficient command)
114+
5. Post review (MANDATORY FINAL STEP)
141115
```bash
142-
# Post new review (collapse old ones first if any exist)
143-
OLD_IDS=$(gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments --jq '[.[] | select(.user.login == "github-actions[bot]") | select(.body | startswith("## Code & Security Review")) | .id] | @csv' | tr -d '"')
144-
if [ -n "$OLD_IDS" ]; then
145-
for id in ${OLD_IDS//,/ }; do
146-
gh api -X PATCH repos/${{ github.repository }}/issues/comments/$id -f body="<details><summary>Outdated</summary></details>" &
147-
done
148-
wait
149-
fi
150116
gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "YOUR_REVIEW_HERE"
151117
```
152118
@@ -180,3 +146,42 @@ jobs:
180146
--allowed-tools "mcp__github_inline_comment__create_inline_comment,Bash(gh issue view:*),Bash(gh issue list:*),Bash(gh search:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr edit:*),Bash(gh api:*)"
181147
--max-turns ${{ steps.critical_paths.outputs.is_critical == 'true' && '90' || '65' }}
182148
--model claude-sonnet-4-5-20250929
149+
150+
- name: Intelligent Comment Cleanup
151+
uses: anthropics/claude-code-action@v1
152+
if: always()
153+
with:
154+
github_token: ${{ secrets.GITHUB_TOKEN }}
155+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
156+
prompt: |
157+
Clean up stale bot comments on PR #${{ github.event.pull_request.number }}.
158+
159+
**Task:**
160+
1. Fetch all comments on this PR
161+
2. Identify bot comments (users ending in [bot]) that are stale/outdated:
162+
- Old reviews superseded by newer ones
163+
- Old PR description suggestions
164+
- Previously collapsed/outdated markers
165+
- Progress/status comments from previous workflow runs
166+
3. Keep only the most recent comment per category per bot
167+
4. DELETE all stale comments (do not collapse)
168+
169+
**Get all comments:**
170+
```bash
171+
gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments --jq '.[] | {id, user: .user.login, body, created_at}'
172+
```
173+
174+
**Delete a comment:**
175+
```bash
176+
gh api repos/${{ github.repository }}/issues/comments/COMMENT_ID -X DELETE
177+
```
178+
179+
Be intelligent:
180+
- Preserve the newest useful comment in each category
181+
- Delete everything else that's redundant or stale
182+
- If unsure, keep the comment (conservative approach)
183+
184+
claude_args: |
185+
--allowed-tools "Bash(gh api repos/*/issues/*/comments:*),Bash(gh api repos/*/issues/comments/*:*)"
186+
--max-turns 8
187+
--model claude-haiku-4-5-20251001

src/components/monaco-editor/monaco-editor.tsx

Lines changed: 76 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ self.MonacoEnvironment = {
3636
};
3737

3838
// From GitHub Dark theme
39-
monaco.editor.defineTheme('v1-dev-dark', {
39+
monaco.editor.defineTheme('vibesdk-dark', {
4040
base: 'vs-dark',
4141
inherit: true,
4242
rules: [
@@ -77,7 +77,7 @@ monaco.editor.defineTheme('v1-dev-dark', {
7777
},
7878
});
7979

80-
monaco.editor.defineTheme('v1-dev', {
80+
monaco.editor.defineTheme('vibesdk', {
8181
base: 'vs',
8282
inherit: true,
8383
rules: [
@@ -116,43 +116,13 @@ monaco.editor.defineTheme('v1-dev', {
116116
},
117117
});
118118

119-
monaco.editor.setTheme('v1-dev');
120-
121-
monaco.languages.typescript.typescriptDefaults.setDiagnosticsOptions({
122-
noSemanticValidation: true,
123-
noSyntaxValidation: true,
124-
});
125-
126-
// Configure TypeScript defaults for JSX support
127-
monaco.languages.typescript.typescriptDefaults.setCompilerOptions({
128-
jsx: monaco.languages.typescript.JsxEmit.React,
129-
allowJs: true,
130-
allowSyntheticDefaultImports: true,
131-
esModuleInterop: true,
132-
moduleResolution: monaco.languages.typescript.ModuleResolutionKind.NodeJs,
133-
module: monaco.languages.typescript.ModuleKind.ESNext,
134-
target: monaco.languages.typescript.ScriptTarget.ESNext,
135-
jsxFactory: 'React.createElement',
136-
jsxFragmentFactory: 'React.Fragment',
137-
});
138-
139-
// Configure JavaScript defaults for JSX support
140-
monaco.languages.typescript.javascriptDefaults.setCompilerOptions({
141-
allowJs: true,
142-
allowSyntheticDefaultImports: true,
143-
esModuleInterop: true,
144-
jsx: monaco.languages.typescript.JsxEmit.React,
145-
moduleResolution: monaco.languages.typescript.ModuleResolutionKind.NodeJs,
146-
module: monaco.languages.typescript.ModuleKind.ESNext,
147-
target: monaco.languages.typescript.ScriptTarget.ESNext,
148-
jsxFactory: 'React.createElement',
149-
jsxFragmentFactory: 'React.Fragment',
150-
});
119+
monaco.editor.setTheme('vibesdk');
151120

152121
export type MonacoEditorProps = React.ComponentProps<'div'> & {
153122
createOptions?: monaco.editor.IStandaloneEditorConstructionOptions;
154123
find?: string;
155124
replace?: string;
125+
enableTypeScriptFeatures?: 'auto' | boolean;
156126
};
157127

158128
/**
@@ -163,6 +133,7 @@ export const MonacoEditor = memo<MonacoEditorProps>(function MonacoEditor({
163133
createOptions = {},
164134
find,
165135
replace,
136+
enableTypeScriptFeatures = 'auto',
166137
...props
167138
}) {
168139
const containerRef = useRef<HTMLDivElement>(null);
@@ -171,6 +142,63 @@ export const MonacoEditor = memo<MonacoEditorProps>(function MonacoEditor({
171142
const stickyScroll = useRef(true);
172143
const { theme } = useTheme();
173144

145+
const shouldEnableTypeScript = React.useMemo(() => {
146+
if (enableTypeScriptFeatures === 'auto') {
147+
return !createOptions.readOnly;
148+
}
149+
return enableTypeScriptFeatures;
150+
}, [enableTypeScriptFeatures, createOptions.readOnly]);
151+
152+
// Configure TypeScript diagnostics based on mode
153+
useEffect(() => {
154+
const tsDefaults = monaco.languages.typescript.typescriptDefaults;
155+
const jsDefaults = monaco.languages.typescript.javascriptDefaults;
156+
157+
if (shouldEnableTypeScript) {
158+
// Enable full IntelliSense for editing
159+
tsDefaults.setDiagnosticsOptions({
160+
noSemanticValidation: false,
161+
noSyntaxValidation: false,
162+
});
163+
tsDefaults.setCompilerOptions({
164+
jsx: monaco.languages.typescript.JsxEmit.React,
165+
allowJs: true,
166+
allowSyntheticDefaultImports: true,
167+
esModuleInterop: true,
168+
moduleResolution: monaco.languages.typescript.ModuleResolutionKind.NodeJs,
169+
module: monaco.languages.typescript.ModuleKind.ESNext,
170+
target: monaco.languages.typescript.ScriptTarget.ESNext,
171+
jsxFactory: 'React.createElement',
172+
jsxFragmentFactory: 'React.Fragment',
173+
});
174+
jsDefaults.setCompilerOptions({
175+
allowJs: true,
176+
allowSyntheticDefaultImports: true,
177+
esModuleInterop: true,
178+
jsx: monaco.languages.typescript.JsxEmit.React,
179+
moduleResolution: monaco.languages.typescript.ModuleResolutionKind.NodeJs,
180+
module: monaco.languages.typescript.ModuleKind.ESNext,
181+
target: monaco.languages.typescript.ScriptTarget.ESNext,
182+
jsxFactory: 'React.createElement',
183+
jsxFragmentFactory: 'React.Fragment',
184+
});
185+
} else {
186+
// Disable expensive features for viewing
187+
tsDefaults.setDiagnosticsOptions({
188+
noSemanticValidation: true,
189+
noSyntaxValidation: true,
190+
});
191+
tsDefaults.setCompilerOptions({
192+
jsx: monaco.languages.typescript.JsxEmit.React,
193+
target: monaco.languages.typescript.ScriptTarget.ESNext,
194+
});
195+
jsDefaults.setCompilerOptions({
196+
jsx: monaco.languages.typescript.JsxEmit.React,
197+
target: monaco.languages.typescript.ScriptTarget.ESNext,
198+
});
199+
}
200+
}, [shouldEnableTypeScript]);
201+
174202

175203
useEffect(() => {
176204
let configuredTheme = theme;
@@ -180,7 +208,7 @@ export const MonacoEditor = memo<MonacoEditorProps>(function MonacoEditor({
180208
editor.current = monaco.editor.create(containerRef.current!, {
181209
language: createOptions.language || 'typescript',
182210
minimap: { enabled: false },
183-
theme: configuredTheme === 'dark' ? 'v1-dev-dark' : 'v1-dev',
211+
theme: configuredTheme === 'dark' ? 'vibesdk-dark' : 'vibesdk',
184212
automaticLayout: true,
185213
value: defaultCode,
186214
fontSize: 13,
@@ -207,6 +235,10 @@ export const MonacoEditor = memo<MonacoEditorProps>(function MonacoEditor({
207235
}
208236

209237
return () => {
238+
const model = editor.current?.getModel();
239+
if (model) {
240+
model.dispose();
241+
}
210242
editor.current?.dispose();
211243
};
212244
// eslint-disable-next-line react-hooks/exhaustive-deps
@@ -217,10 +249,16 @@ export const MonacoEditor = memo<MonacoEditorProps>(function MonacoEditor({
217249
const model = editor.current.getModel();
218250
if (!model) return;
219251

220-
editor.current.setValue(createOptions.value || '');
252+
model.pushEditOperations(
253+
[],
254+
[{
255+
range: model.getFullModelRange(),
256+
text: createOptions.value || ''
257+
}],
258+
() => null
259+
);
221260

222261
if (stickyScroll.current) {
223-
// Scroll to bottom
224262
const lineCount = model.getLineCount();
225263
editor.current.revealLine(lineCount);
226264
}
@@ -293,7 +331,7 @@ export const MonacoEditor = memo<MonacoEditorProps>(function MonacoEditor({
293331
// Update theme when app theme changes
294332
useEffect(() => {
295333
if (editor.current) {
296-
monaco.editor.setTheme(theme === 'dark' ? 'v1-dev-dark' : 'v1-dev');
334+
monaco.editor.setTheme(theme === 'dark' ? 'vibesdk-dark' : 'vibesdk');
297335
}
298336
}, [theme]);
299337

src/routes/app/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ export default function AppView() {
10001000
'on',
10011001
scrollBeyondLastLine: false,
10021002
fontSize: 13,
1003-
theme: 'v1-dev',
1003+
theme: 'vibesdk',
10041004
automaticLayout: true,
10051005
}}
10061006
/>

src/routes/chat/chat.tsx

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -413,28 +413,7 @@ export default function Chat() {
413413
setView('editor');
414414
}
415415
}, [isGeneratingBlueprint, view]);
416-
417-
useEffect(() => {
418-
// Only show bootstrap completion message for NEW chats, not when reloading existing ones
419-
if (doneStreaming && !isGeneratingBlueprint && !blueprint && urlChatId === 'new') {
420-
onCompleteBootstrap();
421-
sendAiMessage(
422-
createAIMessage(
423-
'creating-blueprint',
424-
'Bootstrapping complete, now creating a blueprint for you...',
425-
true,
426-
),
427-
);
428-
}
429-
}, [
430-
doneStreaming,
431-
isGeneratingBlueprint,
432-
sendAiMessage,
433-
blueprint,
434-
onCompleteBootstrap,
435-
urlChatId,
436-
]);
437-
416+
438417
const isRunning = useMemo(() => {
439418
return (
440419
isBootstrapping || isGeneratingBlueprint // || codeGenState === 'active'
@@ -1183,7 +1162,7 @@ export default function Chat() {
11831162
lineNumbers: 'on',
11841163
scrollBeyondLastLine: false,
11851164
fontSize: 13,
1186-
theme: 'v1-dev',
1165+
theme: 'vibesdk',
11871166
automaticLayout: true,
11881167
}}
11891168
find={

src/routes/chat/hooks/use-chat.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ export function useChat({
294294
// Request file generation for new chats only
295295
if (!disableGenerate && urlChatId === 'new') {
296296
logger.debug('🔄 Starting code generation for new chat');
297+
setIsGenerating(true);
297298
sendWebSocketMessage(ws, 'generate_all');
298299
}
299300
});

0 commit comments

Comments
 (0)