mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 09:51:22 +00:00
cron: infer payload kind for model-only update patches (openclaw#15664) thanks @rodrigouroz
Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check (fails on current origin/main in src/memory/embedding-manager.test-harness.ts; unchanged by this PR) Co-authored-by: rodrigouroz <384037+rodrigouroz@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
@@ -181,6 +181,28 @@ describe("gateway server cron", () => {
|
||||
expect(merged?.delivery?.channel).toBe("telegram");
|
||||
expect(merged?.delivery?.to).toBe("19098680");
|
||||
|
||||
const modelOnlyPatchRes = await rpcReq(ws, "cron.update", {
|
||||
id: mergeJobId,
|
||||
patch: {
|
||||
payload: {
|
||||
model: "anthropic/claude-sonnet-4-5",
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(modelOnlyPatchRes.ok).toBe(true);
|
||||
const modelOnlyPatched = modelOnlyPatchRes.payload as
|
||||
| {
|
||||
payload?: {
|
||||
kind?: unknown;
|
||||
message?: unknown;
|
||||
model?: unknown;
|
||||
};
|
||||
}
|
||||
| undefined;
|
||||
expect(modelOnlyPatched?.payload?.kind).toBe("agentTurn");
|
||||
expect(modelOnlyPatched?.payload?.message).toBe("hello");
|
||||
expect(modelOnlyPatched?.payload?.model).toBe("anthropic/claude-sonnet-4-5");
|
||||
|
||||
const legacyDeliveryPatchRes = await rpcReq(ws, "cron.update", {
|
||||
id: mergeJobId,
|
||||
patch: {
|
||||
|
||||
Reference in New Issue
Block a user