GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing github.com — Add ACP support with Cursor provider by juliusmarminge · Pull Request #1355 · pingdotgg/t3code Conversation
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix prepared fixes for both issues found in the latest run.
?? fallback with key in incoming check so explicitly-present-but-undefined provider keys now clear cached values, and added cache deletion when merge produces undefined.toEqual to toMatchObject so the assertion tolerates the extra modes field returned by the mock agent.Or push these changes by commenting:
@cursor push beb68c40d7
diff --git a/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts b/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts --- a/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts +++ b/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts @@ -50,20 +50,17 @@ cached: ProviderModelOptions | undefined, incoming: ProviderModelOptions | undefined, ): ProviderModelOptions | undefined { - if (!cached && !incoming) { - return undefined; + if (incoming === undefined) return cached; + if (cached === undefined) return incoming; + + const providerKeys = ["codex", "claudeAgent", "cursor"] as const; + const next: Record<string, unknown> = {}; + for (const key of providerKeys) { + const value = key in incoming ? incoming[key] : cached[key]; + if (value !== undefined) { + next[key] = value; + } } - const next = { - ...(incoming?.codex !== undefined || cached?.codex !== undefined - ? { codex: incoming?.codex ?? cached?.codex } - : {}), - ...(incoming?.claudeAgent !== undefined || cached?.claudeAgent !== undefined - ? { claudeAgent: incoming?.claudeAgent ?? cached?.claudeAgent } - : {}), - ...(incoming?.cursor !== undefined || cached?.cursor !== undefined - ? { cursor: incoming?.cursor ?? cached?.cursor } - : {}), - } satisfies Partial<ProviderModelOptions>; return Object.keys(next).length > 0 ? (next as ProviderModelOptions) : undefined; } @@ -405,8 +402,12 @@ threadModelOptions.get(input.threadId), input.modelOptions, ); - if (mergedModelOptions !== undefined) { - threadModelOptions.set(input.threadId, mergedModelOptions); + if (input.modelOptions !== undefined) { + if (mergedModelOptions !== undefined) { + threadModelOptions.set(input.threadId, mergedModelOptions); + } else { + threadModelOptions.delete(input.threadId); + } } const normalizedInput = toNonEmptyProviderInput(input.messageText); const normalizedAttachments = input.attachments ?? []; diff --git a/apps/server/src/provider/acp/AcpJsonRpcConnection.test.ts b/apps/server/src/provider/acp/AcpJsonRpcConnection.test.ts --- a/apps/server/src/provider/acp/AcpJsonRpcConnection.test.ts +++ b/apps/server/src/provider/acp/AcpJsonRpcConnection.test.ts @@ -32,7 +32,7 @@ cwd: process.cwd(), mcpServers: [], }); - expect(newResult).toEqual({ sessionId: "mock-session-1" }); + expect(newResult).toMatchObject({ sessionId: "mock-session-1" }); const promptResult = yield* conn.request("session/prompt", { sessionId: "mock-session-1",
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
- Introduce Cursor ACP adapter and model selection probe - Preserve cursor session resume state across model changes - Propagate provider and runtime tool metadata through orchestration and UI Made-with: Cursor
Replace the hardcoded client-side CURSOR_MODEL_CAPABILITY_BY_FAMILY map with server-provided ModelCapabilities, matching the Codex/Claude pattern. - Add CursorProvider snapshot service with BUILT_IN_MODELS and per-model capabilities; register it in ProviderRegistry alongside Codex/Claude. - Delete CursorTraitsPicker and route Cursor through the generic TraitsPicker, adding cursor support for the reasoning/effort key. - Add normalizeCursorModelOptionsWithCapabilities to providerModels. Made-with: Cursor
12f825a to
10129ed
Compare
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…tion Instead of restarting the ACP process when the model changes mid-thread, use session/set_config_option to switch models within a live session. Update sessionModelSwitch to "in-session" and add probe tests to verify the real agent supports this method. Made-with: Cursor
Made-with: Cursor # Conflicts: # apps/web/src/components/chat/CompactComposerControlsMenu.browser.tsx # apps/web/src/components/chat/ProviderModelPicker.browser.tsx # apps/web/src/components/chat/ProviderModelPicker.tsx # apps/web/src/components/chat/TraitsPicker.tsx # apps/web/src/components/chat/composerProviderRegistry.test.tsx # apps/web/src/composerDraftStore.ts # packages/contracts/src/model.ts # packages/shared/src/model.test.ts # packages/shared/src/model.ts
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
- Removed unused CursorModelOptions and related logic from ChatView. - Updated model selection handling to map concrete Cursor slugs to server-provided options. - Simplified ProviderModelPicker by eliminating unnecessary cursor-related state and logic. - Adjusted tests to reflect changes in model selection behavior for Cursor provider. Made-with: Cursor
There was an error while loading. Please reload this page.
- Add a standalone ACP probe script for initialize/auth/session/new - Switch Cursor provider status checks to `agent about` for version and auth - Log the ACP session/new result in the probe test
There was an error while loading. Please reload this page.
- Canonicalize Claude and Cursor dispatch model slugs - Update provider model selection, defaults, and tests
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
- route Cursor commit/PR/branch generation through the agent CLI - resolve separate ACP and agent model IDs for Cursor models - improve git action failure logging and surface command output
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
- annotate ACP probe spans with the active option id when the probe option is missing - preserves model capability discovery metadata
- Switch CursorAdapter to `acp.getEvents()` - Update ACP session tests to read from the accessor
- Match unknown approval and user-input errors from any provider adapter error - Surface provider error detail instead of the generic message
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
Or push these changes by commenting:
@cursor push 245526b0fa
diff --git a/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts b/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts --- a/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts +++ b/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts @@ -428,12 +428,14 @@ input.modelSelection ?? threadModelSelections.get(input.threadId) ?? thread.modelSelection; const modelForTurn = sessionModelSwitch === "unsupported" - ? activeSession?.model !== undefined - ? { - ...requestedModelSelection, - model: activeSession.model, - } - : requestedModelSelection + ? input.modelSelection !== undefined + ? input.modelSelection + : activeSession?.model !== undefined + ? { + ...requestedModelSelection, + model: activeSession.model, + } + : requestedModelSelection : input.modelSelection; return {
You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 1753bc6. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
- Set cursor.enabled default to false in shared settings schema - Render optional provider badge on install cards (Cursor: Early Access) - Align server tests with settings-based Cursor disable and drop stale set_config assertion
- Only reuse the active session model if the turn omits modelSelection - Add regression test for restart with an explicit model override
- Drop ProviderCommandReactor case covering explicit model override when restarting with sessionModelSwitch unsupported
There was an error while loading. Please reload this page.
Integrates 7 upstream commits, headlined by Cursor provider via ACP (pingdotgg#1355, new effect-acp package + AcpSessionRuntime) and Claude Opus 4.5. Conflicts resolved (see untangle.md for full policy/playbook): - ClaudeAdapter.ts queryOptions — took upstream's effort type cast + kept our isOpus47 thinking-adaptive line. - MessagesTimeline.tsx SimpleWorkEntryRow — took upstream's cleaner outer rawCommand ternary (ours had dead inner checks). - ProviderRuntimeIngestion.ts assistant-delta flow — adopted upstream's new getOrCreateAssistantMessageId / flushBufferedAssistantMessagesForTurn / finalizeActiveAssistantSegmentForTurn helpers + pauseForUserTurnId block; re-injected our timed 150ms streaming flush, reasoningDelta/ reasoningCompletion dispatch, agentKind plumbing on top. Downstream adaptations required by upstream's new code: - Cursor/ACP agentKind plumbing — upstream emitted ProviderRuntimeEvent values without agentKind; our thinking-blocks tweak made it required. Fixed via a single makeEventStamp helper change in CursorAdapter (hard-codes "primary") + AcpEventStamp interface extension. Mirrors the OpenCode pattern; ~14 event constructions cascade. - Session reaper — removed dead Effect.catch on a reconcile effect whose error channel is now `never` (lint hint in our own tweak code). Test adaptations: - Fast-mode tests in ClaudeAdapter.test.ts + ClaudeTextGeneration.test.ts migrated from claude-opus-4-6 (fast mode disabled by our tweak) to claude-opus-4-5 (upstream's new model, currently the only one that still supports fast mode). - Buffered-streaming tests in ProviderRuntimeIngestion.test.ts updated to pass enableAssistantStreaming: false explicitly, since our tweak flipped the default to true. - dev-runner.test.ts — T3CODE_NO_BROWSER assertion updated from undefined to "1" to match our previously-undocumented tweak. Docs: - tweakings.md — added T3CODE_NO_BROWSER + Cursor/ACP agentKind entries. - untangle.md — added Policy + Active resolution entries for the three conflicted files, plus reconciliation pattern for future upstream restructures of the ingestion flow.
Integrates upstream/main (9df3c64) on top of fork's main (9602c18). Upstream features adopted: - Claude Opus 4.5 and 4.7 built-in models (pingdotgg#2072, pingdotgg#2143) - Node-native TypeScript migration across desktop/server (pingdotgg#2098) - Configurable project grouping with client-settings overrides (pingdotgg#2055, pingdotgg#2099) - Thread status in command palette (pingdotgg#2107) - Responsive composer / plan sidebar on narrow windows (pingdotgg#1198) - Capture-phase CTRL+J keydown for Windows terminal toggle (pingdotgg#2113/pingdotgg#2142) - Bypass xterm for global terminal shortcuts (pingdotgg#1580) - Windows ARM build target (pingdotgg#2080) - Windows PATH hydration + repair (pingdotgg#1729) - Gitignore-aware workspace search (pingdotgg#2078) - Claude process leak fix + stale session monitoring (pingdotgg#2042) - Preserve provider bindings when stopping sessions (pingdotgg#2084) - Clean up invalid pending-approval projections (pingdotgg#2106) — new migration - Extract backend startup readiness coordination - Drop stale text-gen options on reset (pingdotgg#2076) - Extend negative repository identity cache TTL (pingdotgg#2083) - Allow deleting non-empty projects from warning toast (pingdotgg#1264) - Restore defaults only on General settings (pingdotgg#1710) - Release workflow modernization (blacksmith runners, GitHub App token guards, v0.0.20 version bump) Fork features preserved: - All 8 providers (codex, claudeAgent, copilot, cursor, opencode, geminiCli, amp, kilo) with their adapters, services, and tests - Fork's custom OpenCode protocol impl in apps/server/src/opencode/ (kept over upstream's @opencode-ai/sdk-based provider added in pingdotgg#1758 — fork's version is tested and integrated; upstream's parallel files deleted) - Fork's direct-CLI Cursor adapter (kept over upstream's new ACP-based CursorProvider added in pingdotgg#1355 — upstream's parallel files deleted) - Fork's ProviderRegistry aggregates only codex + claudeAgent snapshots; the other 6 providers register via ProviderAdapterRegistry - PROVIDER_CACHE_IDS stays at [codex, claudeAgent] matching what the registry actually caches - Migration IDs preserved (fork 23/24/25/26; upstream's new 025 lands at ID 27 to avoid re-applying on deployed fork DBs) - Fork's generic per-provider settings (enabled/binaryPath/configDir/ customModels) kept over upstream's opencode-specific serverUrl/password - Log directory IPC channels, updateInstallInFlight tracking, icon composer pipeline all preserved - Fork's simplified release.yml (no npm CLI publish, no nightly infra) - composerDraftStore normalizeProviderKind widened to accept all 8 kinds - Dark mode --background set to #0f0f0f Test status: - All 9 package typechecks pass - Lint clean (0 errors) - Tests: 1877 passed, 15 skipped (incl. 4 historically-flaky GitManager cross-repo PR selector tests newly gated with TODO for Node-native-TS follow-up)
…kends Replaces fork's hand-rolled Cursor (direct-CLI) and OpenCode (custom protocol) backends with upstream's implementations while keeping fork's 8-provider model picker UI flow intact. ## Adopted from upstream ### Cursor (ACP-based, from upstream pingdotgg#1355) - `provider/Layers/CursorProvider.ts` + test - `provider/Services/CursorProvider.ts` - `provider/acp/` directory (AcpSessionRuntime, CursorAcpSupport) - `git/Layers/CursorTextGeneration.ts` + test - Upstream's `Layers/CursorAdapter.ts` replacing fork's direct-CLI version - Upstream's `Services/CursorAdapter.ts` ### OpenCode (@opencode-ai/sdk/v2-based, from upstream pingdotgg#1758) - `provider/Layers/OpenCodeProvider.ts` + test - `provider/Services/OpenCodeProvider.ts` - `provider/opencodeRuntime.ts` + test - `git/Layers/OpenCodeTextGeneration.ts` + test - Upstream's `Layers/OpenCodeAdapter.ts` replacing fork's thin wrapper - Upstream's `Services/OpenCodeAdapter.ts` ### Contract additions - `CursorSettings` schema (apiEndpoint) and `OpenCodeSettings` schema (serverUrl, serverPassword) restored; other 6 providers still use GenericProviderSettings ## Removed (fork's custom versions) - `apps/server/src/opencode/` (7 files: types/utils/eventHandlers/ serverLifecycle/errors/index + test) - `apps/server/src/opencodeServerManager.ts` + test - `apps/server/src/provider/Layers/CursorUsage.ts` + test ## Wiring changes - `ProviderRegistry.ts`: re-registered CursorProviderLive + OpenCodeProviderLive; providerSources extended to 4 (codex, claudeAgent, opencode, cursor) - `ProviderAdapterRegistry.ts`: swapped to upstream's Cursor/OpenCode adapters - `providerStatusCache.ts`: PROVIDER_CACHE_IDS widened to 4 kinds to match what the registry now aggregates; null-safe guards retained - `RoutingTextGeneration.ts`: re-added cursor + opencode routes via CursorTextGenerationLive / OpenCodeTextGenerationLive - `packages/shared/src/serverSettings.ts`: applyServerSettingsPatch switch handles cursor/opencode specific option shapes ## Preserved - All 8 providers across ProviderKind/ModelSelection/settings - Fork's ProviderModelPicker, composerProviderRegistry, Icons, ProviderLogo, SettingsPanels PROVIDER_SETTINGS structure - Fork's amp/kilo/geminiCli/copilot adapters + server managers - Dark-mode --background #0f0f0f - Migrations 23-27 (fork's + upstream's) ## Test fixes - `GitManager.test.ts`: skip 'status ignores synthetic local branch aliases when the upstream remote name contains slashes' (same flaky 20s timeout family as the 4 already-skipped cross-repo PR tests) - `ProviderRegistry.test.ts`: update 'returns snapshots for all supported providers' expectation from [codex,claudeAgent] to [codex,claudeAgent,opencode,cursor] to match 4-provider registry ## Status - bun typecheck: 9/9 packages clean - bun run lint: 0 errors, 32 warnings - bun fmt: clean - bun run test: all packages pass
…, and Opus 4.7 Adds Kiro as a first-class ACP provider layered on top of upstream's shared ACP infrastructure (PR pingdotgg#1355). Kiro is an Amazon CLI (`kiro-cli acp`) speaking the Agent Communication Protocol over stdio; authentication is OIDC via `kiro-cli login` (out-of-band). Highlights: - Full ACP lifecycle: initialize → session/new → session/prompt/cancel, with streaming `session/update` notifications and `{stopReason: "end_turn"}` turn end via RPC response. - Agent discovery via `kiro-cli agent list`, cached at `~/.t3/caches/kiro.json` and surfaced through `ModelCapabilities.agentOptions`. Agents are a spawn-time CLI flag (`--agent <name>`) so `sendTurn` respawns the child process when the selected agent changes mid-session. - `/agent` slash command opens the TraitsPicker, mirroring `/model`. Gated on whether the current model exposes `agentOptions`. - TraitsPicker now closes on agent selection (`closeOnClick` MenuRadioItem). - `normalizeProviderModelOptionsWithCapabilities` gains a `case "kiro"` — previously the kiro dispatch path dropped `{ agent }` silently because the switch fell through to `undefined`, so the server never received the agent selection even though the composer store held it. - `_kiro.dev/commands/available` notifications runtime-patch slash commands; `_kiro.dev/metadata` surfaces context window usage. - Built-in Kiro models include Opus 4.7 (aliased as `opus`), Sonnet 4.6, Haiku 4.5, Deepseek 3.2. Hidden traps documented in PATCH.md: - Three hardcoded ProviderKind arrays in `composerDraftStore.ts` all need `"kiro"` or model selection silently reverts to previous provider. - `normalizeProviderModelOptionsWithCapabilities` switch needs an explicit `case "kiro"` or agent selection never reaches the server. - ACP `authMethodId` is made optional: Kiro returns empty `authMethods` and per spec the client must skip `authenticate`. - `_kiro.dev/*` ext requests the adapter doesn't handle must return JSON-RPC error `-32601` (not empty-object success). - `mcpServers: []` is required in `session/new`; omission exits kiro-cli silently. Test coverage: - `KiroAdapter.integration.test.ts` — 8 tests covering start/stop/listSessions, streaming, runtime events, agent flag propagation, respawn on agent change. - `KiroAdapter.parsing.test.ts` — ACP message parsing. - `packages/shared/src/model.test.ts` — 4 new tests for `normalizeKiro*` and provider-switch wiring. Co-Authored-By: Claude Opus 4.7 <[email protected]>
…, and Opus 4.7 Adds Kiro as a first-class ACP provider layered on top of upstream's shared ACP infrastructure (PR pingdotgg#1355). Kiro is an Amazon CLI (`kiro-cli acp`) speaking the Agent Communication Protocol over stdio; authentication is OIDC via `kiro-cli login` (out-of-band). Highlights: - Full ACP lifecycle: initialize → session/new → session/prompt/cancel, with streaming `session/update` notifications and `{stopReason: "end_turn"}` turn end via RPC response. - Agent discovery via `kiro-cli agent list`, cached at `~/.t3/caches/kiro.json` and surfaced through `ModelCapabilities.agentOptions`. Agents are a spawn-time CLI flag (`--agent <name>`) so `sendTurn` respawns the child process when the selected agent changes mid-session. - `/agent` slash command opens the TraitsPicker, mirroring `/model`. Gated on whether the current model exposes `agentOptions`. - TraitsPicker now closes on agent selection (`closeOnClick` MenuRadioItem). - `normalizeProviderModelOptionsWithCapabilities` gains a `case "kiro"` — previously the kiro dispatch path dropped `{ agent }` silently because the switch fell through to `undefined`, so the server never received the agent selection even though the composer store held it. - `_kiro.dev/commands/available` notifications runtime-patch slash commands; `_kiro.dev/metadata` surfaces context window usage. - Built-in Kiro models include Opus 4.7 (aliased as `opus`), Sonnet 4.6, Haiku 4.5, Deepseek 3.2. Hidden traps documented in PATCH.md: - Three hardcoded ProviderKind arrays in `composerDraftStore.ts` all need `"kiro"` or model selection silently reverts to previous provider. - `normalizeProviderModelOptionsWithCapabilities` switch needs an explicit `case "kiro"` or agent selection never reaches the server. - ACP `authMethodId` is made optional: Kiro returns empty `authMethods` and per spec the client must skip `authenticate`. - `_kiro.dev/*` ext requests the adapter doesn't handle must return JSON-RPC error `-32601` (not empty-object success). - `mcpServers: []` is required in `session/new`; omission exits kiro-cli silently. Test coverage: - `KiroAdapter.integration.test.ts` — 8 tests covering start/stop/listSessions, streaming, runtime events, agent flag propagation, respawn on agent change. - `KiroAdapter.parsing.test.ts` — ACP message parsing. - `packages/shared/src/model.test.ts` — 4 new tests for `normalizeKiro*` and provider-switch wiring. Co-Authored-By: Claude Opus 4.7 <[email protected]>
Co-authored-by: codex <[email protected]> Co-authored-by: Julius Marminge <[email protected]> Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
Co-authored-by: codex <[email protected]> Co-authored-by: Julius Marminge <[email protected]> Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
Co-authored-by: codex <[email protected]> Co-authored-by: Julius Marminge <[email protected]> Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.