Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .github/workflows/run-continue-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ on:
workflow_call:
inputs:
prompt:
description: "The prompt to send to the Continue agent"
required: true
type: string
config:
description: "The config to use (e.g., continuedev/default-background-agent)"
description: "Additional prompting to send to the Continue agent"
required: false
type: string
default: "continuedev/default-background-agent"
default: ""
agent:
description: "The agent to use (e.g., continuedev/github-pr-agent)"
required: true
type: string
default: "continuedev/github-pr-agent"
branch_name:
description: "The base branch name to work from"
required: false
Expand All @@ -33,7 +34,7 @@ jobs:
-H "Authorization: Bearer ${{ secrets.CONTINUE_API_KEY }}" \
-d '{
"prompt": "${{ inputs.prompt }}",
"config": "${{ inputs.config }}",
"agent": "${{ inputs.agent }}",
"branchName": "${{ inputs.branch_name }}",
"repoUrl": "https://github.com/${{ github.repository }}"
}')
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/tidy-up-codebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ jobs:
run-cn-task:
uses: ./.github/workflows/run-continue-agent.yml
with:
prompt: "Review every Markdown documentation file and verify that descriptions, examples, or behavior outlines accurately reflect the current code. Only update documentation; do not modify code. Check the corresponding code to confirm behavior before making changes. Correct any inaccuracies or outdated information in descriptions, examples, or behavior outlines. Preserve existing Markdown formatting, style, and structure. Do not add new sections, speculative explanations, or details not present in the code. Only update statements that are clearly incorrect or misleading; do not rewrite text for style or preference. Keep edits minimal and focused, ensuring that the Markdown matches what the code actually does. If verification against the code is ambiguous, leave the documentation unchanged. Use branch name bot/cleanup-<YYMMDD>-<HHMM>"
config: continuedev/default-background-agent
agent: continuedev/tidy-up-markdown-agent
branch_name: main
secrets:
CONTINUE_API_KEY: ${{ secrets.CONTINUE_API_KEY }}
2 changes: 1 addition & 1 deletion docs/guides/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ echo "$(git diff) Generate a conventional commit name for the current git change

`cn` uses [`config.yaml`](/reference), the exact same configuration file as Continue. This means that you can log in to [Continue Mission Control](/hub/introduction) or use your existing local configuration.

To switch between configurations, you can use the `/config` slash command in `cn`, or you can start it with the `--config` flag (e.g. `cn --config continuedev/default-agent` or `cn --config ~/.continue/config.yaml`).
To switch between configurations, you can use the `/config` slash command in `cn`, or you can start it with the `--config` flag (e.g. `cn --config continuedev/default-cli-config` or `cn --config ~/.continue/config.yaml`).

### How to Add Custom Models

Expand Down
6 changes: 3 additions & 3 deletions extensions/cli/spec/config-loading.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ This document specifies the behavior of the CLI's configuration loading system,
3. **Default Resolution** (if no flag and no saved URI)
- **Authenticated**: First user assistant from `listAssistants()`
- **config.yaml**: The saved config file at `~/.continue/config.yaml`
- **Unauthenticated**: Falls back to `continuedev/default-agent`
- **Unauthenticated**: Falls back to `continuedev/default-cli-config`

## Authentication State Interactions

Expand All @@ -61,7 +61,7 @@ This document specifies the behavior of the CLI's configuration loading system,
**Available Options:**

- Local YAML files only
- Default assistant (`continuedev/default-agent`)
- Default assistant (`continuedev/default-cli-config`)

**Behavior:**

Expand Down Expand Up @@ -121,7 +121,7 @@ This document specifies the behavior of the CLI's configuration loading system,
**No User Assistants:**

- Authenticated user has no personal assistants
- **Result**: Falls back to `continuedev/default-agent`
- **Result**: Falls back to `continuedev/default-cli-config`

**Default Agent Unavailable:**

Expand Down
34 changes: 17 additions & 17 deletions extensions/cli/src/configLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export type ConfigSource =
| { type: "cli-flag"; path: string }
| { type: "saved-uri"; uri: string }
| { type: "user-assistant"; slug: string }
| { type: "default-config-yaml" }
| { type: "default-agent" }
| { type: "local-config-yaml" }
| { type: "remote-default-config" }
| { type: "no-config" };

/**
Expand Down Expand Up @@ -124,16 +124,16 @@ function determineConfigSource(

// Priority 3: Default resolution based on auth state
if (authConfig === null) {
// Unauthenticated: check for default config.yaml, then fallback to default agent
// Unauthenticated: check for default config.yaml, then fallback to default config
const defaultConfigPath = path.join(env.continueHome, "config.yaml");
if (fs.existsSync(defaultConfigPath)) {
return { type: "default-config-yaml" };
return { type: "local-config-yaml" };
}
return { type: "default-agent" };
return { type: "remote-default-config" };
} else {
// In headless, user assistant fallback behavior isn't supported
if (isHeadless) {
return { type: "default-agent" };
return { type: "remote-default-config" };
}
// Authenticated: try user assistants first
return { type: "user-assistant", slug: "" }; // Empty slug means "first available"
Expand Down Expand Up @@ -178,16 +178,16 @@ async function loadFromSource(
injectBlocks,
);

case "default-config-yaml":
return await loadDefaultConfigYaml(
case "local-config-yaml":
return await loadLocalConfigYaml(
accessToken,
organizationId,
apiClient,
injectBlocks,
);

case "default-agent":
return await loadDefaultAgent(
case "remote-default-config":
return await loadDefaultConfig(
organizationId,
apiClient,
accessToken,
Expand All @@ -214,7 +214,7 @@ async function loadFromSource(
"Failed to load user assistants, falling back to default agent",
),
);
return await loadDefaultAgent(
return await loadDefaultConfig(
organizationId,
apiClient,
accessToken,
Expand Down Expand Up @@ -334,7 +334,7 @@ async function loadUserAssistantWithFallback(
}

// No user assistants, fall back to default agent
return await loadDefaultAgent(
return await loadDefaultConfig(
organizationId,
apiClient,
accessToken,
Expand All @@ -345,7 +345,7 @@ async function loadUserAssistantWithFallback(
/**
* Loads default config.yaml from ~/.continue/config.yaml
*/
async function loadDefaultConfigYaml(
async function loadLocalConfigYaml(
accessToken: string | null,
organizationId: string | null,
apiClient: DefaultApiInterface,
Expand All @@ -362,17 +362,17 @@ async function loadDefaultConfigYaml(
}

/**
* Loads the default continuedev/default-agent
* Loads the default continuedev/default-config
*/
async function loadDefaultAgent(
async function loadDefaultConfig(
organizationId: string | null,
apiClient: DefaultApiInterface,
accessToken: string | null,
injectBlocks: PackageIdentifier[],
): Promise<AssistantUnrolled> {
const resp = await apiClient.getAssistant({
ownerSlug: "continuedev",
packageSlug: "default-agent",
packageSlug: "default-cli-config",
organizationId: organizationId ?? undefined,
});

Expand Down Expand Up @@ -582,7 +582,7 @@ function getUriFromSource(source: ConfigSource): string | null {
: `slug://${source.path}`;
case "saved-uri":
return source.uri;
case "default-config-yaml":
case "local-config-yaml":
return `file://${path.join(env.continueHome, "config.yaml")}`;
default:
return null;
Expand Down
8 changes: 4 additions & 4 deletions extensions/cli/src/e2e/local-config-switching.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe("Local Config Switching Investigation", () => {
"/absolute/path/to/config.yaml",
],
remoteAssistantSlugs: [
"continuedev/default-agent",
"continuedev/default-cli-config",
"myorg/custom-assistant",
"user/my-assistant",
],
Expand Down Expand Up @@ -43,22 +43,22 @@ describe("Local Config Switching Investigation", () => {
const problemScenarios = [
{
name: "Remote to Remote switching",
from: "continuedev/default-agent",
from: "continuedev/default-cli-config",
to: "myorg/custom-assistant",
works: true,
reason: "Both are assistant slugs, normal flow works",
},
{
name: "Remote to Local switching",
from: "continuedev/default-agent",
from: "continuedev/default-cli-config",
to: "~/.continue/config.yaml",
works: false, // This is the reported issue
reason: "UNKNOWN - this is what we need to debug",
},
{
name: "Local to Remote switching",
from: "~/.continue/config.yaml",
to: "continuedev/default-agent",
to: "continuedev/default-cli-config",
works: false, // Likely also broken
reason: "UNKNOWN - probably same root cause",
},
Expand Down
4 changes: 2 additions & 2 deletions extensions/cli/src/services/ConfigService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ describe("ConfigService", () => {
test("should initialize with undefined config path", async () => {
vi.mocked(configLoader.loadConfiguration).mockResolvedValue({
config: mockConfig as any,
source: { type: "default-agent" } as any,
source: { type: "remote-default-config" } as any,
});

const state = await service.doInitialize({
Expand Down Expand Up @@ -257,7 +257,7 @@ describe("ConfigService", () => {
// Initialize without config path
vi.mocked(configLoader.loadConfiguration).mockResolvedValue({
config: mockConfig as any,
source: { type: "default-agent" } as any,
source: { type: "remote-default-config" } as any,
});
await service.doInitialize({
authConfig: { accessToken: "token" } as any,
Expand Down
4 changes: 2 additions & 2 deletions extensions/cli/src/services/MCPService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe("MCPService", () => {
beforeEach(() => {
mcpService = new MCPService();
mockAssistant = {
name: "test-assistant",
name: "Test Config",
version: "1.0.0",
mcpServers: [
{
Expand Down Expand Up @@ -196,7 +196,7 @@ describe("MCPService", () => {

it("should default to stdio transport when type is not specified", async () => {
const defaultAssistant: AssistantConfig = {
name: "default-assistant",
name: "Default Config",
version: "1.0.0",
mcpServers: [
{
Expand Down
6 changes: 3 additions & 3 deletions extensions/cli/vitest.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ global.fetch = vi
.mockImplementation(async (url: string | URL, ...args) => {
const urlString = url.toString();

// Mock the default-agent API call
if (urlString.includes("get-assistant/continuedev/default-agent")) {
// Mock the default config API call
if (urlString.includes("get-assistant/continuedev/default-cli-config")) {
return {
ok: true,
status: 200,
json: async () => ({
configResult: {
config: {
name: "Default Agent",
name: "Default Config",
version: "0.0.1",
schema: "v1",
models: [
Expand Down
Loading