Skip to content

Commit 811391e

Browse files
committed
Merge branch 'main' into per-tab-model-persistence
2 parents de68ac9 + 1c11f61 commit 811391e

File tree

693 files changed

+61917
-22321
lines changed

Some content is hidden

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

693 files changed

+61917
-22321
lines changed

.claude/lint-check.sh

Lines changed: 0 additions & 20 deletions
This file was deleted.

.claude/settings.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

.continue/rules/no-any-types.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
globs: "**/*.{ts,tsx}"
3+
---
4+
5+
Avoid using the `any` type wherever possible. Use unknown or find the correct type. The only acceptable place to use any is when typecasting for test mocks, and even then it's better to avoid and provide a proper mock.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: "Check LLM Changes"
2+
description: "Check if LLM-related files have changed and set environment variable to control API tests"
3+
outputs:
4+
llm_changed:
5+
description: "Whether LLM-related files have changed"
6+
value: ${{ steps.check-changes.outputs.llm_changed }}
7+
ignore_api_tests:
8+
description: "Whether to ignore API tests based on file changes and other conditions"
9+
value: ${{ steps.check-changes.outputs.ignore_api_tests }}
10+
inputs:
11+
is_fork:
12+
description: "Whether this is a fork PR"
13+
required: false
14+
default: "false"
15+
is_dependabot:
16+
description: "Whether this is a dependabot PR"
17+
required: false
18+
default: "false"
19+
20+
runs:
21+
using: "composite"
22+
steps:
23+
- name: Check if LLM-related files changed
24+
id: check-changes
25+
shell: bash
26+
run: |
27+
if [ "${{ github.event_name }}" = "push" ]; then
28+
# For push events, compare against the previous commit
29+
CHANGED_FILES=$(git diff --name-only HEAD~1...HEAD)
30+
else
31+
# For PR events, compare against the base branch
32+
git fetch origin ${{ github.event.pull_request.base.ref }}
33+
CHANGED_FILES=$(git diff --name-only origin/${{ github.event.pull_request.base.ref }}...HEAD)
34+
fi
35+
36+
echo "Changed files:"
37+
echo "$CHANGED_FILES"
38+
39+
# Check if any LLM-related files were changed
40+
LLM_CHANGED=false
41+
if echo "$CHANGED_FILES" | grep -E "(^core/llm/|^core/index\.ts|^core/package\.json|^core/jest\.config\.js|^packages/.*/(.*llm.*|.*openai.*|.*anthropic.*)|\.github/workflows/pr-checks\.yaml|\.github/actions/check-llm-changes/)" > /dev/null; then
42+
LLM_CHANGED=true
43+
fi
44+
45+
echo "LLM files changed: $LLM_CHANGED"
46+
echo "llm_changed=$LLM_CHANGED" >> $GITHUB_OUTPUT
47+
48+
# Determine whether to ignore API tests
49+
IGNORE_API_TESTS=false
50+
if [ "${{ inputs.is_fork }}" = "true" ] || [ "${{ inputs.is_dependabot }}" = "true" ] || [ "$LLM_CHANGED" = "false" ]; then
51+
IGNORE_API_TESTS=true
52+
fi
53+
54+
echo "Ignore API tests: $IGNORE_API_TESTS"
55+
echo "ignore_api_tests=$IGNORE_API_TESTS" >> $GITHUB_OUTPUT

.github/actions/run-jetbrains-tests/action.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -107,29 +107,15 @@ runs:
107107
cd binary
108108
npm run build
109109
110-
- name: Start test IDE
110+
- name: Run tests
111111
shell: bash
112112
run: |
113113
cd extensions/intellij
114114
export DISPLAY=:99.0
115115
Xvfb -ac :99 -screen 0 1920x1080x24 &
116116
sleep 10
117117
mkdir -p build/reports
118-
./gradlew runIdeForUiTests &
119-
120-
- name: Wait for JB connection
121-
uses: jtalk/url-health-check-action@v3
122-
with:
123-
url: http://127.0.0.1:8082
124-
max-attempts: 15
125-
retry-delay: 30s
126-
127-
- name: Run tests
128-
shell: bash
129-
run: |
130-
cd extensions/intellij
131-
export DISPLAY=:99.0
132-
./gradlew test
118+
./gradlew test testIntegration
133119
134120
- name: Move video
135121
if: ${{ failure() }}

.github/actions/run-vscode-e2e-test/action.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
name: 'Run VS Code E2E Test'
2-
description: 'Run a single VS Code E2E test with all required setup'
1+
name: "Run VS Code E2E Test"
2+
description: "Run a single VS Code E2E test with all required setup"
33
inputs:
44
test_file:
5-
description: 'E2E test file to run'
5+
description: "E2E test file to run"
66
required: true
77
command:
8-
description: 'Command to run (e2e:ci:run or e2e:ci:run-yaml)'
8+
description: "Command to run (e2e:ci:run or e2e:ci:run-yaml)"
99
required: true
1010
ssh_key:
11-
description: 'SSH private key for testing'
11+
description: "SSH private key for testing"
1212
required: false
1313
ssh_host:
14-
description: 'SSH host for testing'
14+
description: "SSH host for testing"
1515
required: false
1616
is_fork:
17-
description: 'Whether this is a fork (affects SSH tests)'
17+
description: "Whether this is a fork (affects SSH tests)"
1818
required: false
19-
default: 'false'
19+
default: "false"
2020

2121
runs:
22-
using: 'composite'
22+
using: "composite"
2323
steps:
2424
- uses: actions/setup-node@v4
2525
with:
@@ -58,6 +58,7 @@ runs:
5858
cd core
5959
npm ci
6060
cd ../extensions/vscode
61+
npm ci
6162
npm run e2e:ci:download
6263
else
6364
cd core
@@ -131,4 +132,4 @@ runs:
131132
uses: actions/upload-artifact@v4
132133
with:
133134
name: e2e-logs-${{ steps.sanitize_filename.outputs.sanitized_test_file || 'unknown' }}-${{ inputs.command == 'e2e:ci:run-yaml' && 'yaml' || 'json' }}
134-
path: extensions/vscode/e2e.log
135+
path: extensions/vscode/e2e.log
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
name: Auto Fix Failed Tests
2+
3+
on:
4+
workflow_run:
5+
workflows: ["PR Checks", "CLI PR Checks"]
6+
types:
7+
- completed
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
issues: write
13+
actions: read
14+
15+
jobs:
16+
fix-failed-tests:
17+
# Only run if the workflow failed
18+
# DISABLED: Remove 'false && ' on the next line to enable auto-fixing
19+
if: false && github.event.workflow_run.conclusion == 'failure'
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Get workflow run details
24+
id: workflow-details
25+
uses: actions/github-script@v8
26+
with:
27+
script: |
28+
const workflowRun = context.payload.workflow_run;
29+
const { data: jobs } = await github.rest.actions.listJobsForWorkflowRun({
30+
owner: context.repo.owner,
31+
repo: context.repo.repo,
32+
run_id: workflowRun.id
33+
});
34+
35+
// Find all failed jobs since we're only monitoring specific test workflows
36+
const failedJobs = jobs.jobs.filter(job => job.conclusion === 'failure');
37+
38+
if (failedJobs.length === 0) {
39+
core.info('No failed jobs found');
40+
return null;
41+
}
42+
43+
core.setOutput('has_failed_tests', 'true');
44+
core.setOutput('workflow_name', workflowRun.name);
45+
core.setOutput('workflow_run_id', workflowRun.id);
46+
core.setOutput('head_branch', workflowRun.head_branch);
47+
core.setOutput('head_sha', workflowRun.head_sha);
48+
core.setOutput('failed_jobs', JSON.stringify(failedJobs.map(j => j.name)));
49+
50+
return failedJobs;
51+
52+
- name: Get job logs for failed tests
53+
if: steps.workflow-details.outputs.has_failed_tests == 'true'
54+
id: get-logs
55+
uses: actions/github-script@v8
56+
with:
57+
script: |
58+
const workflowRunId = ${{ github.event.workflow_run.id }};
59+
const { data: jobs } = await github.rest.actions.listJobsForWorkflowRun({
60+
owner: context.repo.owner,
61+
repo: context.repo.repo,
62+
run_id: workflowRunId
63+
});
64+
65+
let errorLogs = '';
66+
67+
for (const job of jobs.jobs) {
68+
if (job.conclusion === 'failure') {
69+
try {
70+
const { data: logData } = await github.rest.actions.downloadJobLogsForWorkflowRun({
71+
owner: context.repo.owner,
72+
repo: context.repo.repo,
73+
job_id: job.id
74+
});
75+
76+
errorLogs += `\n\n=== Job: ${job.name} ===\n`;
77+
errorLogs += logData;
78+
} catch (error) {
79+
core.warning(`Could not fetch logs for job ${job.name}: ${error.message}`);
80+
}
81+
}
82+
}
83+
84+
// Store logs in environment file for next step
85+
const fs = require('fs');
86+
fs.writeFileSync('/tmp/test_failure_logs.txt', errorLogs);
87+
88+
core.setOutput('has_logs', errorLogs.length > 0 ? 'true' : 'false');
89+
90+
- name: Checkout repository
91+
if: steps.workflow-details.outputs.has_failed_tests == 'true'
92+
uses: actions/checkout@v5
93+
with:
94+
token: ${{ secrets.GITHUB_TOKEN }}
95+
fetch-depth: 0
96+
ref: ${{ steps.workflow-details.outputs.head_sha }}
97+
98+
- name: Setup Node.js
99+
if: steps.workflow-details.outputs.has_failed_tests == 'true'
100+
uses: actions/setup-node@v5
101+
with:
102+
node-version: "20"
103+
104+
- name: Install Continue CLI globally
105+
if: steps.workflow-details.outputs.has_failed_tests == 'true'
106+
run: npm i -g @continuedev/cli
107+
108+
- name: Start remote session to fix failed tests
109+
if: steps.workflow-details.outputs.has_failed_tests == 'true'
110+
id: remote-session
111+
env:
112+
CONTINUE_API_KEY: ${{ secrets.CONTINUE_API_KEY }}
113+
run: |
114+
# Create a detailed prompt for fixing the failed tests
115+
cat > /tmp/fix_tests_prompt.txt << 'PROMPT_EOF'
116+
🔧 **Auto Test Fix Request**
117+
118+
The following tests failed in workflow "${{ steps.workflow-details.outputs.workflow_name }}" (Run ID: ${{ steps.workflow-details.outputs.workflow_run_id }}):
119+
120+
**Failed Jobs:** ${{ steps.workflow-details.outputs.failed_jobs }}
121+
**Branch:** ${{ steps.workflow-details.outputs.head_branch }}
122+
**Commit:** ${{ steps.workflow-details.outputs.head_sha }}
123+
124+
**Your Task:**
125+
1. Analyze the test failure logs and error messages
126+
2. Identify the root cause of the test failures
127+
3. Fix the failing tests by updating the test code or the underlying implementation
128+
4. Ensure all tests pass after your changes
129+
5. Commit your fixes with a descriptive message
130+
131+
**Test Failure Context:**
132+
Please examine the repository structure, run the failing tests locally to understand the errors, and implement appropriate fixes.
133+
134+
Focus on:
135+
- Understanding what the tests are trying to validate
136+
- Identifying why they're failing (code changes, environment issues, test logic errors)
137+
- Making minimal, targeted fixes that address the root cause
138+
- Ensuring the fixes don't break other functionality
139+
140+
Please start by examining the failing tests and their error messages, then proceed with the necessary fixes.
141+
PROMPT_EOF
142+
143+
echo "Starting Continue CLI remote session for test fixes..."
144+
echo "Prompt content:"
145+
cat /tmp/fix_tests_prompt.txt
146+
147+
# Start remote session and capture JSON output
148+
SESSION_OUTPUT=$(cat /tmp/fix_tests_prompt.txt | cn remote -s --branch ${{ steps.workflow-details.outputs.head_branch }})
149+
echo "Raw session output: $SESSION_OUTPUT"
150+
151+
# Extract URL from JSON output
152+
SESSION_URL=$(echo "$SESSION_OUTPUT" | jq -r '.url // empty')
153+
154+
if [ -z "$SESSION_URL" ] || [ "$SESSION_URL" = "null" ]; then
155+
echo "Failed to extract session URL from output: $SESSION_OUTPUT"
156+
exit 1
157+
fi
158+
159+
echo "session_url=$SESSION_URL" >> $GITHUB_OUTPUT
160+
echo "✅ Started remote session: $SESSION_URL"
161+
162+
- name: Log session details
163+
if: steps.workflow-details.outputs.has_failed_tests == 'true'
164+
run: |
165+
echo "✅ Successfully started auto-fix session for failed tests"
166+
echo "Workflow: ${{ steps.workflow-details.outputs.workflow_name }}"
167+
echo "Run ID: ${{ steps.workflow-details.outputs.workflow_run_id }}"
168+
echo "Branch: ${{ steps.workflow-details.outputs.head_branch }}"
169+
echo "Session URL: ${{ steps.remote-session.outputs.session_url }}"
170+
echo "Failed jobs: ${{ steps.workflow-details.outputs.failed_jobs }}"

.github/workflows/beta-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
token: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
2525

2626
- name: Setup Node.js
27-
uses: actions/setup-node@v4
27+
uses: actions/setup-node@v5
2828
with:
2929
node-version: 20
3030
registry-url: "https://registry.npmjs.org"

.github/workflows/cli-pr-checks.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
uses: actions/checkout@v5
2626

2727
- name: Setup Node.js
28-
uses: actions/setup-node@v4
28+
uses: actions/setup-node@v5
2929
with:
3030
node-version: 20
3131
cache: "npm"
@@ -59,14 +59,15 @@ jobs:
5959
matrix:
6060
os: [ubuntu-latest, windows-latest, macos-latest]
6161
node-version: [18, 20, 22, 24]
62+
fail-fast: false
6263
runs-on: ${{ matrix.os }}
6364

6465
steps:
6566
- name: Checkout code
6667
uses: actions/checkout@v5
6768

6869
- name: Setup Node.js ${{ matrix.node-version }}
69-
uses: actions/setup-node@v4
70+
uses: actions/setup-node@v5
7071
with:
7172
node-version: ${{ matrix.node-version }}
7273

0 commit comments

Comments
 (0)