Merge branch 'main' of https://github.com/continuedev/continue into uinstinct/cli-skip-index-home

This commit is contained in:
Dallin Romney 2025-09-08 17:53:08 -07:00
commit d172df7728
240 changed files with 11054 additions and 2883 deletions

View file

@ -1,25 +1,25 @@
name: 'Run VS Code E2E Test'
description: 'Run a single VS Code E2E test with all required setup'
name: "Run VS Code E2E Test"
description: "Run a single VS Code E2E test with all required setup"
inputs:
test_file:
description: 'E2E test file to run'
description: "E2E test file to run"
required: true
command:
description: 'Command to run (e2e:ci:run or e2e:ci:run-yaml)'
description: "Command to run (e2e:ci:run or e2e:ci:run-yaml)"
required: true
ssh_key:
description: 'SSH private key for testing'
description: "SSH private key for testing"
required: false
ssh_host:
description: 'SSH host for testing'
description: "SSH host for testing"
required: false
is_fork:
description: 'Whether this is a fork (affects SSH tests)'
description: "Whether this is a fork (affects SSH tests)"
required: false
default: 'false'
default: "false"
runs:
using: 'composite'
using: "composite"
steps:
- uses: actions/setup-node@v4
with:
@ -58,6 +58,7 @@ runs:
cd core
npm ci
cd ../extensions/vscode
npm ci
npm run e2e:ci:download
else
cd core
@ -131,4 +132,4 @@ runs:
uses: actions/upload-artifact@v4
with:
name: e2e-logs-${{ steps.sanitize_filename.outputs.sanitized_test_file || 'unknown' }}-${{ inputs.command == 'e2e:ci:run-yaml' && 'yaml' || 'json' }}
path: extensions/vscode/e2e.log
path: extensions/vscode/e2e.log

View file

@ -0,0 +1,170 @@
name: Auto Fix Failed Tests
on:
workflow_run:
workflows: ["PR Checks", "CLI PR Checks"]
types:
- completed
permissions:
contents: write
pull-requests: write
issues: write
actions: read
jobs:
fix-failed-tests:
# Only run if the workflow failed
# DISABLED: Remove 'false && ' on the next line to enable auto-fixing
if: false && github.event.workflow_run.conclusion == 'failure'
runs-on: ubuntu-latest
steps:
- name: Get workflow run details
id: workflow-details
uses: actions/github-script@v7
with:
script: |
const workflowRun = context.payload.workflow_run;
const { data: jobs } = await github.rest.actions.listJobsForWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: workflowRun.id
});
// Find all failed jobs since we're only monitoring specific test workflows
const failedJobs = jobs.jobs.filter(job => job.conclusion === 'failure');
if (failedJobs.length === 0) {
core.info('No failed jobs found');
return null;
}
core.setOutput('has_failed_tests', 'true');
core.setOutput('workflow_name', workflowRun.name);
core.setOutput('workflow_run_id', workflowRun.id);
core.setOutput('head_branch', workflowRun.head_branch);
core.setOutput('head_sha', workflowRun.head_sha);
core.setOutput('failed_jobs', JSON.stringify(failedJobs.map(j => j.name)));
return failedJobs;
- name: Get job logs for failed tests
if: steps.workflow-details.outputs.has_failed_tests == 'true'
id: get-logs
uses: actions/github-script@v7
with:
script: |
const workflowRunId = ${{ github.event.workflow_run.id }};
const { data: jobs } = await github.rest.actions.listJobsForWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: workflowRunId
});
let errorLogs = '';
for (const job of jobs.jobs) {
if (job.conclusion === 'failure') {
try {
const { data: logData } = await github.rest.actions.downloadJobLogsForWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
job_id: job.id
});
errorLogs += `\n\n=== Job: ${job.name} ===\n`;
errorLogs += logData;
} catch (error) {
core.warning(`Could not fetch logs for job ${job.name}: ${error.message}`);
}
}
}
// Store logs in environment file for next step
const fs = require('fs');
fs.writeFileSync('/tmp/test_failure_logs.txt', errorLogs);
core.setOutput('has_logs', errorLogs.length > 0 ? 'true' : 'false');
- name: Checkout repository
if: steps.workflow-details.outputs.has_failed_tests == 'true'
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
ref: ${{ steps.workflow-details.outputs.head_sha }}
- name: Setup Node.js
if: steps.workflow-details.outputs.has_failed_tests == 'true'
uses: actions/setup-node@v5
with:
node-version: "20"
- name: Install Continue CLI globally
if: steps.workflow-details.outputs.has_failed_tests == 'true'
run: npm i -g @continuedev/cli
- name: Start remote session to fix failed tests
if: steps.workflow-details.outputs.has_failed_tests == 'true'
id: remote-session
env:
CONTINUE_API_KEY: ${{ secrets.CONTINUE_API_KEY }}
run: |
# Create a detailed prompt for fixing the failed tests
cat > /tmp/fix_tests_prompt.txt << 'PROMPT_EOF'
🔧 **Auto Test Fix Request**
The following tests failed in workflow "${{ steps.workflow-details.outputs.workflow_name }}" (Run ID: ${{ steps.workflow-details.outputs.workflow_run_id }}):
**Failed Jobs:** ${{ steps.workflow-details.outputs.failed_jobs }}
**Branch:** ${{ steps.workflow-details.outputs.head_branch }}
**Commit:** ${{ steps.workflow-details.outputs.head_sha }}
**Your Task:**
1. Analyze the test failure logs and error messages
2. Identify the root cause of the test failures
3. Fix the failing tests by updating the test code or the underlying implementation
4. Ensure all tests pass after your changes
5. Commit your fixes with a descriptive message
**Test Failure Context:**
Please examine the repository structure, run the failing tests locally to understand the errors, and implement appropriate fixes.
Focus on:
- Understanding what the tests are trying to validate
- Identifying why they're failing (code changes, environment issues, test logic errors)
- Making minimal, targeted fixes that address the root cause
- Ensuring the fixes don't break other functionality
Please start by examining the failing tests and their error messages, then proceed with the necessary fixes.
PROMPT_EOF
echo "Starting Continue CLI remote session for test fixes..."
echo "Prompt content:"
cat /tmp/fix_tests_prompt.txt
# Start remote session and capture JSON output
SESSION_OUTPUT=$(cat /tmp/fix_tests_prompt.txt | cn remote -s --branch ${{ steps.workflow-details.outputs.head_branch }})
echo "Raw session output: $SESSION_OUTPUT"
# Extract URL from JSON output
SESSION_URL=$(echo "$SESSION_OUTPUT" | jq -r '.url // empty')
if [ -z "$SESSION_URL" ] || [ "$SESSION_URL" = "null" ]; then
echo "Failed to extract session URL from output: $SESSION_OUTPUT"
exit 1
fi
echo "session_url=$SESSION_URL" >> $GITHUB_OUTPUT
echo "✅ Started remote session: $SESSION_URL"
- name: Log session details
if: steps.workflow-details.outputs.has_failed_tests == 'true'
run: |
echo "✅ Successfully started auto-fix session for failed tests"
echo "Workflow: ${{ steps.workflow-details.outputs.workflow_name }}"
echo "Run ID: ${{ steps.workflow-details.outputs.workflow_run_id }}"
echo "Branch: ${{ steps.workflow-details.outputs.head_branch }}"
echo "Session URL: ${{ steps.remote-session.outputs.session_url }}"
echo "Failed jobs: ${{ steps.workflow-details.outputs.failed_jobs }}"

View file

@ -24,7 +24,7 @@ jobs:
token: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: 20
registry-url: "https://registry.npmjs.org"

View file

@ -25,7 +25,7 @@ jobs:
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: 20
cache: "npm"
@ -59,6 +59,7 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [18, 20, 22, 24]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
@ -66,7 +67,7 @@ jobs:
uses: actions/checkout@v5
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node-version }}

View file

@ -41,7 +41,7 @@ jobs:
- name: Add PR title guidance comment
if: always() && steps.pr-title-check.outputs.valid == 'false'
uses: actions/github-script@v7
uses: actions/github-script@v8
with:
script: |
const { data: comments } = await github.rest.issues.listComments({
@ -104,7 +104,7 @@ jobs:
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version-file: ".nvmrc"
cache: "npm"

View file

@ -152,7 +152,7 @@ jobs:
# # Setup Node.js
- name: Use Node.js from .nvmrc
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version-file: ".nvmrc"
@ -370,7 +370,7 @@ jobs:
# 2. Install npm dependencies
- name: Use Node.js from .nvmrc
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version-file: ".nvmrc"

View file

@ -44,7 +44,7 @@ jobs:
- name: Determine and apply tier label
if: steps.check-author.outputs.should_label == 'true'
uses: actions/github-script@v7
uses: actions/github-script@v8
with:
script: |
const pr = context.payload.pull_request;

View file

@ -20,7 +20,7 @@ jobs:
- id: check
working-directory: .
run: |
if [[ "${{ github.event.release.tag_name }}" == v1.0.*-vscode ]]; then
if [[ "${{ github.event.release.tag_name }}" == v1.2.*-vscode ]]; then
echo "should_run=true" >> $GITHUB_OUTPUT
else
echo "should_run=false" >> $GITHUB_OUTPUT
@ -70,7 +70,7 @@ jobs:
with:
fetch-depth: 0
- uses: actions/setup-node@v4
- uses: actions/setup-node@v5
with:
node-version-file: ".nvmrc"

View file

@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
- uses: actions/setup-node@v5
with:
node-version-file: ".nvmrc"
@ -224,7 +224,7 @@ jobs:
test_file_matrix: ${{ steps.vscode-get-test-file-matrix.outputs.test_file_matrix }}
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
- uses: actions/setup-node@v5
with:
node-version-file: ".nvmrc"
@ -342,7 +342,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
- uses: actions/setup-node@v5
with:
node-version: 20

View file

@ -70,7 +70,7 @@ jobs:
with:
fetch-depth: 0
- uses: actions/setup-node@v4
- uses: actions/setup-node@v5
with:
node-version-file: ".nvmrc"
@ -165,7 +165,7 @@ jobs:
# 4. Create PR with version bump
- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version-file: ".nvmrc"

View file

@ -27,6 +27,18 @@ jobs:
echo "contains_mention=false" >> $GITHUB_OUTPUT
fi
- name: Add eyes reaction to comment
if: steps.check-mention.outputs.contains_mention == 'true'
uses: actions/github-script@v8
with:
script: |
await github.rest.reactions.createForIssueComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: ${{ github.event.comment.id }},
content: 'eyes'
});
- name: Checkout PR branch
if: steps.check-mention.outputs.contains_mention == 'true'
uses: actions/checkout@v5
@ -37,7 +49,7 @@ jobs:
- name: Get PR information
if: steps.check-mention.outputs.contains_mention == 'true'
id: pr-info
uses: actions/github-script@v7
uses: actions/github-script@v8
with:
script: |
const { data: pr } = await github.rest.pulls.get({
@ -57,7 +69,7 @@ jobs:
- name: Setup Node.js
if: steps.check-mention.outputs.contains_mention == 'true'
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: "20"
@ -95,7 +107,7 @@ jobs:
- name: Comment with session URL
if: steps.check-mention.outputs.contains_mention == 'true' && steps.remote-session.outputs.session_url
uses: actions/github-script@v7
uses: actions/github-script@v8
with:
script: |
const commentBody = `I've started [a remote session](${{ steps.remote-session.outputs.session_url }}) to help with your request:
@ -130,6 +142,18 @@ jobs:
echo "contains_mention=false" >> $GITHUB_OUTPUT
fi
- name: Add eyes reaction to comment
if: steps.check-mention.outputs.contains_mention == 'true'
uses: actions/github-script@v8
with:
script: |
await github.rest.reactions.createForPullRequestReviewComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: ${{ github.event.comment.id }},
content: 'eyes'
});
- name: Checkout PR branch
if: steps.check-mention.outputs.contains_mention == 'true'
uses: actions/checkout@v5
@ -140,7 +164,7 @@ jobs:
- name: Setup Node.js
if: steps.check-mention.outputs.contains_mention == 'true'
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: "20"
@ -148,21 +172,59 @@ jobs:
if: steps.check-mention.outputs.contains_mention == 'true'
run: npm i -g @continuedev/cli
- name: Get review context
if: steps.check-mention.outputs.contains_mention == 'true'
id: review-context
uses: actions/github-script@v8
with:
script: |
let reviewContext = '';
// Check if this comment is a reply to another review comment
if (context.payload.comment.in_reply_to_id) {
try {
const { data: originalComment } = await github.rest.pulls.getReviewComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.in_reply_to_id
});
reviewContext = `**Original review comment by @${originalComment.user.login}:**
${originalComment.body}
**Reply by @${{ github.event.comment.user.login }}:**
${{ github.event.comment.body }}`;
} catch (error) {
console.log('Could not fetch original comment, using current comment only');
reviewContext = `**Review comment by @${{ github.event.comment.user.login }}:**
${{ github.event.comment.body }}`;
}
} else {
reviewContext = `**Review comment by @${{ github.event.comment.user.login }}:**
${{ github.event.comment.body }}`;
}
core.setOutput('context', reviewContext);
- name: Start remote session
if: steps.check-mention.outputs.contains_mention == 'true'
id: remote-session
env:
CONTINUE_API_KEY: ${{ secrets.CONTINUE_API_KEY }}
run: |
# Debug: Echo the branch we're starting the session on
echo "Starting remote session on branch: ${{ github.event.pull_request.head.ref }}"
# Create a temporary file for the prompt to handle special characters and newlines properly
cat > /tmp/prompt.txt << 'PROMPT_EOF'
Please help with the following code review comment from @${{ github.event.comment.user.login }} on PR #${{ github.event.pull_request.number }}:
Please help with the following code review discussion from PR #${{ github.event.pull_request.number }}:
**File:** ${{ github.event.comment.path }}
**Line:** ${{ github.event.comment.line || github.event.comment.original_line || 'N/A' }}
**Comment:** ${{ github.event.comment.body }}
Please analyze the specific file and line mentioned, understand the review feedback, implement the necessary changes, and commit them to this branch.
${{ steps.review-context.outputs.context }}
Please analyze the specific file and line mentioned, understand the review feedback and any discussion context, implement the necessary changes, and commit them to this branch.
PROMPT_EOF
# Debug output
@ -187,7 +249,7 @@ jobs:
- name: Comment with session URL
if: steps.check-mention.outputs.contains_mention == 'true' && steps.remote-session.outputs.session_url
uses: actions/github-script@v7
uses: actions/github-script@v8
with:
script: |
const commentBody = `I've started [a remote session](${{ steps.remote-session.outputs.session_url }}) to help with your request:

View file

@ -55,7 +55,7 @@ jobs:
uses: ./.github/actions/setup-packages
- name: Use Node.js from .nvmrc
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version-file: ".nvmrc"

View file

@ -190,7 +190,7 @@ jobs:
echo "confidence=$CONFIDENCE" >> $GITHUB_OUTPUT
- name: Comment with analysis
uses: actions/github-script@v7
uses: actions/github-script@v8
with:
script: |
let comment = '';
@ -307,7 +307,7 @@ jobs:
- name: Add labels
if: github.event_name == 'issues'
uses: actions/github-script@v7
uses: actions/github-script@v8
with:
script: |
const labels = [];

View file

@ -40,7 +40,7 @@ jobs:
token: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: 20
registry-url: "https://registry.npmjs.org"

View file

@ -10,7 +10,7 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
- uses: actions/stale@v10
with:
close-issue-message: "This issue was closed because it wasn't updated for 10 days after being marked stale. If it's still important, please reopen + comment and we'll gladly take another look!"
stale-issue-message: "This issue hasn't been updated in 90 days and will be closed after an additional 10 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue."

View file

@ -21,7 +21,7 @@ jobs:
gh auth login --with-token <<< "${{ github.token }}"
- name: Use Node.js from .nvmrc
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version-file: ".nvmrc"

View file

@ -23,5 +23,5 @@ CHANGELOG.md
**/CODEOWNERS
core/vendor
coverage
e2e
# e2e
packages/continue-sdk

View file

@ -176,9 +176,9 @@ See [`intellij/CONTRIBUTING.md`](./extensions/intellij/CONTRIBUTING.md) for the
### Our Git Workflow
We keep a single permanent branch: `main`. When we are ready to create a "pre-release" version, we create a tag on the
`main` branch titled `v1.1.x-vscode`, which automatically triggers the workflow
`main` branch titled `v1.3.x-vscode`, which automatically triggers the workflow
in [preview.yaml](./.github/workflows/preview.yaml), which builds and releases a version of the VS Code extension. When
a release has been sufficiently tested, we will create a new release titled `v1.0x-vscode`, triggering a similar
a release has been sufficiently tested, we will create a new release titled `v1.2.x-vscode`, triggering a similar
workflow in [main.yaml](./.github/workflows/main.yaml), which will build and release a main release of the VS Code
extension. Any hotfixes can be made by creating a feature branch from the tag for the release in question. This workflow
is well explained by <http://releaseflow.org>.

View file

@ -73,7 +73,7 @@ runs:
- name: Install Continue CLI
if: env.SKIP_REVIEW != 'true'
shell: bash
run: npm install -g @continuedev/cli@1.4.25
run: npm install -g @continuedev/cli@1.4.30
- name: Build Inline Review Prompt
if: env.SKIP_REVIEW != 'true'
@ -194,6 +194,21 @@ runs:
exit 1
fi
# Validate API key
if [ -z "$CONTINUE_API_KEY" ]; then
echo "Warning: CONTINUE_API_KEY environment variable is not set"
# Create fallback review and continue
cat > inline_review.json << 'EOF'
{
"review_summary": "AI review skipped: CONTINUE_API_KEY not configured.",
"comments": []
}
EOF
echo "SKIP_CLI=true" >> $GITHUB_ENV
else
echo "SKIP_CLI=false" >> $GITHUB_ENV
fi
# Log the prompt for debugging
echo "===== START REVIEW PROMPT ====="
head -n 50 inline_review_prompt.txt
@ -201,23 +216,67 @@ runs:
tail -n 20 inline_review_prompt.txt
echo "===== END REVIEW PROMPT ====="
# Run the CLI and capture JSON output
cn --readonly --format json --org "${{ inputs.continue-org }}" --config "${{ inputs.continue-config }}" -p "$(cat inline_review_prompt.txt)" > inline_review_raw.json
# Log the output for debugging
echo "Initial Continue CLI output:"
cat inline_review_raw.json
# Validate JSON output and use it directly
if ! jq empty inline_review_raw.json 2>/dev/null; then
echo "Error: Invalid JSON output from Continue CLI"
exit 1
# Test Continue CLI availability
if [ "$SKIP_CLI" != "true" ]; then
echo "Testing Continue CLI..."
if ! cn --version; then
echo "Warning: Continue CLI not found or not working"
cat > inline_review.json << 'EOF'
{
"review_summary": "AI review skipped: Continue CLI installation failed.",
"comments": []
}
EOF
echo "SKIP_CLI=true" >> $GITHUB_ENV
else
echo "Continue CLI version: $(cn --version)"
fi
fi
# Run the CLI and capture JSON output with error handling
if [ "$SKIP_CLI" != "true" ]; then
echo "Executing Continue CLI with config: ${{ inputs.continue-org }}/${{ inputs.continue-config }}"
# Write prompt to temp file for better handling
PROMPT_FILE="/tmp/continue-prompt-$.txt"
cp inline_review_prompt.txt "$PROMPT_FILE"
# Use timeout to prevent hanging (240 seconds = 4 minutes)
if ! timeout 240 cn --config "${{ inputs.continue-org }}/${{ inputs.continue-config }}" -p "@$PROMPT_FILE" --allow Bash --format json > inline_review_raw.json 2>cli_error.log; then
echo "Warning: Continue CLI command failed"
echo "CLI error log:"
cat cli_error.log
# Create fallback review
cat > inline_review.json << 'EOF'
{
"review_summary": "AI review failed due to service initialization issues. Please check the Continue API key and configuration.",
"comments": []
}
EOF
echo "Created fallback review due to CLI failure"
else
# Log the output for debugging
echo "Initial Continue CLI output:"
cat inline_review_raw.json
# Validate JSON output and use it directly
if ! jq empty inline_review_raw.json 2>/dev/null; then
echo "Warning: Invalid JSON output from Continue CLI, using fallback"
cat > inline_review.json << 'EOF'
{
"review_summary": "AI review completed but failed to parse output correctly.",
"comments": []
}
EOF
else
# Use the JSON output directly
cp inline_review_raw.json inline_review.json
echo "Review output:"
cat inline_review.json
fi
fi
fi
# Use the JSON output directly
cp inline_review_raw.json inline_review.json
echo "Review output:"
cat inline_review.json
- name: Post Inline Review Comments
if: env.SKIP_REVIEW != 'true'

View file

@ -68,7 +68,7 @@ runs:
- name: Install Continue CLI
if: env.SHOULD_RUN == 'true'
shell: bash
run: npm install -g @continuedev/cli@1.4.25
run: npm install -g @continuedev/cli@1.4.30
- name: Build PR Review Prompt
if: env.SHOULD_RUN == 'true'
@ -157,6 +157,24 @@ runs:
echo "=================================="
echo ""
# Validate API key
if [ -z "$CONTINUE_API_KEY" ]; then
echo "Warning: CONTINUE_API_KEY environment variable is not set"
# Create fallback review and continue
cat > code_review.md << 'EOF'
## Code Review Summary
⚠️ AI review skipped: CONTINUE_API_KEY not configured.
### Configuration Required
- Please set the CONTINUE_API_KEY secret in repository settings
- Verify that the organization and config path are valid
EOF
echo "SKIP_CLI=true" >> $GITHUB_ENV
else
echo "SKIP_CLI=false" >> $GITHUB_ENV
fi
# Validate inputs to prevent command injection
if [[ ! "$CONTINUE_ORG" =~ ^[a-zA-Z0-9_-]+$ ]]; then
echo "Error: Invalid organization name. Must contain only alphanumeric characters, hyphens, and underscores."
@ -168,8 +186,55 @@ runs:
exit 1
fi
# Run the CLI with validated config
cn --readonly --org "$CONTINUE_ORG" --config "$CONTINUE_CONFIG" -p "$(cat review_prompt.txt)" > code_review.md
# Test Continue CLI availability
if [ "$SKIP_CLI" != "true" ]; then
echo "Testing Continue CLI..."
if ! cn --version; then
echo "Warning: Continue CLI not found or not working"
cat > code_review.md << 'EOF'
## Code Review Summary
⚠️ AI review skipped: Continue CLI installation failed.
### Troubleshooting
- Check that npm installation succeeded
- Verify @continuedev/cli package is available
EOF
echo "SKIP_CLI=true" >> $GITHUB_ENV
else
echo "Continue CLI version: $(cn --version)"
fi
fi
# Run the CLI with validated config and error handling
if [ "$SKIP_CLI" != "true" ]; then
echo "Executing Continue CLI with config: $CONTINUE_ORG/$CONTINUE_CONFIG"
# Write prompt to temp file for better handling
PROMPT_FILE="/tmp/continue-prompt-$.txt"
cp review_prompt.txt "$PROMPT_FILE"
# Use timeout to prevent hanging (240 seconds = 4 minutes)
if ! timeout 240 cn --config "$CONTINUE_ORG/$CONTINUE_CONFIG" -p "@$PROMPT_FILE" --allow Bash > code_review.md 2>cli_error.log; then
echo "Error: Continue CLI command failed"
echo "CLI error log:"
cat cli_error.log
# Create fallback review
cat > code_review.md << 'EOF'
## Code Review Summary
⚠️ AI review failed due to service initialization issues. Please check the Continue API key and configuration.
### Troubleshooting
- Verify the CONTINUE_API_KEY secret is set correctly
- Check that the organization and config path are valid
- Ensure the Continue service is accessible
EOF
else
echo "Review generated successfully"
fi
fi
- name: Upload Review Results
if: env.SHOULD_RUN == 'true' && always()

View file

@ -106,6 +106,7 @@
"quick-lru": "^7.0.0",
"replicate": "^0.26.0",
"request": "^2.88.2",
"shell-quote": "^1.8.3",
"socket.io-client": "^4.7.3",
"sqlite": "^5.1.1",
"sqlite3": "^5.1.7",
@ -140,6 +141,7 @@
"@types/pg": "^8.11.6",
"@types/plist": "^3.0.5",
"@types/request": "^2.48.12",
"@types/shell-quote": "^1.7.5",
"@types/tar": "^6.1.13",
"@types/uuid": "^9.0.7",
"@types/win-ca": "^3.5.4",

View file

@ -202,6 +202,8 @@ export class ConfigHandler {
message: `Error loading Continue Hub assistants${e instanceof Error ? ":\n" + e.message : ""}`,
});
}
} else {
PolicySingleton.getInstance().policy = null;
}
// Load local org if not signed in or hub orgs fail
try {

View file

@ -57,6 +57,7 @@ import {
} from "../util/paths";
import { localPathToUri } from "../util/pathToUri";
import { PolicySingleton } from "../control-plane/PolicySingleton";
import CustomContextProviderClass from "../context/providers/CustomContextProvider";
import { getBaseToolDefinitions } from "../tools";
import { resolveRelativePathInDir } from "../util/ideUtils";
@ -544,16 +545,21 @@ async function intermediateToFinalConfig({
// Trigger MCP server refreshes (Config is reloaded again once connected!)
const mcpManager = MCPManagerSingleton.getInstance();
mcpManager.setConnections(
(config.experimental?.modelContextProtocolServers ?? []).map(
(server, index) => ({
id: `continue-mcp-server-${index + 1}`,
name: `MCP Server`,
...server,
}),
),
false,
);
const orgPolicy = PolicySingleton.getInstance().policy;
if (orgPolicy?.policy?.allowMcpServers === false) {
await mcpManager.shutdown();
} else {
mcpManager.setConnections(
(config.experimental?.modelContextProtocolServers ?? []).map(
(server, index) => ({
id: `continue-mcp-server-${index + 1}`,
name: `MCP Server`,
...server,
}),
),
false,
);
}
// Handle experimental modelRole config values for apply and edit
const inlineEditModel = getModelByRole(continueConfig, "inlineEdit")?.title;

View file

@ -332,12 +332,14 @@ export default async function doLoadConfig(options: {
}
}
if (
PolicySingleton.getInstance().policy?.policy?.allowAnonymousTelemetry ===
false
) {
// Org policies
const policy = PolicySingleton.getInstance().policy?.policy;
if (policy?.allowAnonymousTelemetry === false) {
newConfig.allowAnonymousTelemetry = false;
}
if (policy?.allowCodebaseIndexing === false) {
newConfig.disableIndexing = true;
}
// Setup telemetry only after (and if) we know it is enabled
await Telemetry.setup(

View file

@ -25,6 +25,7 @@ import { modifyAnyConfigWithSharedConfig } from "../sharedConfig";
import { convertPromptBlockToSlashCommand } from "../../commands/slash/promptBlockSlashCommand";
import { slashCommandFromPromptFile } from "../../commands/slash/promptFileSlashCommand";
import { getControlPlaneEnvSync } from "../../control-plane/env";
import { PolicySingleton } from "../../control-plane/PolicySingleton";
import { getBaseToolDefinitions } from "../../tools";
import { getCleanUriPath } from "../../util/uri";
import { loadConfigContextProviders } from "../loadContextProviders";
@ -378,21 +379,26 @@ async function configYamlToContinueConfig(options: {
// Trigger MCP server refreshes (Config is reloaded again once connected!)
const mcpManager = MCPManagerSingleton.getInstance();
mcpManager.setConnections(
(config.mcpServers ?? []).map((server) => ({
id: server.name,
name: server.name,
sourceFile: server.sourceFile,
transport: {
type: "stdio",
args: [],
...(server as any), // TODO: fix the types on mcpServers in config-yaml
},
timeout: server.connectionTimeout,
})),
false,
{ ide },
);
const orgPolicy = PolicySingleton.getInstance().policy;
if (orgPolicy?.policy?.allowMcpServers === false) {
await mcpManager.shutdown();
} else {
mcpManager.setConnections(
(config.mcpServers ?? []).map((server) => ({
id: server.name,
name: server.name,
sourceFile: server.sourceFile,
transport: {
type: "stdio",
args: [],
...(server as any), // TODO: fix the types on mcpServers in config-yaml
},
timeout: server.connectionTimeout,
})),
false,
{ ide },
);
}
return { config: continueConfig, errors: localErrors };
}

View file

@ -48,6 +48,21 @@ export class MCPManagerSingleton {
this.connections.delete(id);
}
async shutdown() {
if (this.connections.size > 0) {
await Promise.allSettled(
Array.from(this.connections.entries()).map(([id, connection]) => {
try {
connection.abortController.abort();
void connection.client.close();
} finally {
this.connections.delete(id);
}
}),
);
}
}
setConnections(
servers: MCPOptions[],
forceRefresh: boolean,

View file

@ -1009,6 +1009,37 @@ export class Core {
this.handleToolCall(toolCall),
);
on(
"tools/evaluatePolicy",
async ({ data: { toolName, basePolicy, args } }) => {
const { config } = await this.configHandler.loadConfig();
if (!config) {
throw new Error("Config not loaded");
}
const tool = config.tools.find((t) => t.function.name === toolName);
if (!tool) {
// Tool not found, return base policy
return { policy: basePolicy };
}
// Extract display value for specific tools
let displayValue: string | undefined;
if (toolName === "runTerminalCommand" && args.command) {
displayValue = args.command as string;
}
// If tool has evaluateToolCallPolicy function, use it
if (tool.evaluateToolCallPolicy) {
const evaluatedPolicy = tool.evaluateToolCallPolicy(basePolicy, args);
return { policy: evaluatedPolicy, displayValue };
}
// Otherwise return base policy unchanged
return { policy: basePolicy, displayValue };
},
);
on("isItemTooBig", async ({ data: { item } }) => {
return this.isItemTooBig(item);
});

9
core/index.d.ts vendored
View file

@ -1070,11 +1070,6 @@ export interface ToolExtras {
codeBaseIndexer?: CodebaseIndexer;
}
export type ToolPolicy =
| "allowedWithPermission"
| "allowedWithoutPermission"
| "disabled";
export interface Tool {
type: "function";
function: {
@ -1099,6 +1094,10 @@ export interface Tool {
exampleArgs?: Array<[string, string | number]>;
};
defaultToolPolicy?: ToolPolicy;
evaluateToolCallPolicy?: (
basePolicy: ToolPolicy,
parsedArgs: Record<string, unknown>,
) => ToolPolicy;
}
interface ToolChoice {

View file

@ -370,8 +370,17 @@ export abstract class BaseLLM implements ILLM {
},
});
if (error !== undefined) {
if (error === "cancel" || error.name === "AbortError") {
if (typeof error === "undefined") {
interaction?.logItem({
kind: "success",
promptTokens,
generatedTokens,
thinkingTokens,
usage,
});
return "success";
} else {
if (error === "cancel" || error?.name?.includes("AbortError")) {
interaction?.logItem({
kind: "cancel",
promptTokens,
@ -393,15 +402,6 @@ export abstract class BaseLLM implements ILLM {
});
return "error";
}
} else {
interaction?.logItem({
kind: "success",
promptTokens,
generatedTokens,
thinkingTokens,
usage,
});
return "success";
}
}
@ -615,6 +615,7 @@ export abstract class BaseLLM implements ILLM {
kind: "chunk",
chunk: formattedContent,
});
completion += formattedContent;
yield content;
}
@ -630,6 +631,7 @@ export abstract class BaseLLM implements ILLM {
kind: "chunk",
chunk,
});
completion += chunk;
yield chunk;
}

View file

@ -150,7 +150,7 @@ class Ollama extends BaseLLM implements ModelInstaller {
constructor(options: LLMOptions) {
super(options);
if (options.isFromAutoDetect) {
if (options.model === "AUTODETECT") {
return;
}
const headers: Record<string, string> = {

View file

@ -7,16 +7,23 @@ class Scaleway extends OpenAI {
static providerName = "scaleway";
static defaultOptions: Partial<LLMOptions> = {
apiBase: "https://api.scaleway.ai/v1/",
model: "qwen2.5-coder-32b-instruct",
model: "qwen3-coder-30b-a3b-instruct",
useLegacyCompletionsEndpoint: false,
};
private static MODEL_IDS: { [name: string]: string } = {
"llama3.1-8b": "llama-3.1-8b-instruct",
"llama3.3-70b": "llama-3.3-70b-instruct",
"pixtral-12b": "pixtral-12b-2409",
"mistral-small3.1": "mistral-small-3.1-24b-instruct-2503",
"mistral-small3.2": "mistral-small-3.2-24b-instruct-2506",
"devstral-small": "devstral-small-2505",
"deepseek-r1-distill-llama-70b": "deepseek-r1-distill-llama-70b",
"qwen2.5-coder-32b": "qwen2.5-coder-32b-instruct",
"qwen3-coder-30b-a3b": "qwen3-coder-30b-a3b-instruct",
"qwen3-235b-a22b": "qwen3-235b-a22b-instruct-2507",
"gemma-3-27b": "gemma-3-27b-it",
"gpt-oss-120b": "gpt-oss-120b",
};
protected _convertModelName(model: string) {

40
core/package-lock.json generated
View file

@ -17,6 +17,7 @@
"@continuedev/fetch": "file:../packages/fetch",
"@continuedev/llm-info": "file:../packages/llm-info",
"@continuedev/openai-adapters": "file:../packages/openai-adapters",
"@continuedev/terminal-security": "file:../packages/terminal-security",
"@modelcontextprotocol/sdk": "^1.12.0",
"@mozilla/readability": "^0.5.0",
"@octokit/rest": "^20.1.1",
@ -67,6 +68,7 @@
"quick-lru": "^7.0.0",
"replicate": "^0.26.0",
"request": "^2.88.2",
"shell-quote": "^1.8.3",
"socket.io-client": "^4.7.3",
"sqlite": "^5.1.1",
"sqlite3": "^5.1.7",
@ -101,6 +103,7 @@
"@types/pg": "^8.11.6",
"@types/plist": "^3.0.5",
"@types/request": "^2.48.12",
"@types/shell-quote": "^1.7.5",
"@types/tar": "^6.1.13",
"@types/uuid": "^9.0.7",
"@types/win-ca": "^3.5.4",
@ -236,6 +239,20 @@
"vitest": "^3.2.4"
}
},
"../packages/terminal-security": {
"name": "@continuedev/terminal-security",
"version": "1.0.0",
"license": "Apache-2.0",
"dependencies": {
"shell-quote": "^1.8.1"
},
"devDependencies": {
"@types/node": "^20.11.19",
"@types/shell-quote": "^1.7.5",
"typescript": "^5.5.2",
"vitest": "^1.6.0"
}
},
"node_modules/@75lb/deep-merge": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@75lb/deep-merge/-/deep-merge-1.1.2.tgz",
@ -2955,6 +2972,10 @@
"resolved": "../packages/openai-adapters",
"link": true
},
"node_modules/@continuedev/terminal-security": {
"resolved": "../packages/terminal-security",
"link": true
},
"node_modules/@dabh/diagnostics": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz",
@ -6892,6 +6913,13 @@
"node": ">= 0.12"
}
},
"node_modules/@types/shell-quote": {
"version": "1.7.5",
"resolved": "https://registry.npmjs.org/@types/shell-quote/-/shell-quote-1.7.5.tgz",
"integrity": "sha512-+UE8GAGRPbJVQDdxi16dgadcBfQ+KG2vgZhV1+3A1XmHbmwcdwhCUwIdy+d3pAGrbvgRoVSjeI9vOWyq376Yzw==",
"dev": true,
"license": "MIT"
},
"node_modules/@types/shimmer": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@types/shimmer/-/shimmer-1.2.0.tgz",
@ -17459,6 +17487,18 @@
"node": ">=8"
}
},
"node_modules/shell-quote": {
"version": "1.8.3",
"resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz",
"integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==",
"license": "MIT",
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/shiki": {
"version": "3.7.0",
"resolved": "https://registry.npmjs.org/shiki/-/shiki-3.7.0.tgz",

View file

@ -34,6 +34,7 @@
"@types/pg": "^8.11.6",
"@types/plist": "^3.0.5",
"@types/request": "^2.48.12",
"@types/shell-quote": "^1.7.5",
"@types/tar": "^6.1.13",
"@types/uuid": "^9.0.7",
"@types/win-ca": "^3.5.4",
@ -61,6 +62,7 @@
"@continuedev/fetch": "file:../packages/fetch",
"@continuedev/llm-info": "file:../packages/llm-info",
"@continuedev/openai-adapters": "file:../packages/openai-adapters",
"@continuedev/terminal-security": "file:../packages/terminal-security",
"@modelcontextprotocol/sdk": "^1.12.0",
"@mozilla/readability": "^0.5.0",
"@octokit/rest": "^20.1.1",
@ -111,6 +113,7 @@
"quick-lru": "^7.0.0",
"replicate": "^0.26.0",
"request": "^2.88.2",
"shell-quote": "^1.8.3",
"socket.io-client": "^4.7.3",
"sqlite": "^5.1.1",
"sqlite3": "^5.1.7",

View file

@ -4,6 +4,7 @@ import {
DevDataLogEvent,
ModelRole,
} from "@continuedev/config-yaml";
import { ToolPolicy } from "@continuedev/terminal-security";
import {
AutocompleteInput,
@ -293,6 +294,10 @@ export type ToCoreFromIdeOrWebviewProtocol = {
{ toolCall: ToolCall },
{ contextItems: ContextItem[]; errorMessage?: string },
];
"tools/evaluatePolicy": [
{ toolName: string; basePolicy: ToolPolicy; args: Record<string, unknown> },
{ policy: ToolPolicy; displayValue?: string },
];
"clipboardCache/add": [{ content: string }, void];
"controlPlane/openUrl": [{ path: string; orgSlug?: string }, void];
"controlPlane/getEnvironment": [undefined, ControlPlaneEnv];

View file

@ -78,6 +78,7 @@ export const WEBVIEW_TO_CORE_PASS_THROUGH: (keyof ToCoreFromWebviewProtocol)[] =
"didChangeSelectedProfile",
"didChangeSelectedOrg",
"tools/call",
"tools/evaluatePolicy",
"controlPlane/getEnvironment",
"controlPlane/getFreeTrialStatus",
"controlPlane/getModelsAddOnUpgradeUrl",

View file

@ -1,5 +1,6 @@
export enum BuiltInToolNames {
ReadFile = "read_file",
ReadFileRange = "read_file_range",
EditExistingFile = "edit_existing_file",
SingleFindAndReplace = "single_find_and_replace",
MultiEdit = "multi_edit",

View file

@ -12,6 +12,8 @@ import { grepSearchImpl } from "./implementations/grepSearch";
import { lsToolImpl } from "./implementations/lsTool";
import { readCurrentlyOpenFileImpl } from "./implementations/readCurrentlyOpenFile";
import { readFileImpl } from "./implementations/readFile";
import { readFileRangeImpl } from "./implementations/readFileRange";
import { requestRuleImpl } from "./implementations/requestRule";
import { runTerminalCommandImpl } from "./implementations/runTerminalCommand";
import { searchWebImpl } from "./implementations/searchWeb";
@ -145,6 +147,8 @@ export async function callBuiltInTool(
switch (functionName) {
case BuiltInToolNames.ReadFile:
return await readFileImpl(args, extras);
case BuiltInToolNames.ReadFileRange:
return await readFileRangeImpl(args, extras);
case BuiltInToolNames.CreateNewFile:
return await createNewFileImpl(args, extras);
case BuiltInToolNames.GrepSearch:

View file

@ -8,7 +8,7 @@ export interface EditToolArgs {
}
export const NO_PARALLEL_TOOL_CALLING_INTSRUCTION =
"Note this tool CANNOT be called in parallel with other tools.";
"This tool CANNOT be called in parallel with other tools.";
const CHANGES_DESCRIPTION =
"Any modifications to the file, showing only needed changes. Do NOT wrap this in a codeblock or write anything besides the code changes. In larger files, use brief language-appropriate placeholders for large unmodified sections, e.g. '// ... existing code ...'";

View file

@ -9,6 +9,8 @@ export { lsTool } from "./ls";
export { multiEditTool } from "./multiEdit";
export { readCurrentlyOpenFileTool } from "./readCurrentlyOpenFile";
export { readFileTool } from "./readFile";
export { readFileRangeTool } from "./readFileRange";
export { requestRuleTool } from "./requestRule";
export { runTerminalCommandTool } from "./runTerminalCommand";
export { searchWebTool } from "./searchWeb";

View file

@ -1,6 +1,7 @@
import { Tool } from "../..";
import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn";
import { NO_PARALLEL_TOOL_CALLING_INTSRUCTION } from "./editFile";
import { singleFindAndReplaceTool } from "./singleFindAndReplace";
export interface EditOperation {
old_string: string;
@ -24,60 +25,41 @@ export const multiEditTool: Tool = {
isInstant: false,
function: {
name: BuiltInToolNames.MultiEdit,
description: `This is a tool for making multiple edits to a single file in one operation. It
is built on top of the single find and replace tool and allows you to perform multiple
find-and-replace operations efficiently. Prefer this tool over the single find and replace tool
when you need to make multiple edits to the same file.
description: `This is a tool for making multiple edits to a single file in one operation. It is built on top of the ${singleFindAndReplaceTool.function.name} and allows you to perform multiple find-and-replace operations efficiently.
Prefer this tool over the ${singleFindAndReplaceTool.function.name} tool when you need to make multiple edits to the same file.
Before using this tool:
1. Use the read_file tool to understand the file's contents and context
2. Verify the directory path is correct
To make multiple file edits, provide the following:
1. filepath: The path to the file to modify (relative to the root of the workspace)
To make multiple edits to a file, provide the following:
1. filepath: The path to the file to modify, RELATIVE to the project/workspace root (verify the directory path is correct)
2. edits: An array of edit operations to perform, where each edit contains:
- old_string: The text to replace (must match the file contents exactly, including all whitespace and indentation)
- old_string: The text to replace (must match the old file contents exactly, including all whitespace/indentation)
- new_string: The edited text to replace the old_string
- replace_all: Replace all occurrences of old_string. This parameter is optional and defaults to false.
IMPORTANT:
- All edits are applied in sequence, in the order they are provided
- Each edit operates on the result of the previous edit
- All edits must be valid for the operation to succeed - if any edit fails,
none will be applied
- This tool is ideal when you need to make several changes to different parts
of the same file
- Each edit operates on the result of the previous edit, so plan your edits carefully to avoid conflicts between sequential operations
- Edits are atomic - all edits must be valid for the operation to succeed - if any edit fails, none will be applied
- This tool is ideal when you need to make several changes to different parts of the same file
CRITICAL REQUIREMENTS:
1. All edits follow the same requirements as the single find and replace tool
2. The edits are atomic - either all succeed or none are applied
3. Plan your edits carefully to avoid conflicts between sequential operations
4. ${NO_PARALLEL_TOOL_CALLING_INTSRUCTION}
WARNING:
- The tool will fail if edits.old_string doesn't match the file contents
exactly (including whitespace)
- The tool will fail if edits.old_string and edits.new_string are the same
- Since edits are applied in sequence, ensure that earlier edits don't affect
the text that later edits are trying to find
When making edits:
1. ALWAYS use the ${BuiltInToolNames.ReadFile} tool just before making edits, to understand the file's up-to-date contents and context. The user can also edit the file while you are working with it.
2. ${NO_PARALLEL_TOOL_CALLING_INTSRUCTION}
3. When making edits:
- Ensure all edits result in idiomatic, correct code
- Do not leave the code in a broken state
- Only use emojis if the user explicitly requests it. Avoid adding emojis to
files unless asked.
- Use replace_all for replacing and renaming strings across the file. This
parameter is useful if you want to rename a variable for instance.
- Only use emojis if the user explicitly requests it. Avoid adding emojis to files unless asked
- Use replace_all for replacing and renaming all matches for a string across the file. This parameter is useful if you want to rename a variable, for instance
If you want to create a new file, use:
- A new file path
- A new file path, including new directory if needed
- First edit: empty old_string and the new file's contents as new_string
- Subsequent edits are not allowed - there is no need since you are creating`,
- Subsequent edits are not allowed - there is no need since you are creating
- ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required
WARNINGS:
- If earlier edits affect the text that later edits are trying to find, files can become mangled
- The tool will fail if edits.old_string doesn't match the file contents exactly (including whitespace)
- The tool will fail if edits.old_string and edits.new_string are the same - they MUST be different`,
parameters: {
type: "object",
required: ["filepath", "edits"],
@ -97,16 +79,18 @@ If you want to create a new file, use:
properties: {
old_string: {
type: "string",
description: "The text to replace",
description:
"The text to replace (exact match including whitespace/indentation)",
},
new_string: {
type: "string",
description: "The text to replace it with",
description:
"The text to replace it with. MUST be different than old_string.",
},
replace_all: {
type: "boolean",
description:
"Replace all occurrences of old_string (default false)",
"Replace all occurrences of old_string (default false) in the file",
},
},
},

View file

@ -0,0 +1,51 @@
import { Tool } from "../..";
import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn";
export const readFileRangeTool: Tool = {
type: "function",
displayTitle: "Read File Range",
wouldLikeTo:
"read lines {{{ startLine }}}-{{{ endLine }}} of {{{ filepath }}}",
isCurrently:
"reading lines {{{ startLine }}}-{{{ endLine }}} of {{{ filepath }}}",
hasAlready:
"viewed lines {{{ startLine }}}-{{{ endLine }}} of {{{ filepath }}}",
readonly: true,
isInstant: true,
group: BUILT_IN_GROUP_NAME,
function: {
name: BuiltInToolNames.ReadFileRange,
description:
"Use this tool to read a specific range of lines from an existing file. Only supports positive line numbers (1-based from start). For reading from the end of a file, use the terminal tool with 'tail' command instead.",
parameters: {
type: "object",
required: ["filepath", "startLine", "endLine"],
properties: {
filepath: {
type: "string",
description:
"The path of the file to read, relative to the root of the workspace (NOT uri or absolute path)",
},
startLine: {
type: "number",
description:
"The starting line number (1-based from start). Must be a positive integer. Example: 1 = first line, 10 = tenth line",
},
endLine: {
type: "number",
description:
"The ending line number (1-based from start). Must be a positive integer greater than or equal to startLine. Example: 10 = tenth line, 20 = twentieth line",
},
},
},
},
systemMessageDescription: {
prefix: `To read a specific range of lines from a file, use the ${BuiltInToolNames.ReadFileRange} tool. Only supports positive line numbers (1-based from start). For reading from the end of files, use the terminal tool with 'tail' command instead:`,
exampleArgs: [
["filepath", "path/to/the_file.txt"],
["startLine", 10],
["endLine", 20],
],
},
defaultToolPolicy: "allowedWithoutPermission",
};

View file

@ -1,6 +1,10 @@
import os from "os";
import { Tool } from "../..";
import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn";
import {
evaluateTerminalCommandSecurity,
ToolPolicy,
} from "@continuedev/terminal-security";
/**
* Get the preferred shell for the current platform
@ -56,6 +60,15 @@ export const runTerminalCommandTool: Tool = {
},
},
defaultToolPolicy: "allowedWithPermission",
evaluateToolCallPolicy: (
basePolicy: ToolPolicy,
parsedArgs: Record<string, unknown>,
): ToolPolicy => {
return evaluateTerminalCommandSecurity(
basePolicy,
parsedArgs.command as string,
);
},
systemMessageDescription: {
prefix: `To run a terminal command, use the ${BuiltInToolNames.RunTerminalCommand} tool
${RUN_COMMAND_NOTES}

View file

@ -20,33 +20,18 @@ export const singleFindAndReplaceTool: Tool = {
isInstant: false,
function: {
name: BuiltInToolNames.SingleFindAndReplace,
description: `Performs exact string replacements in files.
Usage:
- You must use your \`read_file\` tool at least once in the conversation before
editing. This tool will error if you attempt an edit without reading the file.
- When editing text from read_file tool output, ensure you preserve the exact
indentation (tabs/spaces) as it appears AFTER the line number prefix. The line
number prefix format is: spaces + line number + tab. Everything after that tab
is the actual file content to match. Never include any part of the line number
prefix in the old_string or new_string.
- ALWAYS prefer editing existing files in the codebase. NEVER write new files
unless explicitly required.
- Only use emojis if the user explicitly requests it. Avoid adding emojis to
files unless asked.
description: `Performs exact string replacements in a file.
IMPORTANT:
- ALWAYS use the \`${BuiltInToolNames.ReadFile}\` tool just before making edits, to understand the file's up-to-date contents and context. The user can also edit the file while you are working with it.
- ${NO_PARALLEL_TOOL_CALLING_INTSRUCTION}
- When editing text from \`${BuiltInToolNames.ReadFile}\` tool output, ensure you preserve exact whitespace/indentation.
- Only use emojis if the user explicitly requests it. Avoid adding emojis to files unless asked.
- Use \`replace_all\` for replacing and renaming strings across the file. This parameter is useful if you want to rename a variable, for instance.
- The edit will FAIL if \`old_string\` is not unique in the file. Either provide
a larger string with more surrounding context to make it unique or use
\`replace_all\` to change every instance of \`old_string\`.
- Use \`replace_all\` for replacing and renaming strings across the file. This
parameter is useful if you want to rename a variable for instance.`,
WARNINGS:
- When not using \`replace_all\`, the edit will FAIL if \`old_string\` is not unique in the file. Either provide a larger string with more surrounding context to make it unique or use \`replace_all\` to change every instance of \`old_string\`.
- The edit will likely fail if you have not recently used the \`${BuiltInToolNames.ReadFile}\` tool to view up-to-date file contents.`,
parameters: {
type: "object",
required: ["filepath", "old_string", "new_string"],
@ -58,12 +43,13 @@ parameter is useful if you want to rename a variable for instance.`,
},
old_string: {
type: "string",
description: "The text to replace",
description:
"The text to replace - must be exact including whitespace/indentation",
},
new_string: {
type: "string",
description:
"The text to replace it with (must be different from old_string)",
"The text to replace it with (MUST be different from old_string)",
},
replace_all: {
type: "boolean",

View file

@ -0,0 +1,204 @@
import { expect, test, vi } from "vitest";
import { ToolExtras } from "../..";
import { readFileRangeImpl } from "./readFileRange";
// Mock the dependencies
vi.mock("../../util/ideUtils", () => ({
resolveRelativePathInDir: vi.fn(),
}));
vi.mock("../../util/uri", () => ({
getUriPathBasename: vi.fn(),
}));
vi.mock("./readFileLimit", () => ({
throwIfFileExceedsHalfOfContext: vi.fn(),
}));
test("readFileRangeImpl handles out-of-bounds ranges gracefully", async () => {
const { resolveRelativePathInDir } = await import("../../util/ideUtils");
const { getUriPathBasename } = await import("../../util/uri");
const { throwIfFileExceedsHalfOfContext } = await import("./readFileLimit");
// Mock the utility functions
vi.mocked(resolveRelativePathInDir).mockResolvedValue("file:///test.txt");
vi.mocked(getUriPathBasename).mockReturnValue("test.txt");
vi.mocked(throwIfFileExceedsHalfOfContext).mockResolvedValue(undefined);
// Test case 1: Start line beyond end of file
const mockIdeOutOfBounds = {
readRangeInFile: vi.fn().mockResolvedValue(""), // IDE returns empty string
};
const mockExtras1 = {
ide: mockIdeOutOfBounds,
config: { selectedModelByRole: { chat: { contextLength: 8192 } } },
} as unknown as ToolExtras;
const result1 = await readFileRangeImpl(
{
filepath: "test.txt",
startLine: 100, // Beyond end of file
endLine: 105,
},
mockExtras1,
);
expect(result1).toHaveLength(1);
expect(result1[0].content).toBe("");
expect(result1[0].description).toBe("test.txt (lines 100-105)");
// Test case 2: End line beyond end of file
const mockIdePartialRange = {
readRangeInFile: vi.fn().mockResolvedValue("line5\nline6"), // IDE returns available content
};
const mockExtras2 = {
ide: mockIdePartialRange,
config: { selectedModelByRole: { chat: { contextLength: 8192 } } },
} as unknown as ToolExtras;
const result2 = await readFileRangeImpl(
{
filepath: "test.txt",
startLine: 5,
endLine: 100, // Beyond end of file
},
mockExtras2,
);
expect(result2).toHaveLength(1);
expect(result2[0].content).toBe("line5\nline6");
expect(result2[0].description).toBe("test.txt (lines 5-100)");
// Verify that IDE methods were called with correct 0-based ranges
expect(mockIdeOutOfBounds.readRangeInFile).toHaveBeenCalledWith(
"file:///test.txt",
{
start: { line: 99, character: 0 }, // 100 - 1
end: { line: 104, character: Number.MAX_SAFE_INTEGER }, // 105 - 1
},
);
expect(mockIdePartialRange.readRangeInFile).toHaveBeenCalledWith(
"file:///test.txt",
{
start: { line: 4, character: 0 }, // 5 - 1
end: { line: 99, character: Number.MAX_SAFE_INTEGER }, // 100 - 1
},
);
});
test("readFileRangeImpl validates line number constraints", async () => {
const mockExtras = {
ide: { readRangeInFile: vi.fn(), readFile: vi.fn() },
config: { selectedModelByRole: { chat: { contextLength: 8192 } } },
} as unknown as ToolExtras;
// Test startLine < 1 (invalid)
await expect(
readFileRangeImpl(
{
filepath: "test.txt",
startLine: 0,
endLine: 5,
},
mockExtras,
),
).rejects.toThrow("startLine must be 1 or greater");
// Test negative startLine (no longer supported)
await expect(
readFileRangeImpl(
{
filepath: "test.txt",
startLine: -1,
endLine: 5,
},
mockExtras,
),
).rejects.toThrow("Negative line numbers are not supported");
// Test endLine < 1 (invalid)
await expect(
readFileRangeImpl(
{
filepath: "test.txt",
startLine: 1,
endLine: 0,
},
mockExtras,
),
).rejects.toThrow("endLine must be 1 or greater");
// Test negative endLine (no longer supported)
await expect(
readFileRangeImpl(
{
filepath: "test.txt",
startLine: 1,
endLine: -1,
},
mockExtras,
),
).rejects.toThrow("Negative line numbers are not supported");
// Test endLine < startLine
await expect(
readFileRangeImpl(
{
filepath: "test.txt",
startLine: 10,
endLine: 5,
},
mockExtras,
),
).rejects.toThrow(
"endLine (5) must be greater than or equal to startLine (10)",
);
});
test("readFileRangeImpl handles normal ranges correctly", async () => {
const { resolveRelativePathInDir } = await import("../../util/ideUtils");
const { getUriPathBasename } = await import("../../util/uri");
const { throwIfFileExceedsHalfOfContext } = await import("./readFileLimit");
vi.mocked(resolveRelativePathInDir).mockResolvedValue("file:///test.txt");
vi.mocked(getUriPathBasename).mockReturnValue("test.txt");
vi.mocked(throwIfFileExceedsHalfOfContext).mockResolvedValue(undefined);
const mockIde = {
readRangeInFile: vi.fn().mockResolvedValue("line2\nline3\nline4"),
};
const mockExtras = {
ide: mockIde,
config: { selectedModelByRole: { chat: { contextLength: 8192 } } },
} as unknown as ToolExtras;
const result = await readFileRangeImpl(
{
filepath: "src/test.py",
startLine: 2,
endLine: 4,
},
mockExtras,
);
expect(result).toHaveLength(1);
expect(result[0]).toEqual({
name: "test.txt",
description: "src/test.py (lines 2-4)",
content: "line2\nline3\nline4",
uri: {
type: "file",
value: "file:///test.txt",
},
});
// Verify correct 0-based conversion
expect(mockIde.readRangeInFile).toHaveBeenCalledWith("file:///test.txt", {
start: { line: 1, character: 0 }, // 2 - 1
end: { line: 3, character: Number.MAX_SAFE_INTEGER }, // 4 - 1
});
});

View file

@ -0,0 +1,68 @@
import { resolveRelativePathInDir } from "../../util/ideUtils";
import { getUriPathBasename } from "../../util/uri";
import { ToolImpl } from ".";
import { getNumberArg, getStringArg } from "../parseArgs";
import { throwIfFileExceedsHalfOfContext } from "./readFileLimit";
export const readFileRangeImpl: ToolImpl = async (args, extras) => {
const filepath = getStringArg(args, "filepath");
const startLine = getNumberArg(args, "startLine");
const endLine = getNumberArg(args, "endLine");
// Validate that line numbers are positive integers
if (startLine < 1) {
throw new Error(
"startLine must be 1 or greater. Negative line numbers are not supported - use the terminal tool with 'tail' command for reading from file end.",
);
}
if (endLine < 1) {
throw new Error(
"endLine must be 1 or greater. Negative line numbers are not supported - use the terminal tool with 'tail' command for reading from file end.",
);
}
if (endLine < startLine) {
throw new Error(
`endLine (${endLine}) must be greater than or equal to startLine (${startLine})`,
);
}
const firstUriMatch = await resolveRelativePathInDir(filepath, extras.ide);
if (!firstUriMatch) {
throw new Error(
`File "${filepath}" does not exist. You might want to check the path and try again.`,
);
}
// Use the IDE's readRangeInFile method with 0-based range (IDE expects 0-based internally)
const content = await extras.ide.readRangeInFile(firstUriMatch, {
start: {
line: startLine - 1, // Convert from 1-based to 0-based
character: 0,
},
end: {
line: endLine - 1, // Convert from 1-based to 0-based
character: Number.MAX_SAFE_INTEGER, // Read to end of line
},
});
await throwIfFileExceedsHalfOfContext(
filepath,
content,
extras.config.selectedModelByRole.chat,
);
const rangeDescription = `${filepath} (lines ${startLine}-${endLine})`;
return [
{
name: getUriPathBasename(firstUriMatch),
description: rangeDescription,
content,
uri: {
type: "file",
value: firstUriMatch,
},
},
];
};

View file

@ -0,0 +1,60 @@
import { expect, test } from "vitest";
import { getNumberArg } from "../parseArgs";
test("readFileRange should validate positive line number arguments", () => {
// Test positive startLine validation
expect(() => getNumberArg({ startLine: 1 }, "startLine")).not.toThrow();
expect(() => getNumberArg({ startLine: "1" }, "startLine")).not.toThrow();
expect(() => getNumberArg({ startLine: 100 }, "startLine")).not.toThrow();
// Test positive endLine validation
expect(() => getNumberArg({ endLine: 5 }, "endLine")).not.toThrow();
expect(() => getNumberArg({ endLine: "10" }, "endLine")).not.toThrow();
expect(() => getNumberArg({ endLine: 1000 }, "endLine")).not.toThrow();
// Test missing arguments
expect(() => getNumberArg({}, "startLine")).toThrow(
"Argument `startLine` is required (type number)",
);
expect(() => getNumberArg({}, "endLine")).toThrow(
"Argument `endLine` is required (type number)",
);
// Test invalid arguments
expect(() =>
getNumberArg({ startLine: "not-a-number" }, "startLine"),
).toThrow("Argument `startLine` must be a valid number");
expect(() => getNumberArg({ endLine: true }, "endLine")).toThrow(
"Argument `endLine` must be a valid number",
);
});
test("readFileRange should handle line number conversion", () => {
// Test that our parsing function converts correctly
expect(getNumberArg({ line: 1 }, "line")).toBe(1);
expect(getNumberArg({ line: "5" }, "line")).toBe(5);
expect(getNumberArg({ line: 10.7 }, "line")).toBe(10); // Should floor
expect(getNumberArg({ line: "15.9" }, "line")).toBe(15); // Should floor
});
test("readFileRange parses negative numbers (validation happens in implementation)", () => {
// The parseArgs function should parse negative numbers correctly
// but the implementation will reject them with helpful error messages
expect(getNumberArg({ line: -1 }, "line")).toBe(-1);
expect(getNumberArg({ line: -10 }, "line")).toBe(-10);
expect(getNumberArg({ line: "-5" }, "line")).toBe(-5);
});
test("readFileRange handles out-of-bounds ranges gracefully", () => {
// IDE implementations handle out-of-bounds gracefully:
// - VS Code: Uses array.slice() which handles out-of-bounds gracefully
// - IntelliJ: Uses lines.getOrNull() which returns null for out-of-bounds
// Both return empty content or available content without throwing errors
expect(() => {
const startLine = getNumberArg({ startLine: 1000 }, "startLine");
const endLine = getNumberArg({ endLine: 2000 }, "endLine");
expect(startLine).toBe(1000);
expect(endLine).toBe(2000);
}).not.toThrow();
});

View file

@ -1,4 +1,12 @@
import { jest } from "@jest/globals";
import {
describe,
it,
expect,
beforeEach,
afterEach,
afterAll,
vi,
} from "vitest";
import * as childProcess from "node:child_process";
import * as fs from "node:fs";
import * as os from "node:os";
@ -6,17 +14,18 @@ import * as path from "node:path";
import { IDE, ToolExtras } from "../..";
import * as processBackgroundStates from "../../util/processTerminalBackgroundStates";
import { runTerminalCommandImpl } from "./runTerminalCommand";
import { runTerminalCommandTool } from "../definitions/runTerminalCommand";
// We're using real child processes, so ensure these aren't mocked
jest.unmock("node:child_process");
jest.unmock("node:util");
vi.unmock("node:child_process");
vi.unmock("node:util");
describe("runTerminalCommandImpl", () => {
// Setup mocks and spies
const mockGetIdeInfo = jest.fn();
const mockGetWorkspaceDirs = jest.fn();
const mockOnPartialOutput = jest.fn();
const mockRunCommand = jest.fn();
const mockGetIdeInfo = vi.fn();
const mockGetWorkspaceDirs = vi.fn();
const mockOnPartialOutput = vi.fn();
const mockRunCommand = vi.fn();
// Use a simple approach to ensure background processes are terminated
let testPid: number | null = null;
@ -27,7 +36,7 @@ describe("runTerminalCommandImpl", () => {
);
beforeEach(() => {
jest.resetAllMocks();
vi.resetAllMocks();
// Setup backgrounded processes handling - don't mock, just make sure it's empty
// Get any processes that might be already tracked and clear them
@ -73,7 +82,7 @@ describe("runTerminalCommandImpl", () => {
// Helper function to create a ToolExtras object
const createMockExtras = (
overrides: Partial<{
onPartialOutput?: jest.Mock;
onPartialOutput?: any;
remoteName?: string;
}> = {},
): ToolExtras => {
@ -90,16 +99,16 @@ describe("runTerminalCommandImpl", () => {
getWorkspaceDirs: mockGetWorkspaceDirs,
runCommand: mockRunCommand,
// Add stubs for other required IDE methods
getIdeSettings: jest.fn(),
getDiff: jest.fn(),
getClipboardContent: jest.fn(),
isTelemetryEnabled: jest.fn(),
readFile: jest.fn(),
writeFile: jest.fn(),
renameFile: jest.fn(),
deleteFile: jest.fn(),
globFiles: jest.fn(),
ls: jest.fn(),
getIdeSettings: vi.fn(),
getDiff: vi.fn(),
getClipboardContent: vi.fn(),
isTelemetryEnabled: vi.fn(),
readFile: vi.fn(),
writeFile: vi.fn(),
renameFile: vi.fn(),
deleteFile: vi.fn(),
globFiles: vi.fn(),
ls: vi.fn(),
};
// Create a base ToolExtras object with required properties
@ -147,7 +156,7 @@ describe("runTerminalCommandImpl", () => {
"`;
const args = { command, waitForCompletion: true };
const mockOutputFn = jest.fn();
const mockOutputFn = vi.fn();
const extras = createMockExtras({ onPartialOutput: mockOutputFn });
// Execute the command with streaming
@ -191,7 +200,7 @@ describe("runTerminalCommandImpl", () => {
"`;
const args = { command, waitForCompletion: false };
const mockOutputFn = jest.fn();
const mockOutputFn = vi.fn();
const extras = createMockExtras({ onPartialOutput: mockOutputFn });
const result = await runTerminalCommandImpl(args, extras);
@ -355,25 +364,25 @@ describe("runTerminalCommandImpl", () => {
it("should handle missing workspace directory gracefully", async () => {
// Mock IDE to return empty workspace directories
const mockEmptyWorkspace = jest.fn().mockReturnValue(Promise.resolve([]));
const mockEmptyWorkspace = vi.fn().mockReturnValue(Promise.resolve([]));
// Create IDE mock with empty workspace
const mockIde = {
getIdeInfo: jest
getIdeInfo: vi
.fn()
.mockReturnValue(Promise.resolve({ remoteName: "local" })),
getWorkspaceDirs: mockEmptyWorkspace,
runCommand: jest.fn(),
getIdeSettings: jest.fn(),
getDiff: jest.fn(),
getClipboardContent: jest.fn(),
isTelemetryEnabled: jest.fn(),
readFile: jest.fn(),
writeFile: jest.fn(),
renameFile: jest.fn(),
deleteFile: jest.fn(),
globFiles: jest.fn(),
ls: jest.fn(),
runCommand: vi.fn(),
getIdeSettings: vi.fn(),
getDiff: vi.fn(),
getClipboardContent: vi.fn(),
isTelemetryEnabled: vi.fn(),
readFile: vi.fn(),
writeFile: vi.fn(),
renameFile: vi.fn(),
deleteFile: vi.fn(),
globFiles: vi.fn(),
ls: vi.fn(),
};
const extras = {
@ -402,7 +411,7 @@ describe("runTerminalCommandImpl", () => {
it("should handle case where cwd fallbacks all fail", async () => {
// Mock IDE to return empty workspace directories
const mockEmptyWorkspace = jest.fn().mockReturnValue(Promise.resolve([]));
const mockEmptyWorkspace = vi.fn().mockReturnValue(Promise.resolve([]));
// Save original environment variables and process.cwd
const originalHome = process.env.HOME;
@ -413,27 +422,27 @@ describe("runTerminalCommandImpl", () => {
// Mock all fallbacks to fail
delete process.env.HOME;
delete process.env.USERPROFILE;
process.cwd = jest.fn().mockImplementation(() => {
process.cwd = vi.fn().mockImplementation(() => {
throw new Error("Current directory unavailable");
}) as jest.MockedFunction<() => string>;
}) as any;
// Create IDE mock with empty workspace
const mockIde = {
getIdeInfo: jest
getIdeInfo: vi
.fn()
.mockReturnValue(Promise.resolve({ remoteName: "local" })),
getWorkspaceDirs: mockEmptyWorkspace,
runCommand: jest.fn(),
getIdeSettings: jest.fn(),
getDiff: jest.fn(),
getClipboardContent: jest.fn(),
isTelemetryEnabled: jest.fn(),
readFile: jest.fn(),
writeFile: jest.fn(),
renameFile: jest.fn(),
deleteFile: jest.fn(),
globFiles: jest.fn(),
ls: jest.fn(),
runCommand: vi.fn(),
getIdeSettings: vi.fn(),
getDiff: vi.fn(),
getClipboardContent: vi.fn(),
isTelemetryEnabled: vi.fn(),
readFile: vi.fn(),
writeFile: vi.fn(),
renameFile: vi.fn(),
deleteFile: vi.fn(),
globFiles: vi.fn(),
ls: vi.fn(),
};
const extras = {
@ -472,3 +481,125 @@ describe("runTerminalCommandImpl", () => {
}
});
});
describe("runTerminalCommandTool.evaluateToolCallPolicy", () => {
it("should return base policy for safe commands like echo", () => {
const basePolicy = "allowedWithoutPermission";
const args = { command: "echo hello world" };
const result = runTerminalCommandTool.evaluateToolCallPolicy!(
basePolicy,
args,
);
expect(result).toBe("allowedWithoutPermission");
});
it("should respect disabled policy even for non-echo commands", () => {
const basePolicy = "disabled";
const args = { command: "ls -la" };
const result = runTerminalCommandTool.evaluateToolCallPolicy!(
basePolicy,
args,
);
expect(result).toBe("disabled");
});
it("should respect disabled policy even for safe commands", () => {
const basePolicy = "disabled";
const args = { command: "echo test" };
const result = runTerminalCommandTool.evaluateToolCallPolicy!(
basePolicy,
args,
);
expect(result).toBe("disabled");
});
it("should return base policy for non-echo commands", () => {
const basePolicy = "allowedWithoutPermission";
const args = { command: "ls -la" };
const result = runTerminalCommandTool.evaluateToolCallPolicy!(
basePolicy,
args,
);
expect(result).toBe("allowedWithoutPermission");
});
it("should return base policy for git commands", () => {
const basePolicy = "allowedWithPermission";
const args = { command: "git status" };
const result = runTerminalCommandTool.evaluateToolCallPolicy!(
basePolicy,
args,
);
expect(result).toBe("allowedWithPermission");
});
it("should handle undefined command gracefully", () => {
const basePolicy = "allowedWithoutPermission";
const args = { command: undefined };
const result = runTerminalCommandTool.evaluateToolCallPolicy!(
basePolicy,
args,
);
expect(result).toBe("allowedWithoutPermission");
});
it("should handle null command gracefully", () => {
const basePolicy = "allowedWithoutPermission";
const args = { command: null };
const result = runTerminalCommandTool.evaluateToolCallPolicy!(
basePolicy,
args,
);
expect(result).toBe("allowedWithoutPermission");
});
it("should handle empty command string", () => {
const basePolicy = "allowedWithoutPermission";
const args = { command: "" };
const result = runTerminalCommandTool.evaluateToolCallPolicy!(
basePolicy,
args,
);
expect(result).toBe("allowedWithoutPermission");
});
it("should disable dangerous commands like rm -rf /", () => {
const basePolicy = "allowedWithoutPermission";
const args = { command: "rm -rf /" };
const result = runTerminalCommandTool.evaluateToolCallPolicy!(
basePolicy,
args,
);
expect(result).toBe("disabled");
});
it("should require permission for high-risk network commands", () => {
const basePolicy = "allowedWithoutPermission";
const args = { command: "curl http://example.com" };
const result = runTerminalCommandTool.evaluateToolCallPolicy!(
basePolicy,
args,
);
expect(result).toBe("allowedWithPermission");
});
});

View file

@ -4,6 +4,7 @@ import * as toolDefinitions from "./definitions";
// I'm writing these as functions because we've messed up 3 TIMES by pushing to const, causing duplicate tool definitions on subsequent config loads.
export const getBaseToolDefinitions = () => [
toolDefinitions.readFileTool,
toolDefinitions.createNewFileTool,
toolDefinitions.runTerminalCommandTool,
toolDefinitions.globSearchTool,
@ -33,6 +34,7 @@ export const getConfigDependentToolDefinitions = (
toolDefinitions.viewRepoMapTool,
toolDefinitions.viewSubdirectoryTool,
toolDefinitions.codebaseTool,
toolDefinitions.readFileRangeTool,
);
}

View file

@ -40,6 +40,24 @@ export function getOptionalStringArg(
return getStringArg(args, argName, allowEmpty);
}
export function getNumberArg(args: any, argName: string): number {
if (!args || !(argName in args)) {
throw new Error(`Argument \`${argName}\` is required (type number)`);
}
const value = args[argName];
if (typeof value === "string") {
const parsed = parseInt(value, 10);
if (isNaN(parsed)) {
throw new Error(`Argument \`${argName}\` must be a valid number`);
}
return parsed;
}
if (typeof value !== "number" || isNaN(value)) {
throw new Error(`Argument \`${argName}\` must be a valid number`);
}
return Math.floor(value); // Ensure integer for line numbers (supports negative numbers)
}
export function getBooleanArg(args: any, argName: string, required = false) {
if (!args || !(argName in args)) {
if (required) {

View file

@ -2,6 +2,7 @@ import { describe, expect, it } from "vitest";
import { ToolCallDelta } from "..";
import {
getBooleanArg,
getNumberArg,
getOptionalStringArg,
getStringArg,
safeParseToolCallArgs,
@ -246,3 +247,86 @@ describe("getBooleanArg", () => {
);
});
});
describe("getNumberArg", () => {
it("should return number argument when valid", () => {
const args = { count: 42 };
const result = getNumberArg(args, "count");
expect(result).toBe(42);
});
it("should parse string numbers", () => {
const args = { count: "42" };
const result = getNumberArg(args, "count");
expect(result).toBe(42);
});
it("should floor decimal numbers", () => {
const args = { count: 42.7 };
const result = getNumberArg(args, "count");
expect(result).toBe(42);
});
it("should parse and floor string decimal numbers", () => {
const args = { count: "42.7" };
const result = getNumberArg(args, "count");
expect(result).toBe(42);
});
it("should throw error when argument is missing", () => {
const args = { otherArg: 42 };
expect(() => getNumberArg(args, "count")).toThrowError(
"Argument `count` is required (type number)",
);
});
it("should throw error when argument is not a number", () => {
const argsString = { count: "not-a-number" };
const argsBoolean = { count: true };
const argsObject = { count: {} };
expect(() => getNumberArg(argsString, "count")).toThrowError(
"Argument `count` must be a valid number",
);
expect(() => getNumberArg(argsBoolean, "count")).toThrowError(
"Argument `count` must be a valid number",
);
expect(() => getNumberArg(argsObject, "count")).toThrowError(
"Argument `count` must be a valid number",
);
});
it("should throw error when argument is NaN", () => {
const args = { count: NaN };
expect(() => getNumberArg(args, "count")).toThrowError(
"Argument `count` must be a valid number",
);
});
it("should handle negative numbers", () => {
const args = { count: -5 };
const result = getNumberArg(args, "count");
expect(result).toBe(-5);
});
it("should handle negative string numbers", () => {
const args = { count: "-10" };
const result = getNumberArg(args, "count");
expect(result).toBe(-10);
});
it("should handle zero", () => {
const args = { count: 0 };
const result = getNumberArg(args, "count");
expect(result).toBe(0);
});
it("should handle null or undefined args", () => {
expect(() => getNumberArg(null, "count")).toThrowError(
"Argument `count` is required (type number)",
);
expect(() => getNumberArg(undefined, "count")).toThrowError(
"Argument `count` is required (type number)",
);
});
});

View file

@ -2,7 +2,7 @@
title: "Chat"
sidebarTitle: "How To Use AI Chat"
icon: "circle-question"
description: "Learn how to use Continue's AI chat assistant to solve coding problems without leaving your IDE, including code context sharing, applying generated solutions, and switching between models"
description: "Learn how to use Continue's AI chat agent to solve coding problems without leaving your IDE, including code context sharing, applying generated solutions, and switching between models"
---
<Frame>

View file

@ -1,6 +1,6 @@
---
title: "Customization Overview"
description: "Learn how to customize Continue with model providers, context providers, slash commands, and tools to create your perfect AI coding assistant"
description: "Learn how to customize Continue with model providers, context providers, slash commands, and tools to create your perfect AI coding agent"
---
Continue can be deeply customized to fit your specific development workflow and preferences. This guide covers the main ways you can customize Continue to enhance your coding experience.
@ -21,15 +21,15 @@ Slash commands allow you to easily add custom functionality to Continue. You can
Unchain your LLM with the power of tools using [Agent](/features/agent/quick-start). Add custom tools using [MCP Servers](/customization/mcp-tools)
Whatever you choose, you'll probably start by editing your Assistant.
Whatever you choose, you'll probably start by editing your Agent.
## Edit Your Assistant
## Edit Your Agent
You can easily access your assistant configuration from the Continue Chat sidebar. Open the sidebar by pressing `cmd/ctrl` + `L` (VS Code) or `cmd/ctrl` + `J` (JetBrains) and click the Assistant selector above the main chat input. Then, you can hover over an assistant and click the `new window` (hub assistants) or `gear` (local assistants) icon.
You can easily access your agent configuration from the Continue Chat sidebar. Open the sidebar by pressing `cmd/ctrl` + `L` (VS Code) or `cmd/ctrl` + `J` (JetBrains) and click the Agent selector above the main chat input. Then, you can hover over an agent and click the `new window` (hub agents) or `gear` (local agents) icon.
![configure an assistant](/images/customization/images/configure-continue-a5c8c79f3304c08353f3fc727aa5da7e.png)
![configure an agent](/images/customization/images/configure-continue-a5c8c79f3304c08353f3fc727aa5da7e.png)
## Manage Your Assistant
## Manage Your Agent
- See [Editing Hub Assistants](/hub/assistants/edit-an-assistant) for more details on managing your hub assistant
- See the [Config Deep Dive](/reference) for more details on configuring local assistants.
- See [Editing Hub Agents](/hub/agents/edit-an-agent) for more details on managing your hub agent
- See the [Config Deep Dive](/reference) for more details on configuring local agents.

View file

@ -1,18 +1,18 @@
---
title: "Rules"
description: "Rules allow you to provide specific instructions that guide how the AI assistant behaves when working with your code. Instead of the AI making assumptions about your coding standards, architecture patterns, or project-specific requirements, you can explicitly define guidelines that ensure consistent, contextually appropriate responses."
description: "Rules allow you to provide specific instructions that guide how the AI agent behaves when working with your code. Instead of the AI making assumptions about your coding standards, architecture patterns, or project-specific requirements, you can explicitly define guidelines that ensure consistent, contextually appropriate responses."
---
Think of these as the guardrails for your AI coding assistants:
Think of these as the guardrails for your AI coding agents:
- **Enforce company-specific coding standards** and security practices
- **Implement quality checks** that match your engineering culture
- **Create paved paths** for developers to follow organizational best practices
By implementing rules, you transform the AI from a generic coding assistant into a knowledgeable team member that understands your project's unique requirements and constraints.
By implementing rules, you transform the AI from a generic coding agent into a knowledgeable team member that understands your project's unique requirements and constraints.
## How Rules Work
Your assistant detects rules and applies the specified rules while in [Agent](/features/agent/quick-start), [Chat](/features/chat/quick-start), and [Edit](/features/edit/quick-start) modes.
Your agent detects rules and applies the specified rules while in [Agent](/features/agent/quick-start), [Chat](/features/chat/quick-start), and [Edit](/features/edit/quick-start) modes.
Learn more in the [rules deep dive](/customize/deep-dives/rules), and view [`rules`](/reference#rules) in the YAML Reference for more details.

View file

@ -1,26 +1,26 @@
---
title: "How to Configure Continue Assistants"
description: Learn how to access and manage Continue assistant configurations through Hub or local YAML files
title: "How to Configure Continue Agents"
description: Learn how to access and manage Continue agent configurations through Hub or local YAML files
keywords: [config, settings, customize]
sidebarTitle: "Assistant Configuration"
sidebarTitle: "Agent Configuration"
---
You can easily access your assistant configuration from the Continue Chat sidebar. Open the sidebar by pressing <kbd>cmd/ctrl</kbd> + <kbd>L</kbd> (VS Code) or <kbd>cmd/ctrl</kbd> + <kbd>J</kbd> (JetBrains) and click the Assistant selector above the main chat input. Then, you can hover over an assistant and click the `new window` (hub assistants) or `gear` (local assistants) icon.
You can easily access your agent configuration from the Continue Chat sidebar. Open the sidebar by pressing <kbd>cmd/ctrl</kbd> + <kbd>L</kbd> (VS Code) or <kbd>cmd/ctrl</kbd> + <kbd>J</kbd> (JetBrains) and click the Agent selector above the main chat input. Then, you can hover over an agent and click the `new window` (hub agents) or `gear` (local agents) icon.
![configure an assistant](/images/configure-continue.png)
![configure an agent](/images/configure-continue.png)
## How to Manage Hub Assistants
## How to Manage Hub Agents
Hub Assistants can be managed in [the Hub](https://hub.continue.dev). See [Editing an Assistant](../../hub/assistants/edit-an-assistant.md)
Hub Agents can be managed in [the Hub](https://hub.continue.dev). See [Editing an Agent](../../hub/agents/edit-an-agent.md)
## How to Configure Local Assistants with YAML
## How to Configure Local Agents with YAML
Local user-level configuration is stored and can be edited in your home directory in `config.yaml`:
- `~/.continue/config.yaml` (MacOS / Linux)
- `%USERPROFILE%\.continue\config.yaml` (Windows)
To open this `config.yaml`, you need to open the assistants dropdown in the top-right portion of the chat input. On that dropdown beside the "Local Assistant" option, select the cog icon. It will open the local `config.yaml`.
To open this `config.yaml`, you need to open the agents dropdown in the top-right portion of the chat input. On that dropdown beside the "Local Agent" option, select the cog icon. It will open the local `config.yaml`.
![local-config-open-steps](/images/local-config-open-steps.png)

View file

@ -19,7 +19,7 @@ that can be set up with custom tools.
Currently custom tools can be configured using the Model Context
Protocol standard to unify prompts, context, and tool use.
MCP Servers can be added to hub Assistants using `mcpServers` blocks. You can
MCP Servers can be added to hub Agents using `mcpServers` blocks. You can
explore available MCP server blocks
[here](https://hub.continue.dev/explore/mcp).
@ -27,7 +27,7 @@ explore available MCP server blocks
## Quick Start: How to Set Up Your First MCP Server
Below is a quick example of setting up a new MCP server for use in your assistant:
Below is a quick example of setting up a new MCP server for use in your agent:
1. Create a folder called `.continue/mcpServers` at the top level of your workspace
2. Add a file called `playwright-mcp.yaml` to this folder.

View file

@ -42,7 +42,7 @@ Now test your rules by asking a question about a file in chat.
## How to Create Rules Blocks
Rules can be added locally using the "Add Rules" button while viewing the Local Assistant's rules.
Rules can be added locally using the "Add Rules" button while viewing the Local Agent's rules.
![add local rules button](/images/add-local-rules.png)
@ -53,7 +53,7 @@ For example, you can say "Create a rule for this", and a rule will be created fo
</Info>
Rules can also be added to an Assistant on the Continue Hub.
Rules can also be added to an Agent on the Continue Hub.
Explore available rules [here](https://hub.continue.dev), or [create your own](https://hub.continue.dev/new?type=block&blockType=rules) in the Hub.

View file

@ -39,7 +39,7 @@ Now test your rules by asking a question about a file in chat.
## Creating `rules` blocks
Rules can be added locally using the "Add Rules" button while viewing the Local Assistant's rules.
Rules can be added locally using the "Add Rules" button while viewing the Local Agent's rules.
![add local rules button](/images/add-local-rules.png)
@ -49,7 +49,7 @@ Automatically create local rule blocks: When in Agent mode, you can prompt the a
For example, you can say "Create a rule for this", and a rule will be created for you in `.continue/rules` based on your conversation.
</Info>
Rules can also be added to an Assistant on the Continue Hub.
Rules can also be added to an Agent on the Continue Hub.
Explore available rules [here](https://hub.continue.dev), or [create your own](https://hub.continue.dev/new?type=block&blockType=rules) in the Hub.
@ -133,7 +133,7 @@ name: New rule
Always give concise responses
```
This is also done when selecting "Add Rule" in the Assistant settings. This will create a new folder in `.continue/rules` with a default file named `new-rule.md`.
This is also done when selecting "Add Rule" in the Agent settings. This will create a new folder in `.continue/rules` with a default file named `new-rule.md`.
### Examples

View file

@ -21,9 +21,9 @@ Slash commands can be combined with additional instructions, including highlight
## Ways to Create Slash Commands in Continue
### Assistant Prompt Blocks
### Agent Prompt Blocks
The easiest way to add a slash command is by adding [`prompt` blocks](../../hub/blocks/block-types#prompts) to your assistant, which show up as slash commands in [Chat](../../features/chat/how-it-works).
The easiest way to add a slash command is by adding [`prompt` blocks](../../hub/blocks/block-types#prompts) to your agent, which show up as slash commands in [Chat](../../features/chat/how-it-works).
### Prompt Files

View file

@ -2,7 +2,7 @@
title: "Model roles"
sidebarTitle: Overview
icon: "circle-info"
description: "Learn about the different model roles in Continue including chat, autocomplete, edit, apply, embeddings, and reranking for customizing your AI coding assistant's capabilities"
description: "Learn about the different model roles in Continue including chat, autocomplete, edit, apply, embeddings, and reranking for customizing your AI coding agent's capabilities"
---
<CardGroup>

View file

@ -23,7 +23,7 @@ These roles can be specified for a `config.yaml` model block using `roles`. See
## Selecting model roles
You can control which of the models in your assistant for a given role will be currently used for that role. Above the main input, click the 3 dots and then the cube icon to expand the `Models` section. Then you can use the dropdowns to select an active model for each role.
You can control which of the models in your agent for a given role will be currently used for that role. Above the main input, click the 3 dots and then the cube icon to expand the `Models` section. Then you can use the dropdowns to select an active model for each role.
![Settings Active Models Section](/images/settings-model-roles.png)

View file

@ -16,7 +16,7 @@ These roles can be specified for a `config.yaml` model block using `roles`. See
## Selecting model roles
You can control which of the models in your assistant for a given role will be currently used for that role. Above the main input, click the 3 dots and then the cube icon to expand the `Models` section. Then you can use the dropdowns to select an active model for each role.
You can control which of the models in your agent for a given role will be currently used for that role. Above the main input, click the 3 dots and then the cube icon to expand the `Models` section. Then you can use the dropdowns to select an active model for each role.
<Frame>
<img src="/images/settings-model-roles-5e5f8a6bd9137b70cf94178a7e45847c.png" />

View file

@ -179,13 +179,13 @@
"pages": [
"hub/introduction",
{
"group": "Assistants",
"group": "agents",
"icon": "robot",
"pages": [
"hub/assistants/intro",
"hub/assistants/use-an-assistant",
"hub/assistants/create-an-assistant",
"hub/assistants/edit-an-assistant"
"hub/agents/intro",
"hub/agents/use-an-agent",
"hub/agents/create-an-agent",
"hub/agents/edit-an-agent"
]
},
{
@ -228,12 +228,13 @@
"group": "Guides",
"pages": [
"guides/overview",
"guides/understanding-assistants",
"guides/understanding-agents",
"guides/codebase-documentation-awareness",
"guides/cli",
"guides/continuous-ai",
"guides/plan-mode-guide",
"guides/ollama-guide",
"guides/instinct",
"guides/running-continue-without-internet",
"guides/custom-code-rag",
"guides/how-to-self-host-a-model"
@ -347,17 +348,13 @@
"source": "/hub/secrets",
"destination": "/hub/secrets/secret-types"
},
{
"source": "/hub/assistants",
"destination": "/hub/assistants/intro"
},
{
"source": "/hub/blocks",
"destination": "/hub/blocks/intro"
},
{
"source": "/hub/agents/intro",
"destination": "/hub/assistants/intro"
"destination": "/hub/agents/intro"
},
{
"source": "/customize",
@ -1105,7 +1102,7 @@
},
{
"source": "/troubleshooting#changes-to-assistants-not-showing-in-vs-code",
"destination": "/faqs#changes-to-assistants-not-showing-in-vs-code"
"destination": "/faqs#changes-to-agents-not-showing-in-vs-code"
},
{
"source": "/troubleshooting#i-installed-continue-but-dont-see-the-sidebar-window",
@ -1174,6 +1171,26 @@
{
"source": "/features/edit/next-edit",
"destination": "/features/autocomplete/next-edit"
},
{
"source": "/hub/assistants/intro",
"destination": "/hub/agents/intro"
},
{
"source": "/hub/assistants/use-an-assistant",
"destination": "/hub/agents/use-an-agent"
},
{
"source": "/hub/assistants/create-an-assistant",
"destination": "/hub/agents/create-an-agent"
},
{
"source": "/hub/assistants/edit-an-assistant",
"destination": "/hub/agents/edit-an-agent"
},
{
"source": "/guides/understanding-assistants",
"destination": "/guides/understanding-agents"
}
]
}

View file

@ -48,15 +48,15 @@ If you are using VS Code and require requests to be made through a proxy, you ar
Continue can be used in [code-server](https://coder.com/), but if you are running across an error in the logs that includes "This is likely because the editor is not running in a secure context", please see [their documentation on securely exposing code-server](https://coder.com/docs/code-server/latest/guide#expose-code-server).
## Changes to assistants not showing in VS Code
## Changes to agents not showing in VS Code
If you've made changes to assistants (adding, modifying, or removing them) but the changes aren't appearing in the Continue extension in VS Code, try reloading the VS Code window:
If you've made changes to agents (adding, modifying, or removing them) but the changes aren't appearing in the Continue extension in VS Code, try reloading the VS Code window:
1. Open the command palette (`cmd/ctrl` + `shift` + `P`)
2. Type "Reload Window"
3. Select the reload option
This will restart VS Code and reload all extensions, which should make your assistant changes visible.
This will restart VS Code and reload all extensions, which should make your agent changes visible.
## I installed Continue, but don't see the sidebar window
@ -256,7 +256,7 @@ If you're getting parse errors with remote Ollama:
3. **Check URL format**: Ensure you're using `http://` not `https://` for local network addresses
## Local Assistant
## Local Agent
### Managing Local Secrets and Environment Variables
@ -318,7 +318,7 @@ If your API keys aren't being recognized:
### Using Model Addons Locally
You can leverage model addons from the Continue Hub in your local assistant configurations using the `uses:` syntax. This allows you to reference pre-configured model blocks without duplicating configuration.
You can leverage model addons from the Continue Hub in your local agent configurations using the `uses:` syntax. This allows you to reference pre-configured model blocks without duplicating configuration.
#### Requirements
@ -330,7 +330,7 @@ You can leverage model addons from the Continue Hub in your local assistant conf
In your local `config.yaml`, reference model addons using the format `provider/model-name`:
```yaml
name: My Local Assistant
name: My Local Agent
version: 0.0.1
schema: v1
models:
@ -344,7 +344,7 @@ models:
You can combine hub model addons with local models:
```yaml
name: My Local Assistant
name: My Local Agent
version: 0.0.1
schema: v1
models:

View file

@ -6,7 +6,7 @@ sidebarTitle: "Customize Agent"
## How to Add Rules Blocks
Adding Rules can be done in your assistant locally or in the Hub. You can explore Rules on the Continue Hub and refer to the [Rules deep dive](/customize/deep-dives/rules) for more details.
Adding Rules can be done in your agent locally or in the Hub. You can explore Rules on the Continue Hub and refer to the [Rules deep dive](/customize/deep-dives/rules) for more details.
## How to Customize System Messages
@ -18,14 +18,14 @@ models:
provider: openai
model: gpt-4o
chatOptions:
baseSystemMessage: "You are a helpful coding assistant."
baseAgentSystemMessage: "You are a systematic coding assistant. Break down problems methodically."
basePlanSystemMessage: "You are a planning assistant. Create clear, actionable steps."
baseSystemMessage: "You are a helpful coding agent."
baseAgentSystemMessage: "You are a systematic coding agent. Break down problems methodically."
basePlanSystemMessage: "You are a planning agent. Create clear, actionable steps."
```
## How to Add MCP Tools
You can add MCP servers to your assistant to give Agent access to more tools. Explore [MCP Servers on the Hub](https://hub.continue.dev) and consult the [MCP guide](/customize/deep-dives/mcp) for more details.
You can add MCP servers to your agent to give Agent access to more tools. Explore [MCP Servers on the Hub](https://hub.continue.dev) and consult the [MCP guide](/customize/deep-dives/mcp) for more details.
## How to Configure Tool Policies

View file

@ -3,6 +3,6 @@ title: “Customize Autocomplete Settings in Continue”
description: “Learn how to customize autocomplete behavior in Continue, including user settings, configuration options, and adjustments to improve AI code suggestions in your IDE.”
---
Continue offers a handful of settings to customize autocomplete behavior. Visit the [User Settings Page](/customize/settings) to manage these settings.
Continue offers a handful of settings to customize autocomplete behavior. Visit the User Settings Page (Gear Icon) to manage these settings.
For a comprehensive guide on all configuration options and their impacts, see the [Autocomplete deep dive](/customize/deep-dives/autocomplete).

View file

@ -4,7 +4,8 @@ description: "Learn how Continue's Next Edit feature predicts and suggests your
---
<Warning>
Next Edit is currently an experimental feature. It requires [Mercury Coder
Next Edit is currently an experimental feature. It requires
[Instinct](https://hub.continue.dev/continuedev/instinct) or [Mercury Coder
model](https://hub.continue.dev/inceptionlabs/mercury-coder) configured in
your Continue autocomplete settings and is not yet available for JetBrains
use.
@ -71,18 +72,18 @@ Next Edit activates automatically when:
Next Edit requires:
- Compatible AI models (Mercury Coder)
- Compatible AI models (Mercury Coder or Instinct)
- Continue development team access
- VS Code (JetBrains support coming soon)
- **API Keys**: Organizations can add API keys to [org secrets](/hub/secrets/secret-types) for team-wide access. Individual users need to provide their own API keys in their [model configuration](/customize/model-providers/overview)
<Note>
To use Next Edit, you must have the Mercury Coder model configured in your
Continue autocomplete model settings. This model is specifically designed for
next edit predictions. Once it's been loaded, you must reload VS Code to
activate it.
To use Next Edit, you must have the Instinct or Mercury Coder model configured
in your Continue autocomplete model settings. This model is specifically
designed for next edit predictions. Once it's been loaded, you must reload VS
Code to activate it.
<img
src="/images/features/autocomplete/images/mercury-coder-next-edit.png"
src="/images/features/autocomplete/images/instinct-autocomplete.png"
alt="Next Edit Model Setup"
/>
</Note>
@ -117,6 +118,7 @@ Next Edit requires:
Next Edit requires AI models specifically trained for code prediction:
- **Mercury Coder**: Primary model optimized for next edit prediction
- **Instinct**: The leading open Next Edit model, trained by Continue
### Automatic Detection

View file

@ -6,7 +6,7 @@ sidebarTitle: "Customize Edit"
## How to Set Active Edit/Apply Model
You can configure particular models from your Assistant to be used for Edit and Apply requests.
You can configure particular models from your Agent to be used for Edit and Apply requests.
1. Click the 3 dots above the main input
2. Click the cube icon to expand the "Models" section

View file

@ -1,6 +1,6 @@
---
title: "Understanding Assistants"
title: "Understanding Agents"
description: "Continue offers two ways to configure your AI assistants"
---
This content has moved to our comprehensive guide: [Understanding Assistants: Hub vs Local Configuration](/guides/understanding-assistants)
This content has moved to our comprehensive guide: [Understanding Agents: Hub vs Local Configuration](/guides/understanding-assistants)

View file

@ -24,7 +24,7 @@ The Continue logo will appear on the left sidebar. For a better experience, move
</Step>
<Step title="Sign In">
[Sign in to the hub](https://auth.continue.dev/) to get started with your first assistant
[Sign in to the hub](https://auth.continue.dev/) to get started with your first agent
</Step>
</Steps>
@ -54,7 +54,7 @@ Click `Install`, which will cause the Continue logo to show up on the right tool
</Step>
<Step title="Sign In">
[Sign in to the hub](https://auth.continue.dev/) to get started with your first assistant
[Sign in to the hub](https://auth.continue.dev/) to get started with your first agent
</Step>
</Steps>
@ -68,6 +68,6 @@ Click `Install`, which will cause the Continue logo to show up on the right tool
## Signing in
Click "Get started" to sign in to the hub and start using assistants.
Click "Get started" to sign in to the hub and start using agents.
![Hub Onboarding in the Extension](/images/getting-started/images/hub-onboarding-card-81abd457b6d131c4b0aa89a5a6d647d3.png)

View file

@ -57,6 +57,6 @@ description: "To quickly understand what you can do with Continue, check out eac
</Tab>
</Tabs>
## AI Coding Assistants
## AI Coding Agents
Continue offers flexible AI assistants that enhance your development workflow. You can choose between cloud-managed **Hub Assistants** for easy setup and synchronization, or **Local Assistants** for complete control and privacy. Learn more about [understanding and configuring assistants](/guides/understanding-assistants).
Continue offers flexible AI assistants that enhance your development workflow. You can choose between cloud-managed **Hub Agents** for easy setup and synchronization, or **Local Agents** for complete control and privacy. Learn more about [understanding and configuring assistants](/guides/understanding-assistants).

View file

@ -247,12 +247,12 @@ Ready to master specific features? Check out these detailed guides:
<Accordion title="Chat & Agent Best Practices">
Discover [effective prompting techniques](/customize/deep-dives/prompts), [hub
v. local assistants](/guides/understanding-assistants), and [custom slash
v. local agents](/guides/understanding-agents), and [custom slash
commands](/customize/deep-dives/slash-commands).
</Accordion>
<Accordion title="Enterprise & Teams">
Explore [Hub Assistants](/hub/assistants/intro), [organization
Explore [Hub Agents](/hub/agents/intro), [organization
management](/hub/governance/creating-an-org), and [sharing
configurations](/hub/sharing).
</Accordion>

View file

@ -84,7 +84,6 @@ You can use the `gh` CLI to:
#### DeepWiki MCP
[DeepWiki MCP](https://hub.continue.dev/deepwiki/deepwiki-mcp) lets your agent explore any public GitHub repository.
```
Once configured, your agent can explore repositories like:
- "Explore the React repository structure"
@ -180,4 +179,4 @@ The new approach provides better integration with Continue's Agent features and
- Learn more about [MCP servers](/reference/continue-mcp)
- Explore [rules configuration](/customize/deep-dives/rules)
- Set up [custom assistants](/guides/understanding-assistants) with specific knowledge domains
- Set up [custom assistants](/guides/understanding-assistants) with specific knowledge domains

View file

@ -123,8 +123,8 @@ Track how often you need to correct AI output. Lower intervention rates mean hig
Imagine setting up an AI agent that checks new GitHub issues every morning and leaves the first helpful response. This lightens the load for maintainers and ensures community members feel heard quickly.
</Accordion>
<Accordion title="Pattern 2: The PR Review Assistant">
AI can automatically review new pull requests for security, performance, and style issues. The reviewer still has the final say, but the assistant highlights common problems and speeds up the feedback loop.
<Accordion title="Pattern 2: The PR Review Agent">
AI can automatically review new pull requests for security, performance, and style issues. The reviewer still has the final say, but the agent highlights common problems and speeds up the feedback loop.
</Accordion>
<Accordion title="Pattern 3: The Documentation Guardian">
@ -203,5 +203,5 @@ Ready to amplify your development workflow with Continuous AI? Start with one si
<Card title="Want to dive deeper?" icon="rocket">
Check out our guides on [Continue CLI](/guides/cli) and [Understanding
Assistants](/guides/understanding-assistants).
Agents](/guides/understanding-agents).
</Card>

39
docs/guides/instinct.mdx Normal file
View file

@ -0,0 +1,39 @@
---
title: "Using Instinct with Ollama in Continue"
description: "Learn how to run Instinct, Continue's leading open Next Edit model, on your own hardware with Ollama"
---
<Warning>
Instinct is a 7 billion parameter model. You should expect slow responses if
running on a laptop. To learn how to inference Instinct on a GPU, see our
[HuggingFace model card](https://huggingface.co/continuedev/instinct).
</Warning>
We recently released Instinct, a state-of-the-art open Next Edit model. Robustly fine-tuned from Qwen2.5-Coder-7B, Instinct intelligently predicts your next move to keep you in flow. To learn more about the model, check out [our blog post](https://blog.continue.dev).
<Frame>
<img src="/images/instinct.gif" />
</Frame>
### 1. Install Ollama
If you haven't already installed Ollama, see our guide [here](./ollama-guide.mdx).
### 2. Download Instinct
```bash
ollama run nate/instinct
```
### 3. Update your `config.yaml`
Open your `config.yaml` and add Instinct to the models section:
```yaml
# ... rest of config.yaml ...
models:
- uses: continuedev/instinct
```
Alternatively, you can just click to add the block at https://hub.continue.dev/continuedev/instinct.

View file

@ -86,8 +86,8 @@ There are multiple ways to configure Ollama models in Continue:
The easiest way is to use [pre-configured model blocks](/reference#local-blocks) from the Continue Hub in your local configuration:
```yaml title="~/.continue/assistants/My Local Assistant.yaml"
name: My Local Assistant
```yaml title="~/.continue/agents/My Local Agent.yaml"
name: My Local Agent
version: 0.0.1
schema: v1
models:
@ -309,11 +309,11 @@ ollama pull deepseek-r1:32b
#### Using Hub Blocks in Local Config
**Problem**: Unclear how to use hub models locally
**Solution**: Create a local assistant file:
**Solution**: Create a local agent file:
```yaml
# ~/.continue/assistants/Local.yaml
name: Local Assistant
# ~/.continue/agents/Local.yaml
name: Local Agent
version: 0.0.1
schema: v1
models:

View file

@ -1,63 +1,63 @@
---
title: "How to Understand Assistants: Hub vs Local Configuration"
description: "Learn how to choose between cloud-managed Hub assistants and local configuration for AI development assistance in Continue, including setup, management, and best practices for each approach"
title: "How to Understand Agents: Hub vs Local Configuration"
description: "Learn how to choose between cloud-managed Hub agents and local configuration for AI development assistance in Continue, including setup, management, and best practices for each approach"
---
Every developer has unique needs when it comes to AI assistance. Some prefer the convenience of cloud-managed configurations, while others need the control and privacy of local setups. Continue offers both paths, and this guide will help you choose the right one for your workflow.
## What Are the Two Paths to AI Assistance?
Continue provides two distinct ways to configure your AI assistant:
Continue provides two distinct ways to configure your AI agent:
Think of Continue's configuration options like choosing between a managed service and self-hosting. Both get you to the same destination—powerful AI assistance in your IDE—but the journey and control level differ significantly.
### How to Access Your Assistant Configuration
### How to Access Your Agent Configuration
Before we dive into the specifics, let's understand how to access your configuration:
1. Open the Continue Chat sidebar by pressing <kbd>cmd/ctrl</kbd> + <kbd>L</kbd> (VS Code) or <kbd>cmd/ctrl</kbd> + <kbd>J</kbd> (JetBrains)
2. Click the Assistant selector above the main chat input
3. Hover over an assistant and click:
- `new window` icon for Hub assistants
- `gear` icon for Local assistants
2. Click the Agent selector above the main chat input
3. Hover over an agent and click:
- `new window` icon for Hub agents
- `gear` icon for Local agents
![configure an assistant](/images/configure-continue.png)
![configure an agent](/images/configure-continue.png)
## What Are Hub Assistants: The Managed Experience
## What Are Hub Agents: The Managed Experience
Hub Assistants represent the "it just works" philosophy. When you [sign in to Continue Hub](https://auth.continue.dev/), you gain access to a curated ecosystem of pre-configured assistants that sync seamlessly across all your development environments.
Hub Agents represent the "it just works" philosophy. When you [sign in to Continue Hub](https://auth.continue.dev/), you gain access to a curated ecosystem of pre-configured agents that sync seamlessly across all your development environments.
### Why Should You Choose Hub Assistants?
### Why Should You Choose Hub Agents?
**The Power of Simplicity**
- **Instant Setup**: Browse the [assistant marketplace](https://hub.continue.dev/explore/assistants) and add any assistant to your account with a single click
- **Instant Setup**: Browse the [agent marketplace](https://hub.continue.dev) and add any agent to your account with a single click
- **Web-Based Management**: Configure models, add secrets, and customize settings through an intuitive web interface—no JSON editing required
- **Automatic Synchronization**: Make a change on the hub, and it reflects immediately across all your IDE instances
- **Team Collaboration**: Share custom assistants with your team, ensuring everyone uses the same optimized configurations
- **Team Collaboration**: Share custom agents with your team, ensuring everyone uses the same optimized configurations
![nextjs assistant](/images/nextjs-assistant.png)
![nextjs agent](/images/nextjs-assistant.png)
### How to Get Started with Hub Assistants
### How to Get Started with Hub Agents
The journey from zero to AI-powered coding takes just four steps:
1. **Select Your Assistant**: Click the assistant selector in your IDE's Continue panel
2. **Explore or Create**: Browse community assistants or craft your own specialized helper
1. **Select Your Agent**: Click the agent selector in your IDE's Continue panel
2. **Explore or Create**: Browse community agents or craft your own specialized helper
3. **Secure Your Keys**: Add API keys as [User Secrets](https://hub.continue.dev/settings/secrets) in the hub—they're encrypted and never exposed
4. **Sync and Code**: Click "Reload config" to pull your latest settings
Pro tip: Hub Assistants are perfect for teams. Create a custom assistant with your team's coding standards, preferred models, and context sources, then share it with a simple link.
Pro tip: Hub Agents are perfect for teams. Create a custom agent with your team's coding standards, preferred models, and context sources, then share it with a simple link.
### How to Manage Hub Assistants
### How to Manage Hub Agents
All Hub Assistant management happens through [the Hub](https://hub.continue.dev). For detailed customization, see our guide on [Editing an Assistant](/hub/assistants/edit-an-assistant).
All Hub Agent management happens through [the Hub](https://hub.continue.dev). For detailed customization, see our guide on [Editing an Agent](/hub/agents/edit-an-agent).
## What Are Local Assistants: The Power User's Choice
## What Are Local Agents: The Power User's Choice
Local Assistants put you in the driver's seat. Using a `config.yaml` file, you have complete control over every aspect of your AI assistant's behavior, with all configuration stored directly on your machine.
Local Agents put you in the driver's seat. Using a `config.yaml` file, you have complete control over every aspect of your AI agent's behavior, with all configuration stored directly on your machine.
### Why Should You Choose Local Assistants?
### Why Should You Choose Local Agents?
**Complete Control and Privacy**
@ -66,7 +66,7 @@ Local Assistants put you in the driver's seat. Using a `config.yaml` file, you h
- **Offline Capability**: Once configured, no internet connection needed (assuming you're using local models)
- **Unlimited Customization**: Access every configuration option, experimental feature, and advanced setting
### How to Set Up Local Assistants
### How to Set Up Local Agents
Local configuration lives in a single YAML file in your home directory:
@ -77,13 +77,13 @@ Local configuration lives in a single YAML file in your home directory:
**Quick Access Method:**
1. Open the assistants dropdown in your IDE
2. Click the gear icon next to "Local Assistant"
1. Open the agents dropdown in your IDE
2. Click the gear icon next to "Local Agent"
3. The `config.yaml` file opens in your editor
![local-config-open-steps](/images/local-config-open-steps.png)
### The Local Assistant Experience
### The Local Agent Experience
When you edit your `config.yaml`, Continue provides intelligent autocomplete for all available options. Save the file, and Continue automatically reloads your configuration—no restart required.
@ -93,9 +93,9 @@ For the complete configuration reference, see our [config.yaml documentation](/r
## How to Make the Right Choice
The decision between Hub and Local assistants often comes down to your specific needs and constraints. Here's a framework to help you decide:
The decision between Hub and Local agents often comes down to your specific needs and constraints. Here's a framework to help you decide:
### Choose Hub Assistants When You:
### Choose Hub Agents When You:
**Value Convenience Over Control**
@ -106,7 +106,7 @@ The decision between Hub and Local assistants often comes down to your specific
**Need Advanced Collaboration**
- Want to share custom assistants with teammates
- Want to share custom agents with teammates
- Need centralized API key management
- Require quick updates across your entire organization
@ -116,7 +116,7 @@ The decision between Hub and Local assistants often comes down to your specific
- Want to experiment with different models and configurations
- Prefer guided setup experiences
### Choose Local Assistants When You:
### Choose Local Agents When You:
**Require Maximum Control**
@ -140,21 +140,21 @@ The decision between Hub and Local assistants often comes down to your specific
Here's a secret: you don't have to choose just one. Many developers use both approaches:
- **Hub Assistants** for general development and experimentation
- **Local Assistants** for production work or client projects with specific requirements
- **Hub Agents** for general development and experimentation
- **Local Agents** for production work or client projects with specific requirements
You can switch between them seamlessly using the assistant selector in your IDE.
You can switch between them seamlessly using the agent selector in your IDE.
## Common Patterns and Best Practices
### For Hub Assistant Users
### For Hub Agent Users
1. **Start with Community Assistants**: Before creating your own, explore what others have built
1. **Start with Community Agents**: Before creating your own, explore what others have built
2. **Use Secrets Properly**: Never hardcode API keys—always use the User Secrets feature
3. **Create Specialized Assistants**: Make different assistants for different contexts (frontend, backend, DevOps)
3. **Create Specialized Agents**: Make different agents for different contexts (frontend, backend, DevOps)
4. **Share Liberally**: If you create something useful, share it with the community
### For Local Assistant Users
### For Local Agent Users
1. **Version Control Your Config**: Treat your `config.yaml` like code—commit it, review changes, and maintain history
2. **Use Environment Variables**: For sensitive data, reference environment variables instead of hardcoding values
@ -163,7 +163,7 @@ You can switch between them seamlessly using the assistant selector in your IDE.
## Troubleshooting and Tips
### Hub Assistant Issues
### Hub Agent Issues
**Changes Not Reflecting?**
@ -171,12 +171,12 @@ You can switch between them seamlessly using the assistant selector in your IDE.
- Check your internet connection
- Ensure you're signed in to the correct account
**Assistant Not Available?**
**Agent Not Available?**
- Verify it's added to your account on the hub
- Check if it requires specific API keys
### Local Assistant Issues
### Local Agent Issues
**Config Not Loading?**
@ -193,7 +193,7 @@ You can switch between them seamlessly using the assistant selector in your IDE.
Now that you understand both configuration approaches, you're ready to dive deeper:
- **For Hub Users**: [Create Your First Assistant](/hub/assistants/create-an-assistant)
- **For Hub Users**: [Create Your First Agent](/hub/agents/create-an-agent)
- **For Local Users**: [Explore the Config Reference](/reference)
- **For Everyone**: [Discover Available Models](/customize/model-providers/overview)

View file

@ -0,0 +1,34 @@
---
title: "How to Create an AI Agent"
description: "Learn how to create custom AI coding agents in Continue Hub by remixing existing agents or building new ones from scratch with reusable blocks and YAML configuration."
sidebarTitle: "Create an AI Agent"
---
## How to Create an AI Agent from Scratch
To create an agent from scratch, select “New agent” in the top bar.
![New agent button](/images/hub/assistants/images/assistant-new-button-16070e2cff9ce25ec9ebfeecb0e2f2b5.png)
Choose a name, slug, description, and icon for your agent.
The easiest way to create an agent is to click "Create agent" with the default configuration and then add / remove blocks using the sidebar.
Alternatively, you can edit the agent YAML directly before clicking "Create agent". Refer to examples of agents on [hub.continue.dev](https://hub.continue.dev) and visit the [YAML Reference](/reference#complete-yaml-config-example) docs for more details.
![New agent YAML](/images/hub/assistants/images/assistant-create-yaml-a991e5a81506f1c3ba611a664a50734c.png)
## How to Remix an Agent
You can also create an agent by remixing an existing one. This is useful if you want to start with a pre-configured agent and make modifications.
By clicking the “remix” button, you’ll be taken to the “Create a remix” page.
![Remix Agent Button](/images/hub/assistants/images/assistant-remix-button-728ececa73983140eeab42e33cc3903b.png)
Once here, you’ll be able to
1. add or remove blocks in YAML configuration
2. change the name, description, icon, etc.
Clicking “Create agent” will make this agent available for use.

View file

@ -0,0 +1,20 @@
---
title: "How to Edit an Agent"
description: "New versions of an agent can be created and published using the sidebar."
---
![Remix Agent Button](/images/hub/assistants/images/assistant-create-sidebar-608be49973f2a7723212adeb52dbcafb.png)
First, select an agent from the dropdown at the top.
While editing an agent, you can explore the hub and click "Add Block" from a block page to add it to your agent.
For blocks that require secret values like API keys, you will see a small notification on the block's tile in the sidebar that will indicate if action is needed.
To delete a block, click the trash icon.
If a block you want to use does not exist yet, you can [create a new block](/hub/blocks/create-a-block).
When you are done editing, click "Publish" to publish a new version of the agent.
Click "Open VS Code" or "Open JetBrains" to open your IDE for using the agent.

View file

@ -0,0 +1,8 @@
---
title: "Introduction to Agents"
description: "Custom AI code agents are configurations of building blocks that enable a coding experience tailored to your specific use cases."
---
`config.yaml` is a format for defining custom AI code agents. An agent has some top-level properties (e.g. `name`, `version`), but otherwise consists of composable lists of **blocks** such as `models` and `rules`, which are the atomic building blocks of an agent.
The `config.yaml` is parsed by the open-source Continue IDE extensions to create custom agent experiences. When you log in to [hub.continue.dev](https://hub.continue.dev/), your agents will automatically be synced with the IDE extensions.

View file

@ -0,0 +1,19 @@
---
title: "How to Use an Agent"
description: "Learn how to add, configure, and use an AI agent in Continue, including setting required inputs and selecting it in your IDE extension."
---
## Steps to Use an AI Agent in Continue
Once you've found the agent you want to use on Continue Hub:
1. Click “Add Agent” on its page
2. Add any required inputs (e.g. secrets like API keys)
3. Select “Save changes” in agent sidebar on the right hand side
After saving, open your IDE extension and:
- Select the agent from the **agent dropdown** in the Continue extension.
- Begin using it for chat, code generation, or other configured capabilities.
![Extension Agent Selector](/images/hub/assistants/images/assistant-extension-select.png)

View file

@ -1,34 +0,0 @@
---
title: "How to Create an AI Assistant"
description: "Learn how to create custom AI coding assistants in Continue Hub by remixing existing assistants or building new ones from scratch with reusable blocks and YAML configuration."
sidebarTitle: "Create an AI Assistant"
---
## How to Create an AI Assistant from Scratch
To create an assistant from scratch, select “New assistant” in the top bar.
![New assistant button](/images/hub/assistants/images/assistant-new-button-16070e2cff9ce25ec9ebfeecb0e2f2b5.png)
Choose a name, slug, description, and icon for your assistant.
The easiest way to create an assistant is to click "Create assistant" with the default configuration and then add / remove blocks using the sidebar.
Alternatively, you can edit the assistant YAML directly before clicking "Create assistant". Refer to examples of assistants on [hub.continue.dev](https://hub.continue.dev/explore/assistants) and visit the [YAML Reference](/reference#complete-yaml-config-example) docs for more details.
![New assistant YAML](/images/hub/assistants/images/assistant-create-yaml-a991e5a81506f1c3ba611a664a50734c.png)
## How to Remix an Assistant
You can also create an assistant by remixing an existing one. This is useful if you want to start with a pre-configured assistant and make modifications.
By clicking the “remix” button, you’ll be taken to the “Create a remix” page.
![Remix Assistant Button](/images/hub/assistants/images/assistant-remix-button-728ececa73983140eeab42e33cc3903b.png)
Once here, you’ll be able to
1. add or remove blocks in YAML configuration
2. change the name, description, icon, etc.
Clicking “Create assistant” will make this assistant available for use.

View file

@ -1,20 +0,0 @@
---
title: "How to Edit an Assistant"
description: "New versions of an assistant can be created and published using the sidebar."
---
![Remix Assistant Button](/images/hub/assistants/images/assistant-create-sidebar-608be49973f2a7723212adeb52dbcafb.png)
First, select an assistant from the dropdown at the top.
While editing an assistant, you can explore the hub and click "Add Block" from a block page to add it to your assistant.
For blocks that require secret values like API keys, you will see a small notification on the block's tile in the sidebar that will indicate if action is needed.
To delete a block, click the trash icon.
If a block you want to use does not exist yet, you can [create a new block](/hub/blocks/create-a-block).
When you are done editing, click "Publish" to publish a new version of the assistant.
Click "Open VS Code" or "Open JetBrains" to open your IDE for using the assistant.

View file

@ -1,8 +0,0 @@
---
title: "Introduction to Assistants"
description: "Custom AI code assistants are configurations of building blocks that enable a coding experience tailored to your specific use cases."
---
`config.yaml` is a format for defining custom AI code assistants. An assistant has some top-level properties (e.g. `name`, `version`), but otherwise consists of composable lists of **blocks** such as `models` and `rules`, which are the atomic building blocks of an assistant.
The `config.yaml` is parsed by the open-source Continue IDE extensions to create custom assistant experiences. When you log in to [hub.continue.dev](https://hub.continue.dev/), your assistants will automatically be synced with the IDE extensions.

View file

@ -1,19 +0,0 @@
---
title: "How to Use an Assistant"
description: "Learn how to add, configure, and use an AI assistant in Continue, including setting required inputs and selecting it in your IDE extension."
---
## Steps to Use an AI Assistant in Continue
Once you've found the assistant you want to use on Continue Hub:
1. Click “Add Assistant” on its page
2. Add any required inputs (e.g. secrets like API keys)
3. Select “Save changes” in assistant sidebar on the right hand side
After saving, open your IDE extension and:
- Select the assistant from the **assistant dropdown** in the Continue extension.
- Begin using it for chat, code generation, or other configured capabilities.
![Extension Assistant Selector](/images/hub/assistants/images/assistant-extension-select.png)

View file

@ -20,7 +20,7 @@ Learn more in the [MCP deep dive](/customize/deep-dives/mcp), and view [`mcpServ
## Rules
Rules blocks are instructions that your custom AI code assistant will always keep in mind - the contents of rules are inserted into the system message for all Chat requests. [Explore rules](https://hub.continue.dev/explore/rules) on the hub.
Rules blocks are instructions that your custom AI code agent will always keep in mind - the contents of rules are inserted into the system message for all Chat requests. [Explore rules](https://hub.continue.dev/explore/rules) on the hub.
Learn more in the [rules deep dive](/customize/deep-dives/rules), and view [`rules`](/reference#rules) in the YAML Reference for more details.

View file

@ -12,7 +12,7 @@ By clicking the “remix” button, you’ll be taken to the “Create a remix
![Remix block button](/images/hub/blocks/images/block-remix-button-913beb80672662855acc7013561c78d0.png)
Once here, you’ll be able to 1) edit YAML configuration for the block and 2) change name, description, icon, etc. Clicking “Create block” will make this block available for use in an assistant.
Once here, you’ll be able to 1) edit YAML configuration for the block and 2) change name, description, icon, etc. Clicking “Create block” will make this block available for use in an agent.
## How to Create a Block from Scratch
@ -26,4 +26,4 @@ After filling out information on the block, you will want to create a block foll
### Block Inputs
Blocks can receive values, including secrets, as inputs through templating. For values that the user of the block needs to set, you can use template variables (e.g. `${{ inputs.API_KEY}}`). Then, the user can set `API_KEY: ${{ secrets.MY_API_KEY }}` in the `with` clause of their assistant.
Blocks can receive values, including secrets, as inputs through templating. For values that the user of the block needs to set, you can use template variables (e.g. `${{ inputs.API_KEY}}`). Then, the user can set `API_KEY: ${{ secrets.MY_API_KEY }}` in the `with` clause of their agent.

View file

@ -1,6 +1,6 @@
---
title: "Introduction"
description: "Blocks are the components you use to build a custom AI code assistant. These include Models, MCP Servers, Rules, and Prompts."
description: "Blocks are the components you use to build a custom AI code agent. These include Models, MCP Servers, Rules, and Prompts."
---
Blocks follow the [`config.yaml`](/reference) format. When combined with other blocks into a complete `config.yaml`, they form a custom AI code assistant.
Blocks follow the [`config.yaml`](/reference) format. When combined with other blocks into a complete `config.yaml`, they form a custom AI code agent.

View file

@ -1,12 +1,12 @@
---
title: "How to Use a Block"
description: "Learn how to use blocks in Continue Hub to enhance your AI code assistant."
description: "Learn how to use blocks in Continue Hub to enhance your AI code agent."
---
Blocks are used to build custom AI code assistants in Continue Hub. Learn more:
Blocks are used to build custom AI code agents in Continue Hub. Learn more:
- [Create an assistant](/hub/assistants/create-an-assistant)
- [Edit an assistant](/hub/assistants/edit-an-assistant)
- [Create an agent](/hub/agents/create-an-agent)
- [Edit an agent](/hub/agents/edit-an-agent)
Some blocks require inputs. If you are missing an input for a block, a notification icon will show up in the sidebar next to the block. Click the notification to select which secret to use for the block input:

View file

@ -6,7 +6,7 @@ description: "To Create an Organization, click the organization selector in the
![create an org selector](/images/hub/governance/images/org-selector-4ea627afc7c0765633780920a0fbe16e.png)
1. Choose a name, which will be used as the display name for your organization throughout the hub
2. Add a slug, which will be used for your org URL and as the prefix to all organization blocks and assistant slugs
2. Add a slug, which will be used for your org URL and as the prefix to all organization blocks and agent slugs
3. Select an icon for your organization using the image uploader
4. Finally, add a Biography, which will be displayed on your org Home Page

View file

@ -1,16 +1,16 @@
---
title: "Secret Types"
description: "The Continue Hub comes with secrets management built-in. Secrets are values such as API keys or endpoints that can be shared across assistants and within organizations."
description: "The Continue Hub comes with secrets management built-in. Secrets are values such as API keys or endpoints that can be shared across agents and within organizations."
---
## User secrets
User secrets are defined by the user for themselves. This means that user secrets are available only to the user that created them. User secrets are assumed to be safe for the user to know, so they will be sent to the IDE extensions alongside the assistant `config.yaml`.
User secrets are defined by the user for themselves. This means that user secrets are available only to the user that created them. User secrets are assumed to be safe for the user to know, so they will be sent to the IDE extensions alongside the agent `config.yaml`.
This allows API requests to be made directly from the IDE extensions. You can use user secrets with [Solo](/hub/governance/pricing#solo), [Teams](/hub/governance/pricing#teams), and [Enterprise](/hub/governance/pricing#enterprise). User secrets can be managed [here](https://hub.continue.dev/settings/secrets) in the hub.
## Org secrets
Org secrets are defined by admins for their organization. Org secrets are available to anyone in the organization to use with assistants in that organization. Org secrets are assumed to not be shareable with the user (e.g. you are a team lead who wants to give team members access to models without passing out API keys).
Org secrets are defined by admins for their organization. Org secrets are available to anyone in the organization to use with agents in that organization. Org secrets are assumed to not be shareable with the user (e.g. you are a team lead who wants to give team members access to models without passing out API keys).
This is why LLM requests are proxied through api.continue.dev / on-premise proxy and secrets are never sent to the IDE extensions. You can only use org secrets on [Teams](/hub/governance/pricing#teams) and [Enterprise](/hub/governance/pricing#enterprise). If you are an admin, you can manage secrets for your organization from the org settings page.

View file

@ -15,17 +15,17 @@ Share your custom assistants, blocks, and configurations with the Continue commu
[Visit the Hub →](https://hub.continue.dev)
## Browse Assistants
## Browse Agents
Explore assistants created by the community for specific use cases and workflows.
[Browse Assistants →](https://hub.continue.dev)
[Browse Agents →](https://hub.continue.dev)
## Using Assistants
## Using Agents
Learn how to discover, install, and use community-created assistants in your projects.
[Learn About Assistants →](/hub/assistants/intro)
[Learn About Agents →](/hub/assistants/intro)
---

View file

@ -1,6 +1,6 @@
---
title: "Source Control"
description: "When managing your custom assistants within an organization, you might want to take advantage of your usual source control workflows. Continue makes this easy with a that automatically syncs your YAML files with hub.continue.dev. We are also planning on adding automations for GitLab, BitBucket, Gitee, and others. If you are interested, please reach out to us on ."
description: "When managing your custom agents within an organization, you might want to take advantage of your usual source control workflows. Continue makes this easy with a that automatically syncs your YAML files with hub.continue.dev. We are also planning on adding automations for GitLab, BitBucket, Gitee, and others. If you are interested, please reach out to us on ."
---
## Quickstart
@ -34,11 +34,11 @@ This is the only configuration necessary, but you can view the full list of opti
### 4. Commit and push
Add the [YAML for your assistants and blocks](/reference) to the appropriate directories. The name of the file will be the slug of the assistant/block.
Add the [YAML for your agents and blocks](/reference) to the appropriate directories. The name of the file will be the slug of the agent/block.
- `assistants/public` for public assistants
- `assistants/private` for private (visible only within your organization) assistants
- `assistants/public` for public agents
- `assistants/private` for private (visible only within your organization) agents
- `blocks/public` for public blocks
- `blocks/private` for private blocks
Then, commit and push your changes. Once the GitHub Action has completed running, you should be able to view the assistants within your organization on hub.continue.dev. For subsequent changes, make sure to increment the `version` property of your updated YAML file(s).
Then, commit and push your changes. Once the GitHub Action has completed running, you should be able to view the agents within your organization on hub.continue.dev. For subsequent changes, make sure to increment the `version` property of your updated YAML file(s).

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
docs/images/instinct.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

View file

@ -1,43 +1,43 @@
---
title: "config.yaml Reference"
description: "Comprehensive guide to the config.yaml format used by Continue.dev for building custom coding assistants. Learn how to define models, context providers, rules, prompts, and more using reusable blocks and YAML configuration."
description: "Comprehensive guide to the config.yaml format used by Continue.dev for building custom coding agents. Learn how to define models, context providers, rules, prompts, and more using reusable blocks and YAML configuration."
---
## Introduction
Continue hub assistants are defined using the `config.yaml` specification. Assistants can be loaded from [the Hub](https://hub.continue.dev/explore/assistants) or locally
Continue hub agents are defined using the `config.yaml` specification. Agents can be loaded from [the Hub](https://hub.continue.dev/explore/agents) or locally
- [Continue Hub](https://hub.continue.dev/explore/assistants) - YAML is stored on the hub and automatically synced to the extension
- [Continue Hub](https://hub.continue.dev/explore/agents) - YAML is stored on the hub and automatically synced to the extension
- Locally
- in your global `.continue` folder (`~/.continue` on Mac, `%USERPROFILE%\.continue`) within `.continue/assistants`. The name of the file will be used as the display name of the assistant, e.g. `My Assistant.yaml`
- in your workspace in a `/.continue/assistants` folder, with the same naming convention
- in your global `.continue` folder (`~/.continue` on Mac, `%USERPROFILE%\.continue`) within `.continue/agents`. The name of the file will be used as the display name of the agent, e.g. `My Agent.yaml`
- in your workspace in a `/.continue/agents` folder, with the same naming convention
<Info>
Config YAML replaces `config.json`, which is deprecated. View the **[Migration
Guide](/reference/yaml-migration)**.
</Info>
An assistant is made up of:
An agent is made up of:
1. **Top level properties**, which specify the `name`, `version`, and `config.yaml` `schema` for the assistant
2. **Block lists**, which are composable arrays of coding assistant building blocks available to the assistant, such as models, docs, and context providers.
1. **Top level properties**, which specify the `name`, `version`, and `config.yaml` `schema` for the agent
2. **Block lists**, which are composable arrays of coding agent building blocks available to the agent, such as models, docs, and context providers.
A block is a single standalone building block of a coding assistants, e.g., one model or one documentation source. In `config.yaml` syntax, a block consists of the same top-level properties as assistants (`name`, `version`, and `schema`), but only has **ONE** item under whichever block type it is.
A block is a single standalone building block of a coding agents, e.g., one model or one documentation source. In `config.yaml` syntax, a block consists of the same top-level properties as agents (`name`, `version`, and `schema`), but only has **ONE** item under whichever block type it is.
Examples of blocks and assistants can be found on the [Continue hub](https://hub.continue.dev/explore/assistants).
Examples of blocks and agents can be found on the [Continue Hub](https://hub.continue.dev).
Assistants can either explicitly define blocks - see [Properties](#properties) below - or import and configure existing hub blocks.
Agents can either explicitly define blocks - see [Properties](#properties) below - or import and configure existing hub blocks.
### Using Blocks
Hub blocks and assistants are identified with a slug in the format `owner-slug/block-or-assistant-slug`, where an owner can be a user or organization (For example, if you want to use the [OpenAI 4o Model block](https://hub.continue.dev/openai/gpt-4o), your slug would be `openai/gpt-4o`). These blocks are pulled from [https://hub.continue.dev](https://hub.continue.dev).
Hub blocks and agents are identified with a slug in the format `owner-slug/block-or-agent-slug`, where an owner can be a user or organization (For example, if you want to use the [OpenAI 4o Model block](https://hub.continue.dev/openai/gpt-4o), your slug would be `openai/gpt-4o`). These blocks are pulled from [https://hub.continue.dev](https://hub.continue.dev).
Blocks can be imported into an assistant by adding a `uses` clause under the block type. This can be alongside other `uses` clauses or explicit blocks of that type.
Blocks can be imported into an agent by adding a `uses` clause under the block type. This can be alongside other `uses` clauses or explicit blocks of that type.
For example, the following assistant imports an Anthropic model and defines an Ollama DeepSeek one.
For example, the following agent imports an Anthropic model and defines an Ollama DeepSeek one.
Assistant models section
Agent models section
```yaml
name: Team Agent
@ -52,13 +52,13 @@ models:
### Local Blocks
It is also possible to define blocks locally in a `.continue` folder. This folder can be located at either the root of your workspace (these will automatically be applied to all assistants when you are in that workspace) or in your home directory at `~/.continue` (these will automatically be applied globally).
It is also possible to define blocks locally in a `.continue` folder. This folder can be located at either the root of your workspace (these will automatically be applied to all agents when you are in that workspace) or in your home directory at `~/.continue` (these will automatically be applied globally).
Place your YAML files in the following folders:
Assistants:
Agents:
- `.continue/assistants` - for assistants
- `.continue/agents` - for agents
Blocks:
@ -100,7 +100,7 @@ models:
Which can then be imported like this:
```yaml title="config.yaml"
name: myprofile/custom-assistant
name: myprofile/custom-agent
version: 1.0.0
schema: v1
@ -118,7 +118,7 @@ Note that hub secrets can be passed as inputs, using a similar mustache format:
Block properties can be also be directly overriden using `override`. For example:
```yaml title="config.yaml"
name: myprofile/custom-assistant
name: myprofile/custom-agent
version: 1.0.0
schema: v1

View file

@ -45,7 +45,7 @@ What context providers are available in Continue?
### Customization
```
How do I add custom rules to my assistant in Continue?
How do I add custom rules to my agent in Continue?
```
## Troubleshooting

View file

@ -408,4 +408,4 @@ The following configuration example includes:
</Tab>
</Tabs>
This setup could also involve enabling Chromium as a backup for local documentation through the [User Settings Page](../customize/settings).
This setup could also involve enabling Chromium as a backup for local documentation through the User Settings Page (Gear Icon).

View file

@ -50,8 +50,8 @@ export const ModelRecommendations = ({ role = "all" }) => {
"[Kimi K2 (1T)](https://hub.continue.dev/openrouter/kimi-k2)",
"[gpt-oss (120B)](https://hub.continue.dev/openrouter/gpt-oss-120b)",
"[gpt-oss (20B)](https://hub.continue.dev/ollama/gpt-oss-20b)",
"GLM 4.5 (355B)",
"GLM 4.5 Air (106B)",
"[GLM 4.5 (355B)](https://hub.continue.dev/openrouter/glm-4-5)",
"[GLM 4.5 Air (106B)](https://hub.continue.dev/openrouter/glm-4-5-air)",
],
closed: [
"[Claude Opus 4.1](https://hub.continue.dev/anthropic/claude-4-1-opus)",
@ -83,7 +83,7 @@ export const ModelRecommendations = ({ role = "all" }) => {
],
closed: [
"[Codestral](https://hub.continue.dev/mistral/codestral)",
"[Mercury Coder](https://hub.continue.dev/inceptionlabs/mercury-coder)",
"[Mercury Coder](https://hub.continue.dev/inception/mercury-coder)",
],
notes: "Closed models are slightly better than open models",
},
@ -117,11 +117,11 @@ export const ModelRecommendations = ({ role = "all" }) => {
notes: "Open models are beginning to emerge for this model role",
},
next_edit: {
open: ["N/A"],
open: ["[Instinct](https://hub.continue.dev/continuedev/instinct)"],
closed: [
"[Mercury Coder](https://hub.continue.dev/inceptionlabs/mercury-coder)",
"[Mercury Coder](https://hub.continue.dev/inception/mercury-coder)",
],
notes: "Closed models are significantly better than open models",
notes: "Closed models are better than open models",
},
};

View file

@ -1,215 +0,0 @@
name: Respond to @continuedev Comments
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
permissions:
contents: write
pull-requests: write
issues: write
jobs:
respond-to-comment:
# Only run on pull request comments
if: github.event_name == 'issue_comment' && github.event.issue.pull_request
runs-on: ubuntu-latest
steps:
- name: Check if comment contains @continuedev
id: check-mention
run: |
if echo "${{ github.event.comment.body }}" | grep -q "@continuedev"; then
echo "contains_mention=true" >> $GITHUB_OUTPUT
else
echo "contains_mention=false" >> $GITHUB_OUTPUT
fi
- name: Checkout PR branch
if: steps.check-mention.outputs.contains_mention == 'true'
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Get PR information
if: steps.check-mention.outputs.contains_mention == 'true'
id: pr-info
uses: actions/github-script@v7
with:
script: |
const { data: pr } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
});
core.setOutput('head_ref', pr.head.ref);
core.setOutput('head_sha', pr.head.sha);
return pr;
- name: Checkout PR branch
if: steps.check-mention.outputs.contains_mention == 'true'
run: |
git checkout ${{ steps.pr-info.outputs.head_ref }}
- name: Setup Node.js
if: steps.check-mention.outputs.contains_mention == 'true'
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install Continue CLI globally
if: steps.check-mention.outputs.contains_mention == 'true'
run: npm i -g @continuedev/cli
- name: Start remote session
if: steps.check-mention.outputs.contains_mention == 'true'
id: remote-session
env:
CONTINUE_API_KEY: ${{ secrets.CONTINUE_API_KEY }}
run: |
# Create the prompt for remote session
PROMPT="Please help with the following request from @${{ github.event.comment.user.login }} on PR #${{ github.event.issue.number }}:
${{ github.event.comment.body }}
Please analyze the current PR, understand the request, implement the necessary changes, and commit them to this branch."
# Start remote session and capture JSON output
SESSION_OUTPUT=$(echo "$PROMPT" | cn remote -s --branch ${{ steps.pr-info.outputs.head_ref }})
echo "Raw session output: $SESSION_OUTPUT"
# Extract URL from JSON output
SESSION_URL=$(echo "$SESSION_OUTPUT" | jq -r '.url // empty')
if [ -z "$SESSION_URL" ] || [ "$SESSION_URL" = "null" ]; then
echo "Failed to extract session URL from output: $SESSION_OUTPUT"
exit 1
fi
echo "session_url=$SESSION_URL" >> $GITHUB_OUTPUT
echo "✅ Started remote session: $SESSION_URL"
- name: Comment with session URL
if: steps.check-mention.outputs.contains_mention == 'true' && steps.remote-session.outputs.session_url
uses: actions/github-script@v7
with:
script: |
const commentBody = `I've started [a remote session](${{ steps.remote-session.outputs.session_url }}) to help with your request:
> ${{ github.event.comment.body }}`;
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: commentBody
});
- name: Log session details
if: steps.check-mention.outputs.contains_mention == 'true'
run: |
echo "✅ Successfully started remote session for comment from ${{ github.event.comment.user.login }} on PR #${{ github.event.issue.number }}"
echo "Session URL: ${{ steps.remote-session.outputs.session_url }}"
echo "Original comment: ${{ github.event.comment.body }}"
respond-to-review-comment:
# Only run on pull request review comments
if: github.event_name == 'pull_request_review_comment'
runs-on: ubuntu-latest
steps:
- name: Check if comment contains @continuedev
id: check-mention
run: |
if echo "${{ github.event.comment.body }}" | grep -q "@continuedev"; then
echo "contains_mention=true" >> $GITHUB_OUTPUT
else
echo "contains_mention=false" >> $GITHUB_OUTPUT
fi
- name: Checkout PR branch
if: steps.check-mention.outputs.contains_mention == 'true'
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- name: Setup Node.js
if: steps.check-mention.outputs.contains_mention == 'true'
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install Continue CLI globally
if: steps.check-mention.outputs.contains_mention == 'true'
run: npm i -g @continuedev/cli
- name: Start remote session
if: steps.check-mention.outputs.contains_mention == 'true'
id: remote-session
env:
CONTINUE_API_KEY: ${{ secrets.CONTINUE_API_KEY }}
run: |
# Create a temporary file for the prompt to handle special characters and newlines properly
cat > /tmp/prompt.txt << 'PROMPT_EOF'
Please help with the following code review comment from @${{ github.event.comment.user.login }} on PR #${{ github.event.pull_request.number }}:
**File:** ${{ github.event.comment.path }}
**Line:** ${{ github.event.comment.line || github.event.comment.original_line || 'N/A' }}
**Comment:** ${{ github.event.comment.body }}
Please analyze the specific file and line mentioned, understand the review feedback, implement the necessary changes, and commit them to this branch.
PROMPT_EOF
# Debug output
echo "PROMPT content:"
cat /tmp/prompt.txt
# Start remote session and capture JSON output
echo "Starting cn with prompt..."
SESSION_OUTPUT=$(cat /tmp/prompt.txt | cn remote -s --branch ${{ github.event.pull_request.head.ref }})
echo "Raw session output: $SESSION_OUTPUT"
# Extract URL from JSON output
SESSION_URL=$(echo "$SESSION_OUTPUT" | jq -r '.url // empty')
if [ -z "$SESSION_URL" ] || [ "$SESSION_URL" = "null" ]; then
echo "Failed to extract session URL from output: $SESSION_OUTPUT"
exit 1
fi
echo "session_url=$SESSION_URL" >> $GITHUB_OUTPUT
echo "✅ Started remote session: $SESSION_URL"
- name: Comment with session URL
if: steps.check-mention.outputs.contains_mention == 'true' && steps.remote-session.outputs.session_url
uses: actions/github-script@v7
with:
script: |
const commentBody = `I've started [a remote session](${{ steps.remote-session.outputs.session_url }}) to help with your request:
> ${{ github.event.comment.body }}`;
const commentParams = {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: ${{ github.event.pull_request.number }},
body: commentBody,
commit_id: '${{ github.event.pull_request.head.sha }}',
path: '${{ github.event.comment.path }}',
in_reply_to: ${{ github.event.comment.id }}
};
await github.rest.pulls.createReviewComment(commentParams);
- name: Log session details
if: steps.check-mention.outputs.contains_mention == 'true'
run: |
echo "✅ Successfully started remote session for review comment from ${{ github.event.comment.user.login }} on PR #${{ github.event.pull_request.number }}"
echo "Session URL: ${{ steps.remote-session.outputs.session_url }}"
echo "File: ${{ github.event.comment.path }}"
echo "Line: ${{ github.event.comment.line }}"
echo "Original comment: ${{ github.event.comment.body }}"

View file

@ -68,6 +68,10 @@ try {
__dirname,
"../../packages/llm-info/dist/index.js",
),
"@continuedev/terminal-security": resolve(
__dirname,
"../../packages/terminal-security/dist/index.js",
),
},
// Add banner to create require for CommonJS packages

Some files were not shown because too many files have changed in this diff Show more