Commit Graph
554 Commits
Author SHA1 Message Date
Cursor AgentandJulius Marminge 7c19979050 feat(claude): update ClaudeCodeAdapter to emit V2 canonical runtime events
- Replace old event types with V2 content.delta, item.started/completed, request.opened/resolved
- Use RuntimeSessionId, ThreadId, TurnId, RuntimeItemId, RuntimeRequestId branded IDs
- Add payload objects for all event types
- Use CanonicalItemType and CanonicalRequestType for item/request classification
- Include providerRefs on all emitted events

Co-authored-by: Julius Marminge <[email protected]>
2026-03-01 11:44:08 +00:00
Cursor AgentandJulius Marminge 214d6cd867 feat(codex): rewrite CodexAdapter event mapping for V2 canonical runtime events
- Replace old event types (message.delta, tool.started, etc.) with V2 types
- Emit content.delta, item.started/completed, request.opened/resolved
- Add reasoning, plan, command output, and file change delta mappings
- Add turn.plan.updated support
- Use RuntimeSessionId, ThreadId, TurnId, RuntimeItemId branded IDs
- Include providerRefs and raw envelope on all events

Co-authored-by: Julius Marminge <[email protected]>
2026-03-01 11:44:01 +00:00
Cursor AgentandJulius Marminge 4058add69b feat(contracts): add cursor ACP raw sources and CursorProviderStartOptions to V2 schemas
Co-authored-by: Julius Marminge <[email protected]>
2026-03-01 11:43:53 +00:00
Cursor AgentandJulius Marminge 418ad29423 fix: migrate orchestration integration test events to V2 format
- message.delta → content.delta with payload.streamKind/delta
- tool.started → item.started with payload.itemType/status/title/detail
- tool.completed → item.completed with payload.itemType/status/title/detail
- approval.requested → request.opened with payload.requestType/detail
  and RuntimeRequestId instead of ApprovalRequestId for event requestId
- turn.started now includes payload: {}
- turn.completed uses payload.state instead of top-level status
- runtime.error uses payload.message instead of top-level message
- Activity kind assertions (approval.requested, tool.started, etc.) left unchanged

Co-authored-by: Julius Marminge <[email protected]>
2026-03-01 11:42:22 +00:00
Cursor AgentandJulius Marminge 46f9391bf3 fix: migrate CheckpointReactor to V2 ProviderRuntimeEvent types
- Import RuntimeSessionId; use string casts for ProviderSessionId vs
  RuntimeSessionId comparisons and 'as unknown as ProviderSessionId'
  for assignments
- Replace event.status with event.payload.state for turn.completed
- Remove checkpoint.captured handler (event removed from V2 union);
  turn.completed already triggers captureCheckpointFromTurnCompletion
- Remove checkpoint.captured from stream event filter
- Update test file: use RuntimeSessionId, ThreadId, TurnId for runtime
  events; replace status with payload.state; add payload field to
  turn.started events; convert checkpoint.captured tests to
  turn.completed equivalents

Co-authored-by: Julius Marminge <[email protected]>
2026-03-01 11:26:16 +00:00
Cursor AgentandJulius Marminge a719a1e68c fix: resolve TypeScript errors in provider adapter test files
- CodexAdapter.test.ts: update 'message.completed' to 'item.completed' (V2),
  fix payload access for session.exited (payload.reason instead of message)
- ClaudeCodeAdapter.test.ts: update old event types to V2 equivalents
  (content.delta, item.started, item.completed, request.opened, request.resolved),
  fix branded ID mismatches using TurnId.makeUnsafe(), fix property access
  patterns (payload.delta, payload.state, payload.itemType, payload.decision)
- ProviderAdapterRegistry.test.ts: add CursorAdapter stub to layer context
- ProviderService.test.ts: remove resumeThreadId from expected assertions
  (not in ProviderSessionStartInput schema), replace sessionSequence assertion
  with event type ordering check
- ProviderService.ts: remove resumeThreadId spread from recoverSessionForThread
  to match schema contract

Co-authored-by: Julius Marminge <[email protected]>
2026-03-01 10:57:19 +00:00
Cursor AgentandJulius Marminge 9304b22b51 Fix test files for V2 ProviderRuntimeEvent migration
- ProviderService.test.ts: Update event construction to use V2 types
  (content.delta, item.started, item.completed, turn.completed with
  payload), V2 branded IDs (RuntimeSessionId, ThreadId, TurnId,
  RuntimeItemId)
- CursorAdapter.test.ts: Replace removed CursorCliStreamEvent tests
  with ACP schema decode tests (AcpInitializeResult,
  AcpSessionNewResult, AcpPermissionRequestParams)
- wsServer.test.ts: Update runtime event emission to V2 content.delta
  shape with payload and V2 branded IDs

Co-authored-by: Julius Marminge <[email protected]>
2026-03-01 10:40:49 +00:00
Julius Marminge 7ef6b20f81 Scope reasoning effort defaults and options by provider
- Replace global reasoning constants with provider-scoped effort options/defaults
- Update ChatView to use Codex-specific reasoning effort types and default lookup
- Expand model contract tests for provider-specific reasoning effort behavior
2026-03-01 01:59:22 -08:00
Julius Marminge 719c7dc28e Introduce v2 provider runtime event schema and validation tests
- Restructure runtime events around a shared base plus typed payloads
- Add runtime-branded IDs and new event types (plan, item, request, user-input)
- Remove legacy canonical event names from docs and add schema decode/rejection tests
2026-03-01 01:29:59 -08:00
Julius Marminge acd57a1ac8 Document Cursor ACP mapping in canonical runtime event spec
- Add Cursor ACP raw source types to `RuntimeEventRaw.source`
- Define canonical mappings for ACP lifecycle, updates, permissions, and errors
- Expand cross-provider equivalence table to include Cursor ACP and renumber sections
2026-02-28 20:21:37 -08:00
Julius Marminge 5d42e4bf90 Revise Cursor provider plan for ACP JSON-RPC integration
- Switch plan from `agent -p` stream-json to `agent acp` JSON-RPC transport
- Document ACP session, permission, event-mapping, and interrupt/recovery behavior
- Update implementation phases, tests, and delivery checklist for ACP-first design
2026-02-28 20:21:37 -08:00
Julius Marminge ebd44f9bd9 Add Cursor ACP probe script and captured session logs
- add `scripts/cursor-acp-probe.mjs` to run ACP protocol probing scenarios
- update `package.json` scripts for probe execution
- include generated probe summaries/transcripts under `.tmp/acp-probe/`
2026-02-28 20:21:37 -08:00
Julius Marminge 87c797b16b Add Cursor provider support across backend, contracts, and UI
- Accept `cursor` as a first-class provider in orchestration, persistence, and session directory flows
- Update model/provider inference and normalization to handle Cursor model aliases
- Revamp chat provider/model picker with Cursor-specific trait controls and add coverage in tests
2026-02-28 20:21:37 -08:00
Julius Marmingeandcodex f265f56cb5 Add Cursor CLI stream event schemas and decoding tests
- define `CursorAdapter` service contract and Cursor stream-json schema types
- add `CursorCliStreamEvent` decoding tests for system/thinking/tool/result/retry events
- add implementation plan for Cursor provider integration

