fix(server): goals stop the running turn, clear while working, no echoes #25426
Mergedt3dotgg(GitHub profile, opens in a new tab)merged 5 commits into
main fromrefs/pull/25426/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts line 5722Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -5708,0 +5702,21 @@5702+ // makes a turn Codex starts during the pause an orphan, which is stopped.5703+ const pauseUncontinuedGoal = Effect.fnUntraced(function* (5704+ nativeThreadId: string,5705+ expected: CodexRootTerminalEvent,5706+ ) {5707+ const hold = goalHolds.get(nativeThreadId);5708+ if (5709+ hold?.event !== expected ||5710+ goalStops.has(nativeThreadId) ||5711+ goalsByNativeThread.get(nativeThreadId)?.status !== "active"5712+ ) {5713+ return;5714+ }5715+ goalHolds.delete(nativeThreadId);5716+ // Keeps a turn Codex starts before settlement an orphan once the goal reads paused.5717+ goalStops.set(nativeThreadId, (goalStops.get(nativeThreadId) ?? 0) + 1);5718+ yield* Effect.logWarning("orchestration-v2.codex-goal-continuation-expired", {5719+ nativeThreadId,5720+ });5721+ yield* client5722+ .request("thread/goal/set", { threadId: nativeThreadId, status: "paused" })
- apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts line 1736Resolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -1723,3 +1723,14 @@17231723 };17241724 }172517251726+/** The CLI confirms a goal change as a synthetic reply; the goal row shows that change instead. */1727+function isClaudeGoalAcknowledgement(message: SDKMessage): boolean {1728+ if (1729+ message.type !== "assistant" ||1730+ message.parent_tool_use_id !== null ||1731+ message.message.model !== "<synthetic>"1732+ ) {1733+ return false;1734+ }1735+ const text = textFromClaudeContent(message.message.content).trim();1736+ return text.startsWith(CLAUDE_GOAL_SET_PREFIX) || text.startsWith("Goal cleared: ");
- @@ -5708,0 +5705,21 @@5705+ expected: CodexRootTerminalEvent,5706+ ) {5707+ const hold = goalHolds.get(nativeThreadId);5708+ if (5709+ hold?.event !== expected ||5710+ goalStops.has(nativeThreadId) ||5711+ goalsByNativeThread.get(nativeThreadId)?.status !== "active"5712+ ) {5713+ return;5714+ }5715+ goalHolds.delete(nativeThreadId);5716+ // Keeps a turn Codex starts before settlement an orphan once the goal reads paused.5717+ goalStops.set(nativeThreadId, (goalStops.get(nativeThreadId) ?? 0) + 1);5718+ yield* Effect.logWarning("orchestration-v2.codex-goal-continuation-expired", {5719+ nativeThreadId,5720+ });5721+ yield* client5722+ .request("thread/goal/set", { threadId: nativeThreadId, status: "paused" })5723+ .pipe(5724+ // The hold is already claimed, so an unanswered pause must not keep the run open.5725+ Effect.timeout("10 seconds"),
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.




macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed