The best way to control Claude Code, Codex and more from any computer or phone
fix(server): Claude sets a /goal that also mentions a skill (#34818)
Julius Marminge committed
Nov 11, 2026 at 23:20 UTC
a86ffacc378b240863b5608a9c8e6f06fb4d5833
2 files changed
+27
-8
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts
+14
@@ -5058,6 +5058,20 @@ describe("ClaudeAdapterV2 background wake turns", () => {
5058
),
5059
);
5060
5061
+ // regression: #29750 Claude sets a goal only from a prompt that opens with /goal
5062
+ it("keeps a /goal that mentions a skill as one native goal command", () => {
5063
+ const message = ClaudeAdapterV2.makeClaudeUserMessage({
5064
+ text: "/goal fix all the gaps.\ndecompile target.ipa into ./target/\n$review",
5065
+ skills: new Map([["review", { path: "/home/me/.claude/skills/review/SKILL.md" }]]),
5066
+ });
5067
+ const content = message.message.content;
5068
+ assert.isString(content);
5069
+ assert.match(
5070
+ content as string,
5071
+ /^\/goal fix all the gaps\.\ndecompile target\.ipa into \.\/target\/\n/,
5072
+ );
5073
+ });
5074
+
5075
// regression: #15708 Stop must not silently drop a steer Claude queued behind a foreground task
5076
it.effect.each([
5077
{
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts
+13
-8
@@ -97,6 +97,7 @@ import {
97
TrimmedNonEmptyString,
98
defaultInstanceIdForDriver,
99
isCompactionCommandMessage,
100
+ parseGoalCommand,
101
type MessageId,
102
type ModelSelection,
103
type OrchestrationV2ConversationMessage,
@@ -2551,18 +2552,22 @@ export function makeClaudeUserMessage(input: {
2552
// Keep the whole request before that block; see ClaudeSkillDispatch.
2553
const dispatch =
2554
input.skills === undefined ? undefined : planClaudeSkillDispatch(input.text, input.skills);
2555
+ // Claude runs `/goal` only when it opens the prompt, so a goal stays one block.
2556
+ const isGoalCommand = parseGoalCommand({ text: input.text }) !== null;
2557
return {
2558
type: "user",
2559
message: {
2560
role: "user",
2558
- content: dispatch
2559
- ? [
2560
- ...(dispatch.leadingText === undefined
2561
- ? []
2562
- : [{ type: "text" as const, text: dispatch.leadingText }]),
2563
- { type: "text" as const, text: dispatch.commandText },
2564
- ]
2565
- : input.text,
2561
+ content: isGoalCommand
2562
+ ? (dispatch?.leadingText ?? input.text)
2563
+ : dispatch
2564
+ ? [
2565
+ ...(dispatch.leadingText === undefined
2566
+ ? []
2567
+ : [{ type: "text" as const, text: dispatch.leadingText }]),
2568
+ { type: "text" as const, text: dispatch.commandText },
2569
+ ]
2570
+ : input.text,
2571
},
2572
parent_tool_use_id: null,
2573
...(input.priority === undefined ? {} : { priority: input.priority }),