Co-authored-by: codex <[email protected]>
2026-02-28 20:21:37 -08:00
Julius Marminge 2c631e8725 Track runtime event sequence and order thread activities by sequence
- add per-session `sessionSequence` on provider runtime events and persist activity `sequence`
- migrate `projection_thread_activities` with nullable `sequence` column + index
- sort server/web activity projections by sequence fallback to timestamp/id
- allow provider sessions/turns to start before a real threadId is emitted
2026-02-28 12:27:45 -08:00
Julius Marminge d75ca11981 Align Claude permissions and provider-specific reasoning effort
- Default Claude sessions to bypass permissions when approval policy is `never`, while preserving explicit `permissionMode`
- Hide/send reasoning effort only for providers that support it in ChatView
- Add coverage for Claude permission-mode derivation and precedence, and update runtime event model docs
2026-02-28 11:28:54 -08:00
Julius Marminge 02c89a5af6 Stabilize Claude turn event ordering and native event logging
- Preserve active turn state when `session.started`/`thread.started` arrive mid-turn
- Emit `message.delta` from assistant text when stream deltas are missing, then complete the message
- Add Claude native SDK NDJSON observability logging and wire its log path in server layers
- Expand ingestion/adapter tests to cover mid-turn lifecycle and delta fallback behavior
2026-02-27 23:53:47 -08:00
Julius Marmingeandcodex 870096b8a3 Fix ProviderService sendTurn recovery expectation after rebase
Co-authored-by: codex <[email protected]>
2026-02-27 21:38:23 -08:00
Julius Marminge 8d23276aff Ignore stale resume cursors and Claude placeholder thread IDs
- Do not pass `resumeCursor` when restarting a session after changing providers
- Treat synthetic Claude thread IDs (`claude-thread-*`) as unscoped during runtime ingestion
- Add tests covering provider-switch restart behavior and Claude turn lifecycle acceptance
2026-02-27 21:35:57 -08:00
Julius Marmingeandcodex 21130006b9 Align orchestration integration tests with latestTurn metadata
Co-authored-by: codex <[email protected]>
2026-02-27 21:35:57 -08:00
Julius Marminge 3e6ac44156 Fix Claude resume cursor to only persist valid session UUIDs
- Stop synthesizing `resume` from generated thread IDs
- Persist resume session ID from query messages when available
- Validate resume/sessionId values as UUIDs before reuse
- Add tests for valid UUID resume passthrough and no synthesized resume
2026-02-27 21:35:57 -08:00
Julius Marminge 6ff39f9097 Refactor ClaudeCodeAdapter session flow and stream handling
- Replace manual prompt async iterator with `Stream.fromQueue(...).toAsyncIterable`
- Use `Ref` for shared session context in tool approval callbacks
- Simplify timestamp/ID generation and close sessions via queue shutdown
2026-02-27 21:35:57 -08:00
Julius Marminge e5f12e6507 Integrate Claude agent SDK into server provider adapter
- add `@anthropic-ai/claude-agent-sdk` dependency for `apps/server`
- replace placeholder Claude adapter with live session/query/event handling
- add comprehensive adapter tests for runtime events, approvals, resume, rollback, and model overrides
2026-02-27 21:35:57 -08:00
Julius Marmingeandcodex f00d414983 Include all provider models in /model slash command
Co-authored-by: codex <[email protected]>
2026-02-27 21:35:57 -08:00
Julius Marmingeandcodex 67eef99b43 Fix Claude model fallback in web store sync
Co-authored-by: codex <[email protected]>
2026-02-27 21:35:57 -08:00
Julius Marmingeandcodex b6f93eaf5b Update Claude model catalog to latest 4.6/4.5 gen
Co-authored-by: codex <[email protected]>
2026-02-27 21:35:28 -08:00
Julius Marmingeandcodex 600cfaf6b2 Show provider logos in composer model trigger
Co-authored-by: codex <[email protected]>
2026-02-27 21:35:28 -08:00
Julius Marmingeandcodex 8be8fcb415 Use grouped provider/model select in chat composer
Co-authored-by: codex <[email protected]>
2026-02-27 21:35:28 -08:00
Julius Marmingeandcodex e45cd8fec1 Inline Claude adapter behavior into live layer
Co-authored-by: codex <[email protected]>
2026-02-27 21:35:28 -08:00
Julius Marminge fb1e7c18b2 unnecessary catch 2026-02-27 21:35:28 -08:00
Julius Marmingeandcodex b03287ebea Use typed errors for unavailable Claude runtime path
Co-authored-by: codex <[email protected]>
2026-02-27 21:35:28 -08:00
Julius Marmingeandcodex 344d9b46f0 Make Claude runtime boundary Effect-native
Co-authored-by: codex <[email protected]>
2026-02-27 21:35:28 -08:00
Julius Marmingeandcodex 83b72000d2 Add Claude integration coverage across orchestration flows
Co-authored-by: codex <[email protected]>
2026-02-27 21:35:28 -08:00
Julius Marmingeandcodex fb62d21c05 Add Claude checkpoint and revert reactor coverage
Co-authored-by: codex <[email protected]>
2026-02-27 21:35:28 -08:00
Julius Marmingeandcodex b8069d2c4d Enable Claude provider selection in chat composer
Add provider-aware model options and include provider in turn-start dispatch.

