Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): settled and idle-released threads no longer stay Waiting #19355

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/19355/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 7 changed files with 60 additions and 1 deletion (loading 4).

x
0 of 7 viewed, 7 left
2 additions and 0 deletionsapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.tsModified
View file
@@ -9065,6 +9065,8 @@
getModelContextWindow: (selection) =>
resolveClaudeCatalogContextWindowTokens(BUNDLED_CLAUDE_MODEL_CATALOG, selection),
events: Stream.fromEffectRepeat(Queue.take(events)),
+ // Background shells, agents, monitors, and workflows end with the CLI.
+ backgroundTasksEndWithProcess: true,
hasPendingBackgroundWork: Effect.gen(function* () {
// Session capability: any native thread with pending work pins idle.
for (const roster of (yield* Ref.get(pendingBackgroundTasksByNativeThread)).values()) {
56 additions and 0 deletionsapps/server/src/orchestration-v2/EventSink.tsModified
View file
@@ -2,6 +2,7 @@
CommandId,
type OrchestrationV2Run,
OrchestrationV2DomainEvent,
+ type OrchestrationV2ProviderThread,
OrchestrationV2StoredEvent,
ProviderThreadId,
RunAttemptId,
@@ -119,6 +120,22 @@
EventSinkV2Error
+ /**
+ * Atomically commit only while the stored provider thread still equals
+ * `expected`, the row its writer read, so a read-modify-write of the row
+ * cannot overwrite an update published in between. The whole row is