mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-21 15:33:45 +00:00
🗂️ feat: Choose Conversation Checkout Mode (#16679)
Some checks are pending
Backend Unit Tests / Build packages (push) Waiting to run
Backend Unit Tests / Codegraph select (push) Waiting to run
Backend Unit Tests / TypeScript type checks (push) Blocked by required conditions
Backend Unit Tests / Circular dependency checks (push) Waiting to run
Backend Unit Tests / Tests: api (shard 1/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 2/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 3/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: data-provider (push) Blocked by required conditions
Backend Unit Tests / Tests: data-schemas (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 1/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 2/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 3/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 4/4) (push) Blocked by required conditions
Codegraph E2E Votes / vote (full suite) (push) Waiting to run
Docker Dev Branch Images Build / publish (push) Waiting to run
Frontend Unit Tests / Client build recovery regression (push) Waiting to run
Frontend Unit Tests / Codegraph select (push) Waiting to run
Frontend Unit Tests / Build packages (push) Waiting to run
Frontend Unit Tests / TypeScript type checks (client) (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/client (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 1/2) (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 2/2) (push) Blocked by required conditions
Frontend Unit Tests / Vite build verification (push) Blocked by required conditions
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Blocked by required conditions
Some checks are pending
Backend Unit Tests / Build packages (push) Waiting to run
Backend Unit Tests / Codegraph select (push) Waiting to run
Backend Unit Tests / TypeScript type checks (push) Blocked by required conditions
Backend Unit Tests / Circular dependency checks (push) Waiting to run
Backend Unit Tests / Tests: api (shard 1/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 2/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 3/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: data-provider (push) Blocked by required conditions
Backend Unit Tests / Tests: data-schemas (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 1/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 2/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 3/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 4/4) (push) Blocked by required conditions
Codegraph E2E Votes / vote (full suite) (push) Waiting to run
Docker Dev Branch Images Build / publish (push) Waiting to run
Frontend Unit Tests / Client build recovery regression (push) Waiting to run
Frontend Unit Tests / Codegraph select (push) Waiting to run
Frontend Unit Tests / Build packages (push) Waiting to run
Frontend Unit Tests / TypeScript type checks (client) (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/client (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 1/2) (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 2/2) (push) Blocked by required conditions
Frontend Unit Tests / Vite build verification (push) Blocked by required conditions
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Blocked by required conditions
* feat: Choose the conversation checkout mode * fix: Preserve checkout choices across submission and recovery * test: Match checkout policy defaults and share mode enum * fix: Offer shared checkout and require deliberate transition modes * fix: Retain explicit mode when changing repository selection * test: Match repository menu accessible labels
This commit is contained in:
parent
bb0543fd15
commit
35a2bee409
20 changed files with 888 additions and 66 deletions
|
|
@ -2,6 +2,7 @@ import { logger } from '@librechat/data-schemas';
|
|||
import {
|
||||
isCodeWorkspaceSelections,
|
||||
canonicalizeCodeWorkspaceSelections,
|
||||
isCodeWorkspaceCheckoutAvailable,
|
||||
} from 'librechat-data-provider';
|
||||
import type { CodeWorkspaceSelection } from 'librechat-data-provider';
|
||||
import type { CodeEnvironmentConfig, CodeExecutionContext } from '~/agents/execution';
|
||||
|
|
@ -141,21 +142,28 @@ export async function resolveCodeExecutionWorkspaceContext({
|
|||
if (!workspace) {
|
||||
throw new CodeWorkspaceSelectionError('missing');
|
||||
}
|
||||
const supportsIsolation = workspace.workspaceInstances?.includes('git_worktree') === true;
|
||||
if (
|
||||
!isCodeWorkspaceCheckoutAvailable(
|
||||
selection,
|
||||
workspace,
|
||||
context.codeEnvironmentConfigSchema?.workspaces?.allowCheckoutSelection === true,
|
||||
) ||
|
||||
(selection.checkout === 'isolated' && !context.conversationWorkspaceInstanceId)
|
||||
) {
|
||||
throw new CodeWorkspaceSelectionError('unsupported');
|
||||
}
|
||||
const usesIsolation =
|
||||
selection.checkout !== 'source' && supportsIsolation && context.conversationWorkspaceInstanceId;
|
||||
return {
|
||||
...context,
|
||||
codeWorkspace: {
|
||||
...selection,
|
||||
operations: [...(workspace.operations ?? status.operations)],
|
||||
...(context.conversationWorkspaceInstanceId &&
|
||||
workspace.workspaceInstances?.includes('git_worktree')
|
||||
? { workspaceInstanceId: context.conversationWorkspaceInstanceId }
|
||||
: {}),
|
||||
...(usesIsolation ? { workspaceInstanceId: context.conversationWorkspaceInstanceId } : {}),
|
||||
...(context.codeEnvironmentConfigSchema?.workspaces?.linkedWorktrees === true &&
|
||||
workspace.workspaceScopes?.includes('git_linked_worktree') &&
|
||||
!(
|
||||
context.conversationWorkspaceInstanceId &&
|
||||
workspace.workspaceInstances?.includes('git_worktree')
|
||||
)
|
||||
!usesIsolation
|
||||
? { linkedWorktrees: true }
|
||||
: {}),
|
||||
...(status.maxCommandTimeoutMs == null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue