Skip to content

Commit 6b19485

Browse files
committed
feat: default to v1 boundary with autofallback and harden tool-call handling
1 parent 9e34026 commit 6b19485

15 files changed

Lines changed: 1620 additions & 102 deletions

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ CI runs split suites in `.github/workflows/ci.yml`:
290290
- `unit` job: `bun run test:ci:unit`
291291
- `integration` job: `bun run test:ci:integration`
292292

293-
Integration CI defaults to OpenCode-owned loop mode:
293+
Integration CI pins OpenCode-owned loop mode to deterministic settings:
294294

295295
- `CURSOR_ACP_TOOL_LOOP_MODE=opencode`
296296
- `CURSOR_ACP_PROVIDER_BOUNDARY=v1`
@@ -327,9 +327,11 @@ Set the log level via environment variable:
327327
- `CURSOR_ACP_LOG_LEVEL=error` - Errors only
328328

329329
Provider-boundary rollout:
330+
- Default: `CURSOR_ACP_PROVIDER_BOUNDARY=v1`
331+
- Default: `CURSOR_ACP_PROVIDER_BOUNDARY_AUTOFALLBACK=true`
330332
- `CURSOR_ACP_PROVIDER_BOUNDARY=legacy` - Original provider/runtime boundary behavior
331-
- `CURSOR_ACP_PROVIDER_BOUNDARY=v1` - New shared boundary/interception path (recommended)
332-
- `CURSOR_ACP_PROVIDER_BOUNDARY_AUTOFALLBACK=true` - Emergency fallback from `v1` to `legacy` for the current request only
333+
- `CURSOR_ACP_PROVIDER_BOUNDARY=v1` - Shared boundary/interception path
334+
- `CURSOR_ACP_PROVIDER_BOUNDARY_AUTOFALLBACK=false` - Disable fallback and keep strict `v1` behavior
333335
- `CURSOR_ACP_TOOL_LOOP_MAX_REPEAT=3` - Max repeated failing tool-call fingerprints before guard termination (or fallback when enabled)
334336

335337
Auto-fallback trigger conditions:

src/plugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ const PROVIDER_BOUNDARY =
9393
? LEGACY_PROVIDER_BOUNDARY
9494
: createProviderBoundary(PROVIDER_BOUNDARY_MODE, CURSOR_PROVIDER_ID);
9595
const ENABLE_PROVIDER_BOUNDARY_AUTOFALLBACK =
96-
process.env.CURSOR_ACP_PROVIDER_BOUNDARY_AUTOFALLBACK === "true";
96+
process.env.CURSOR_ACP_PROVIDER_BOUNDARY_AUTOFALLBACK !== "false";
9797
const TOOL_LOOP_MAX_REPEAT_RAW = process.env.CURSOR_ACP_TOOL_LOOP_MAX_REPEAT;
9898
const {
9999
value: TOOL_LOOP_MAX_REPEAT,
@@ -1360,7 +1360,7 @@ export const CursorPlugin: Plugin = async ({ $, directory, client, serverUrl }:
13601360
log.warn("Invalid CURSOR_ACP_TOOL_LOOP_MODE; defaulting to opencode", { value: TOOL_LOOP_MODE_RAW });
13611361
}
13621362
if (!PROVIDER_BOUNDARY_MODE_VALID) {
1363-
log.warn("Invalid CURSOR_ACP_PROVIDER_BOUNDARY; defaulting to legacy", {
1363+
log.warn("Invalid CURSOR_ACP_PROVIDER_BOUNDARY; defaulting to v1", {
13641364
value: PROVIDER_BOUNDARY_MODE_RAW,
13651365
});
13661366
}

src/provider/boundary.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ export interface ProviderBoundary {
5454
export function parseProviderBoundaryMode(
5555
value: string | undefined,
5656
): { mode: ProviderBoundaryMode; valid: boolean } {
57-
const normalized = (value ?? "legacy").trim().toLowerCase();
57+
const normalized = (value ?? "v1").trim().toLowerCase();
5858
if (normalized === "legacy" || normalized === "v1") {
5959
return { mode: normalized, valid: true };
6060
}
61-
return { mode: "legacy", valid: false };
61+
return { mode: "v1", valid: false };
6262
}
6363

6464
export function createProviderBoundary(

0 commit comments

Comments
 (0)