mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-16 21:03:46 +00:00
wip (#253)
This commit is contained in:
parent
70d31f819c
commit
5ea9ec5e2f
47 changed files with 2605 additions and 669 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
import { taskKey, historyKey, projectBranchSyncKey, projectKey, projectPrSyncKey, taskSandboxKey, workspaceKey } from "../src/actors/keys.js";
|
||||
import { githubDataKey, historyKey, projectBranchSyncKey, projectKey, taskKey, taskSandboxKey, workspaceKey } from "../src/actors/keys.js";
|
||||
|
||||
describe("actor keys", () => {
|
||||
it("prefixes every key with workspace namespace", () => {
|
||||
|
|
@ -9,7 +9,7 @@ describe("actor keys", () => {
|
|||
taskKey("default", "repo", "task"),
|
||||
taskSandboxKey("default", "sbx"),
|
||||
historyKey("default", "repo"),
|
||||
projectPrSyncKey("default", "repo"),
|
||||
githubDataKey("default"),
|
||||
projectBranchSyncKey("default", "repo"),
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
import { shouldMarkSessionUnreadForStatus } from "../src/actors/task/workbench.js";
|
||||
import { shouldMarkSessionUnreadForStatus, shouldRecreateSessionForModelChange } from "../src/actors/task/workbench.js";
|
||||
|
||||
describe("workbench unread status transitions", () => {
|
||||
it("marks unread when a running session first becomes idle", () => {
|
||||
|
|
@ -14,3 +14,46 @@ describe("workbench unread status transitions", () => {
|
|||
expect(shouldMarkSessionUnreadForStatus({ thinkingSinceMs: Date.now() - 1_000 }, "running")).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("workbench model changes", () => {
|
||||
it("recreates an unused ready session so the selected model takes effect", () => {
|
||||
expect(
|
||||
shouldRecreateSessionForModelChange({
|
||||
status: "ready",
|
||||
sandboxSessionId: "session-1",
|
||||
created: false,
|
||||
transcript: [],
|
||||
}),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("does not recreate a session once the conversation has started", () => {
|
||||
expect(
|
||||
shouldRecreateSessionForModelChange({
|
||||
status: "ready",
|
||||
sandboxSessionId: "session-1",
|
||||
created: true,
|
||||
transcript: [],
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("does not recreate pending or anonymous sessions", () => {
|
||||
expect(
|
||||
shouldRecreateSessionForModelChange({
|
||||
status: "pending_session_create",
|
||||
sandboxSessionId: "session-1",
|
||||
created: false,
|
||||
transcript: [],
|
||||
}),
|
||||
).toBe(false);
|
||||
expect(
|
||||
shouldRecreateSessionForModelChange({
|
||||
status: "ready",
|
||||
sandboxSessionId: null,
|
||||
created: false,
|
||||
transcript: [],
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue