Skip to content
Open
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
7 changes: 5 additions & 2 deletions src/benchmarks/search/core/solver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,11 @@ describe("searchSolver", () => {
});
it("appends the switchyard-router plugin after the serialized web plugin", async () => {
let sentOptions: ResponsesSendOptions | undefined;
let sent: ResponsesRequest | undefined;
const solver = searchSolver(
{
send: (_body, options) => {
send: (body, options) => {
sent = body;
sentOptions = options;
return effectSucceed(fixtureResult({ text: "x" }));
},
Expand All @@ -332,7 +334,7 @@ describe("searchSolver", () => {
switchyardAlgorithm: "stage",
}
);
await runSolver(
const state = await runSolver(
solver(initialTaskState({ id: "s", input: "q", target: { text: "t" } }))
);
expect(sentOptions?.extraBody).toEqual({
Expand All @@ -341,6 +343,7 @@ describe("searchSolver", () => {
{ id: "switchyard-router", algorithm: "stage" },
],
});
expect(state.requestBody).toEqual({ ...sent, ...sentOptions?.extraBody });
});
it("sends only the switchyard-router plugin with server tools, ignoring the variant suffix", async () => {
let sentOptions: ResponsesSendOptions | undefined;
Expand Down
5 changes: 4 additions & 1 deletion src/benchmarks/search/core/solver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export function searchSolver(
return completedState({
state,
request: body,
extraBody,
result,
attemptResults,
text: result.text.trim(),
Expand Down Expand Up @@ -262,12 +263,14 @@ function makeStreamEventReporter(
function completedState({
state,
request,
extraBody,
result,
attemptResults,
text,
}: {
readonly state: TaskState;
readonly request: ResponsesRequest;
readonly extraBody: Readonly<Record<string, unknown>> | undefined;
readonly result: ResponsesResult;
readonly attemptResults: readonly ResponsesResult[];
readonly text: string;
Expand Down Expand Up @@ -304,7 +307,7 @@ function completedState({
: []),
],
responseItems: responseItemsForCall(request, result),
requestBody: { ...request },
requestBody: { ...request, ...extraBody },
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
output: definedValues({
completion: text,
message: { role: MessageRole.Assistant, content: text },
Expand Down
Loading