Skip to content

Commit 5623f36

Browse files
PR Batch Testerclaude
andcommitted
test(claude): a steer retries a command move the SDK refused
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent d832da9 commit 5623f36

2 files changed

Lines changed: 23 additions & 2 deletions

File tree

‎apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4805,6 +4805,7 @@ describe("ClaudeAdapterV2 background wake turns", () => {
48054805
const moves: Array<{ id: string; offered: number; registered: boolean }> = [];
48064806
const registered = new Set(["registered"]);
48074807
const answers = new Map<string, Deferred.Deferred<void>>();
4808+
const failOnce = new Set<string>();
48084809
let rejectOffer = false;
48094810
const harness = yield* makeWakeHarnessWithOptions({
48104811
backgroundTasks: (id) =>
@@ -4816,6 +4817,12 @@ describe("ClaudeAdapterV2 background wake turns", () => {
48164817
registered: isRegistered,
48174818
});
48184819
yield* Queue.offer(moved, id);
4820+
if (failOnce.delete(id)) {
4821+
return yield* new ClaudeAdapterV2.ClaudeAgentSdkQueryRunnerError({
4822+
method: "backgroundTasks",
4823+
cause: new Error("Background tasks are disabled."),
4824+
});
4825+
}
48194826
const answer = answers.get(id);
48204827
if (answer !== undefined) yield* Deferred.await(answer);
48214828
return isRegistered;
@@ -4972,6 +4979,19 @@ describe("ClaudeAdapterV2 background wake turns", () => {
49724979
moves.filter((move) => move.id === "slow").map((move) => move.registered),
49734980
[false, true],
49744981
);
4982+
// The SDK throws when background tasks are off; the next steer tries again.
4983+
failOnce.add("throws");
4984+
registered.add("throws");
4985+
yield* command("throws");
4986+
yield* taskStarted("throws");
4987+
yield* steer("Skip it.");
4988+
yield* through("throws");
4989+
yield* steer("Skip it now.");
4990+
yield* through("throws");
4991+
assert.lengthOf(
4992+
moves.filter((move) => move.id === "throws"),
4993+
2,
4994+
);
49754995
}).pipe(
49764996
Effect.provide(
49774997
Layer.mergeAll(IdAllocator.layer, McpProviderSessions.layer, NodeServices.layer),

‎docs/user/composer.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ your default follow-up behavior; add **Shift** to use the opposite action. This
6464
applies only to multiline messages when you choose the multiline send option.
6565

6666
When you steer Claude while it runs a command, the command keeps running in the
67-
background and Claude reads your message right away. If background tasks are
68-
turned off, the steer waits for the command to finish.
67+
background and Claude reads your message right away. If Claude can't move it,
68+
for example with background tasks turned off, the steer waits for the command to
69+
finish.
6970

7071
Use `Cmd+Shift+Enter` on macOS or `Ctrl+Shift+Enter` on Windows and Linux to send
7172
the oldest queued message as a steer. This leaves the current draft intact and

0 commit comments

Comments
 (0)