Skip to content

Commit 2c4b21b

Browse files
Node: Regenerate post user prompt hook snapshot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 9704735 commit 2c4b21b

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

nodejs/test/e2e/hooks_extended.e2e.test.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,30 +158,28 @@ describe("Extended session hooks", async () => {
158158
onPostUserPromptSubmitted: async (input, invocation) => {
159159
inputs.push(input);
160160
expect(invocation.sessionId).toBeTruthy();
161-
expect(input.prompt).toContain("Say something after prompt transformation");
162-
expect(input.transformedPrompt).toContain(
163-
"Say something after prompt transformation"
164-
);
161+
expect(input.prompt).toContain("Answer the arithmetic question above");
162+
expect(input.transformedPrompt).toContain("Answer the arithmetic question above");
165163
expect(input.transformedPrompt).toContain("<current_datetime>");
166164

167165
return {
168166
modifiedTransformedPrompt: input.transformedPrompt.replace(
169167
/<current_datetime>.*?<\/current_datetime>\n*/s,
170-
"POST_USER_PROMPT_SUBMITTED_HOOK\n"
168+
"What is 19 + 23? Reply with just the number.\n"
171169
),
172170
};
173171
},
174172
},
175173
});
176174

177175
const response = await session.sendAndWait({
178-
prompt: "Say something after prompt transformation",
176+
prompt: "Answer the arithmetic question above.",
179177
});
180178

181179
expect(inputs.length).toBeGreaterThan(0);
182180
expect(inputs[0].timestamp).toBeInstanceOf(Date);
183181
expect(inputs[0].workingDirectory).toBeDefined();
184-
expect(response?.data.content ?? "").toContain("POST_USER_PROMPT_SUBMITTED_HOOK");
182+
expect(response?.data.content ?? "").toContain("42");
185183

186184
await session.disconnect();
187185
});

test/snapshots/hooks_extended/should_invoke_postuserpromptsubmitted_hook_and_modify_transformed_prompt.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ conversations:
66
content: ${system}
77
- role: user
88
content: |-
9-
POST_USER_PROMPT_SUBMITTED_HOOK
10-
Say something after prompt transformation
9+
What is 19 + 23? Reply with just the number.
10+
Answer the arithmetic question above.
1111
- role: assistant
12-
content: POST_USER_PROMPT_SUBMITTED_HOOK
12+
content: "42"

0 commit comments

Comments
 (0)