Co-authored-by: codex <[email protected]>
2026-02-27 21:35:28 -08:00
Julius Marmingeandcodex 1fb357419e Support provider-aware session selection in reactor
Add restart semantics when requested provider changes and cover with tests.

Co-authored-by: codex <[email protected]>
2026-02-27 21:35:28 -08:00
Julius Marmingeandcodex b8e3b4623d Wire Claude adapter into registry and server provider layer
Add provider-service routing coverage for explicit claudeCode sessions.

Co-authored-by: codex <[email protected]>
2026-02-27 21:35:28 -08:00
Julius Marminge f2e087cba4 Add Claude Code adapter live layer with error mapping tests
- introduce `ClaudeCodeAdapter` service and live layer wiring
- map runtime/session/request failures into provider adapter error types
- add coverage for validation, session-not-found mapping, lifecycle forwarding, and event passthrough
2026-02-27 21:35:28 -08:00
Julius Marminge 310c763ed2 revised plan 2026-02-27 21:35:28 -08:00
Julius Marminge 2ed16e5e2f redo contracts a bit 2026-02-27 21:35:28 -08:00
Julius Marminge 37eb492d95 Add provider-specific model resolution and defaults
- Add per-provider model options, defaults, and slug aliases
- Add provider-aware model normalization/resolution helpers
- Preserve Codex-only constants/functions for backward compatibility
- Extend tests to cover Claude aliases and provider-specific fallback behavior
2026-02-27 21:33:43 -08:00
Julius Marminge d48b42c017 fix type 2026-02-27 21:32:15 -08:00
Julius Marminge fb45896588 simplify layers 2026-02-27 21:30:46 -08:00
Julius Marminge b52518f85f Flatten attachment paths with message-prefixed filenames
- Write projected attachments under the thread directory using `messageSegment-fileName`
- Avoid nested per-message folders while preserving unique, deterministic file paths
- Update projection pipeline tests to match new attachment URLs and on-disk paths
2026-02-27 21:30:46 -08:00
Julius Marminge 3e99019af8 Serve attachments using URL-encoded relative paths
- Read attachment route paths without URI decoding before normalization
- Align test fixture paths with encoded thread/message/file names
2026-02-27 21:30:46 -08:00
Julius Marminge 7d4b02689e Overwrite attachment bytes for repeated message attachment index
- Make projection attachment writes use last-write-wins per file path
- Always write attachment files so updated message attachments replace stale bytes
- Add regression test covering same message/attachment index update behavior
2026-02-27 21:30:46 -08:00
Julius Marminge 9962f57ad0 Preserve empty attachment updates in projection pipeline
- Treat `attachments: []` as an explicit update instead of dropping the field
- Add regression test covering attachment clearing for an existing thread message
2026-02-27 21:30:46 -08:00
Julius Marminge 8b538e2802 dedupe 2026-02-27 21:30:46 -08:00
Julius Marminge a6c57e169a nit 2026-02-27 21:30:46 -08:00
Julius Marminge 6f92f0a668 kewl 2026-02-27 21:30:46 -08:00