Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Feature branch (Gemini, Claude Code, Cursor) - #1

Open
Noojuno wants to merge 89 commits into
mainfrom
codething/648ca884-claude
Open

Noojuno wants to merge 89 commits into
mainfrom
codething/648ca884-claude

Conversation

@Noojuno

@Noojuno Noojuno commented Mar 8, 2026

Copy link
Copy Markdown
Owner

juliusmarminge and others added 30 commits March 5, 2026 18:12
- 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
- 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
Add provider-service routing coverage for explicit claudeCode sessions.

Co-authored-by: codex <[email protected]>
Add restart semantics when requested provider changes and cover with tests.

Co-authored-by: codex <[email protected]>
Add provider-aware model options and include provider in turn-start dispatch.

Co-authored-by: codex <[email protected]>
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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]>
- 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
- 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/`
juliusmarminge and others added 25 commits March 5, 2026 21:16
Resolve all conflicts by keeping branch changes (Claude/cursor provider support).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
- add Gemini CLI runtime/session support alongside Codex, including provider-aware model handling and persisted Gemini thread/session plumbing
- harden provider and git auth flows to avoid interactive GitHub/browser prompts during startup and background status checks
- improve Gemini event ingestion and chat UX with persistent live run state, richer activity labels, compact in-thread activity rendering, image attachment support, and tighter completed-file summaries
- add and update regression tests for provider health, Gemini runtime mapping, store/model handling, and orchestration session status behavior
# Conflicts:
#	apps/server/src/orchestration/Layers/CheckpointReactor.test.ts
#	apps/server/src/provider/Layers/CodexAdapter.test.ts
#	apps/server/src/provider/Layers/ProviderAdapterRegistry.test.ts
#	apps/server/src/provider/Layers/ProviderAdapterRegistry.ts
#	apps/server/src/provider/Layers/ProviderService.test.ts
#	apps/server/src/serverLayers.ts
#	apps/web/src/routes/_chat.settings.tsx
#	apps/web/src/session-logic.test.ts
#	apps/web/src/session-logic.ts
#	apps/web/src/store.ts
#	bun.lock
# Conflicts:
#	apps/server/src/orchestration/Layers/ProviderCommandReactor.ts
#	apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.test.ts
#	apps/server/src/provider/Layers/ProviderAdapterRegistry.test.ts
#	apps/server/src/provider/Layers/ProviderAdapterRegistry.ts
#	apps/server/src/provider/Layers/ProviderSessionDirectory.test.ts
#	apps/server/src/provider/Layers/ProviderSessionDirectory.ts
#	apps/server/src/serverLayers.ts
#	apps/web/src/appSettings.test.ts
#	apps/web/src/appSettings.ts
#	apps/web/src/components/ChatView.tsx
#	apps/web/src/composerDraftStore.ts
#	apps/web/src/routes/_chat.settings.tsx
#	apps/web/src/session-logic.test.ts
#	apps/web/src/session-logic.ts
#	apps/web/src/store.ts
#	packages/contracts/src/model.ts
#	packages/contracts/src/orchestration.ts
#	packages/shared/src/model.test.ts
#	packages/shared/src/model.ts
- Replace readPathFromLoginShell with readEnvFromLoginShell to capture
  full login-shell environment on macOS (not just PATH)
- Simplify ChatView by removing threadRunStateStore and consolidating
  session state management into session-logic
- Add Claude Code adapter stdin write support
- Improve sidebar session display

Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Drop the redundant static bullet before the working status text in `MessagesTimeline`
- Keep the animated dots indicator as the sole working-state visual cue
@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Mar 9, 2026

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 5 potential issues.

Open in Devin Review

Comment on lines +357 to +359
if (answers.length > 0) {
return { answers };
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ”΄ Empty multi-select user-input answers now throw instead of being forwarded to the provider

An empty array of answers is rejected with a thrown error (toCodexUserInputAnswer at apps/server/src/codexAppServerManager.ts:357-359) instead of being forwarded as a valid empty selection, so users who explicitly deselect all options in a multi-select prompt crash the turn.

Impact: Any Codex tool that presents a multi-select and the user selects nothing will throw an unhandled error instead of sending the empty answer.

Mechanism: the new length guard causes fall-through to the throw

Previously the code returned { answers: [] } for an empty filtered array. The new if (answers.length > 0) guard at line 357 skips the return, falls through to the object branch (which also has the same guard at line 366), and ultimately reaches the throw at line 372. The same pattern applies in the CodexAdapter layer at apps/server/src/provider/Layers/CodexAdapter.ts:277-278 which silently drops the question entirely (returns [] from flatMap), meaning the answer key disappears from the response payload rather than being sent as an explicit empty selection.

Suggested change
if (answers.length > 0) {
return { answers };
}
return { answers };
Open in Devin Review

Was this helpful? React with πŸ‘ or πŸ‘Ž to provide feedback.

Comment on lines 845 to 848
expect(harness.provider.rollbackConversation).toHaveBeenCalledWith({
threadId: ThreadId.makeUnsafe("thread-1"),

numTurns: 1,
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟑 Test assertions for provider rollback calls will fail due to missing threadId in expected object

The expected rollback argument has threadId removed from the assertion (toHaveBeenCalledWith at apps/server/src/orchestration/Layers/CheckpointReactor.test.ts:845-848) but the production code still passes { threadId, numTurns }, so the test will fail on exact equality.

Impact: The test suite will not pass, violating the repository's task-completion requirement that tests must pass.

Mechanism: production code still includes threadId in the call

At apps/server/src/orchestration/Layers/CheckpointReactor.ts:504-505, the call is providerService.rollbackConversation({ threadId: sessionRuntime.value.threadId, numTurns: rolledBackTurns }). The test at line 845 now asserts toHaveBeenCalledWith({ numTurns: 1 }) which is strict deep equality and will not match the actual call that includes threadId. The same issue repeats at lines 1008-1010 and 1012-1014. Notably, the new Claude test at line 918-919 correctly includes threadId in its assertion, confirming this was an accidental removal.

Suggested change
expect(harness.provider.rollbackConversation).toHaveBeenCalledWith({
threadId: ThreadId.makeUnsafe("thread-1"),
numTurns: 1,
});
expect(harness.provider.rollbackConversation).toHaveBeenCalledWith({
threadId: ThreadId.makeUnsafe("thread-1"),
numTurns: 1,
});
Open in Devin Review

Was this helpful? React with πŸ‘ or πŸ‘Ž to provide feedback.

Comment on lines +10 to +14
const env = readEnvFromLoginShell(shell);
if (env) {
for (const [key, value] of Object.entries(env)) {
process.env[key] = value;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ” Full login-shell environment override replaces PATH-only fix

The fixPath() function in both apps/desktop/src/fixPath.ts and apps/server/src/os-jank.ts now calls readEnvFromLoginShell and overwrites ALL process.env keys with the shell's exported variables. Previously only PATH was restored. This is a much broader change that could override variables like NODE_ENV, HOME, or any variable the app sets before this function runs. On macOS GUI apps this is likely the correct behavior (restoring the full login environment), but it's worth verifying that no app-set variables are accidentally clobbered by stale shell profile values.

Open in Devin Review

Was this helpful? React with πŸ‘ or πŸ‘Ž to provide feedback.

@@ -109,7 +108,6 @@ function readPersistedCwd(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ” All provider telemetry/analytics calls removed from ProviderService

Every analytics.record(...) call was removed from ProviderService.ts (session started, turn sent, interrupted, request responded, stopped, rollback, stopAll). The AnalyticsService dependency was also removed from the layer. This eliminates all provider-level telemetry. The recordStartupHeartbeat function still exists but is no longer called at startup (the Effect.forkChild(recordStartupHeartbeat) call was removed from makeServerProgram). If telemetry is still desired, it would need to be re-added through a different mechanism.

Open in Devin Review

Was this helpful? React with πŸ‘ or πŸ‘Ž to provide feedback.

Comment on lines +117 to +122
codex: "gpt-5.3-codex",
claudeCode: "claude-sonnet-4-6",
cursor: "opus-4.6-thinking",
gemini: "gemini-2.5-pro",
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ” Default Codex model changed from gpt-5.4 to gpt-5.3-codex

In packages/contracts/src/model.ts, DEFAULT_MODEL_BY_PROVIDER.codex was changed from "gpt-5.4" to "gpt-5.3-codex". This affects all new sessions that don't specify an explicit model. The DEFAULT_MODEL export (used as backward-compat alias) also resolves to gpt-5.3-codex. This is a user-facing default change that will affect all new threads.

Open in Devin Review

Was this helpful? React with πŸ‘ or πŸ‘Ž to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants