Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): changing the permission mode no longer ends the running turn #23082

Openmackinleysmith(GitHub profile, opens in a new tab)wants to merge 10 commits intomain fromrefs/pull/23082/headopened View on GitHub

Showing 5 changed files with 94 additions and 17 deletions (loading 2).

x
0 of 5 viewed, 5 left
2 additions and 0 deletionsapps/server/src/orchestration-v2/CheckpointRollbackService.tsModified
View file
@@ -313,6 +313,8 @@
providerSessionId: providerThread.providerSessionId,
modelSelection,
runtimePolicy: resolvedRuntimePolicy,
+ // A pending permission-mode change waits for the next user turn.
+ preserveRuntimeMode: true,
...(existingSession === undefined ? {} : { resumeFromSession: existingSession }),
...(providerThread.nativeThreadRef?.nativeId == null
? {}
16 additions and 15 deletionsapps/server/src/orchestration-v2/Orchestrator.tsModified
View file
@@ -4454,13 +4454,7 @@
command.worktreePath !== undefined &&
command.worktreePath !== thread.worktreePath
? (providerContext?.providerSessions ?? []).map((session) => session.id)
- : command.type === "thread.runtime-mode.set"
- ? (providerContext?.providerSessions ?? [])
- .filter(
- (session) => !session.capabilities.sessions.supportsRuntimeModeSwitchInSession,
- )
- .map((session) => session.id)
- : (providerSwitchPlan?.releaseProviderSessionIds ?? []),
+ : (providerSwitchPlan?.releaseProviderSessionIds ?? []),
const liveSessions = (providerContext?.providerSessions ?? []).filter(
(session) =>
@@ -4468,10 +4462,21 @@