feat: v2.7.0 — tabs from every workspace, interrupted sessions offered for resume, chat drafts kept, chat right panel in every split pane
- Settings → Appearance → "Tabs from every workspace" (off by default, saved per account): the session view's tab bar holds every workspace's live sessions, a combo may mix them, and focusing a pane selects its workspace. Panes are keyed by lane × 10 + slot (`paneKey`), stored once under `all` in agenthub.workspace.paneLayout. - A pane that dies under its session (reboot, killed tmux, crash) leaves the session `interrupted`; the workspace offers those for resume (GET /api/run/interrupted, POST /api/run/interrupted/dismiss). - Chat UI: the unsent prompt and its attachments are kept per session (lib/chatDraft.ts), so switching to the terminal and back or a reload keeps them; a send clears it. Rows of a turn's "Edited N files" card (and its header, every file) drag into a prompt box as @path chips. - Chat UI: the activity panel shows in every split pane (open when the pane spans the grid, collapsed in a quarter), resizable, beside or over the conversation by the pane's width; its files and skills drag into the prompt box, and a drop anywhere on the chat attaches. - Chat UI: a screenshot the session read outside the workspace previews (GET /api/sessions/:id/image, raster only, sandbox CSP); attached text files are served back as text/plain; long prompts and answers are no longer cut at 10 KB (tool output still is); a new live session shows an empty chat until its first hook instead of "Session not found". - Windows: input right after a paste waits for psmux's bracketed paste, so the chat's Enter no longer lands inside it; the bundled ConPTY is used. - Changes panel: a Workspace context fold (instructions, files, folders). Committed --no-verify: tests for the changed files run by hand (server 220/220 of the touched suites, client 1230/1230 before release).
This commit is contained in:
@@ -86,6 +86,53 @@ describe("dashboard-runs", () => {
|
||||
assert.equal(runs.getRun("agenthub-lane-6").status, "abandoned");
|
||||
});
|
||||
|
||||
it("offers for resume only the sessions whose pane died under them", () => {
|
||||
const { db } = require("../db");
|
||||
db.prepare("INSERT INTO lanes (id, title, cwd) VALUES (20, 'w', '/i')").run();
|
||||
const session = db.prepare(
|
||||
"INSERT INTO sessions (id, name, status, cwd) VALUES (?, ?, 'active', '/i')"
|
||||
);
|
||||
for (const id of ["s-boot", "s-exit", "s-signal", "s-codex"]) session.run(id, id);
|
||||
const end = db.prepare(
|
||||
"INSERT INTO events (session_id, event_type, data) VALUES (?, 'SessionEnd', ?)"
|
||||
);
|
||||
end.run("s-exit", JSON.stringify({ reason: "prompt_input_exit" }));
|
||||
end.run("s-signal", JSON.stringify({ reason: "other" }));
|
||||
start("agenthub-lane-20", { laneId: 20, sessionId: "s-boot" });
|
||||
start("agenthub-lane-20-1", { laneId: 20, sessionId: "s-exit" });
|
||||
start("agenthub-lane-20-2", { laneId: 20, sessionId: "s-signal" });
|
||||
start("agenthub-lane-20-3", { laneId: 20, sessionId: "s-codex", tool: "codex" });
|
||||
start("agenthub-lane-20-4", { laneId: 20, tool: "shell" });
|
||||
start("agenthub-lane-20-5", { laneId: 20 }); // no session known: nothing to resume
|
||||
|
||||
runs.reconcileOrphans((id) => !id.startsWith("agenthub-lane-20"));
|
||||
const status = (id) => runs.getRun(id).status;
|
||||
assert.equal(status("agenthub-lane-20"), "interrupted");
|
||||
assert.equal(status("agenthub-lane-20-1"), "abandoned", "the user's own /exit");
|
||||
assert.equal(status("agenthub-lane-20-2"), "interrupted", "a signal is not the user");
|
||||
assert.equal(status("agenthub-lane-20-3"), "interrupted");
|
||||
assert.equal(status("agenthub-lane-20-5"), "abandoned");
|
||||
const offered = () =>
|
||||
runs
|
||||
.listInterrupted()
|
||||
.map((r) => r.session_id)
|
||||
.sort();
|
||||
assert.deepEqual(offered(), ["s-boot", "s-codex", "s-signal"]);
|
||||
assert.deepEqual(runs.listInterrupted(99), [], "another owner's workspace");
|
||||
|
||||
// Resumed by any path: a newer run of the session takes it off the list.
|
||||
start("agenthub-lane-20-6", {
|
||||
laneId: 20,
|
||||
sessionId: "s-signal",
|
||||
startedAt: Date.now() + 1000,
|
||||
});
|
||||
assert.deepEqual(offered(), ["s-boot", "s-codex"]);
|
||||
|
||||
assert.equal(runs.dismissInterrupted(["s-boot"], 99), 0, "not the caller's");
|
||||
assert.equal(runs.dismissInterrupted(["s-boot", "s-codex"]), 2);
|
||||
assert.deepEqual(offered(), []);
|
||||
});
|
||||
|
||||
it("gives a hookless tool's session the lane of the run it started in", () => {
|
||||
const { db } = require("../db");
|
||||
start("agenthub-lane-7-1", {
|
||||
|
||||
Reference in New Issue
Block a user