Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20297,6 +20297,13 @@ describe("ClaudeAdapterV2 background wake turns", () => {
);

describe("native goals", () => {
it("preserves a multiline /goal as a native command when its objective mentions a skill", () => {
const skills = new Map([["review", { path: "/home/me/.claude/skills/review/SKILL.md" }]]);
const text = "/goal fix all the gaps.\ndecompile target.ipa into ./target/\n$review";
const message = ClaudeAdapterV2.makeClaudeUserMessage({ text, skills });
assert.equal(message.message.content, text);
});

const syntheticFrame = (uuid: string, text: string) =>
claudeSdkFrame({
type: "assistant",
Expand Down
6 changes: 5 additions & 1 deletion apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ import {
TrimmedNonEmptyString,
defaultInstanceIdForDriver,
isCompactionCommandMessage,
parseGoalCommand,
type MessageId,
type ModelSelection,
type OrchestrationV2ConversationMessage,
Expand Down Expand Up @@ -2418,8 +2419,11 @@ export function makeClaudeUserMessage(input: {
}): SDKUserMessage {
// Claude expands a skill only when `/name` starts the last text block.
// Keep the whole request before that block; see ClaudeSkillDispatch.
// Keep /goal on the native command path instead of dispatching a skill in its objective.
const dispatch =
input.skills === undefined ? undefined : planClaudeSkillDispatch(input.text, input.skills);
input.skills === undefined || parseGoalCommand(input) !== null
? undefined
: planClaudeSkillDispatch(input.text, input.skills);
return {
type: "user",
message: {
Expand Down
Loading