feat: v2.5.12 — plan and quota for every AI tool, Grok Build and Kimi Code, Quit AgentHub (#65)
Usage panel (status bar): - every account shows its plan (Claude subscriptionType, Codex chatgpt_plan_type, Cursor membershipType, Grok subscriptionTier) - new quota rows: Cursor CLI (cursor.com usage-summary), Antigravity (`agy --print /usage`, two model pools; AGENTHUB_AGY_USAGE=0 never runs agy), Grok Build, Kimi Code, OpenCode Go — each login read from the tool's own file, sent only to its own host while valid, never refreshed - in-flight quota reads are shared between tabs AI Tools catalog: Grok Build (`grok`) and Kimi Code (`kimi`) added; Gemini CLI, Hermes and OpenClaw removed. Also: Quit AgentHub (#65, `agenthub stop`), status-area icon, Add to Chat on an editor selection, Settings in three groups, JetBrains-style Changes panel (ticked files/hunks, ignore, blame, file history), terminal font. --no-verify: :3000 is taken by another dev server (lane-detect tests); both suites run by hand — server 2636/2639 (the 3 are :3000), client 1131/1131.
This commit is contained in:
@@ -57,6 +57,53 @@ describe("tmux wrapper", () => {
|
||||
assert.equal(tmux.liveSessions(), null);
|
||||
});
|
||||
|
||||
describe(
|
||||
"the tmux server outlives the dashboard (Linux)",
|
||||
{ skip: process.platform !== "linux" },
|
||||
() => {
|
||||
// Fake tmux: no server until a new-session, then every call succeeds.
|
||||
const fake =
|
||||
(calls, { running = false } = {}) =>
|
||||
(args) => {
|
||||
calls.push(["tmux", ...args].join(" "));
|
||||
if (args[0] === "display-message" && !running)
|
||||
throw Object.assign(new Error("no server"), { status: 1 });
|
||||
if (args[0] === "has-session" && !running)
|
||||
throw Object.assign(new Error("no session"), { status: 1 });
|
||||
return args[0] === "display-message" ? "4242\n" : "";
|
||||
};
|
||||
|
||||
it("starts the FIRST session in its own systemd scope, not the dashboard's cgroup", () => {
|
||||
const calls = [];
|
||||
tmux.__setExecImpl(fake(calls));
|
||||
tmux.__setScopeImpl((args) => calls.push(["systemd-run", "tmux", ...args].join(" ")));
|
||||
tmux.newSession({ name: "agenthub-lane-1", cwd: "/w", argv: ["claude"], env: {} });
|
||||
assert.ok(
|
||||
calls.includes("systemd-run tmux new-session -d -s agenthub-lane-1 -c /w -- claude")
|
||||
);
|
||||
assert.ok(!calls.some((c) => c.startsWith("tmux new-session")));
|
||||
});
|
||||
|
||||
it("adds a session to a running server directly", () => {
|
||||
const calls = [];
|
||||
tmux.__setExecImpl(fake(calls, { running: true }));
|
||||
tmux.__setScopeImpl(() => assert.fail("a running server needs no scope"));
|
||||
tmux.newSession({ name: "agenthub-lane-1", cwd: "/w", argv: ["claude"], env: {} });
|
||||
assert.ok(calls.includes("tmux new-session -d -s agenthub-lane-1 -c /w -- claude"));
|
||||
});
|
||||
|
||||
it("starts it plainly when no systemd user manager answers", () => {
|
||||
const calls = [];
|
||||
tmux.__setExecImpl(fake(calls));
|
||||
tmux.__setScopeImpl(() => {
|
||||
throw Object.assign(new Error("Failed to connect to bus"), { status: 1 });
|
||||
});
|
||||
tmux.newSession({ name: "agenthub-lane-1", cwd: "/w", argv: ["claude"], env: {} });
|
||||
assert.ok(calls.includes("tmux new-session -d -s agenthub-lane-1 -c /w -- claude"));
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
it("newSession names a command that exited at once instead of tmux's set-option error", () => {
|
||||
tmux.__setExecImpl((args) => {
|
||||
if (args[0] === "new-session") return "";
|
||||
|
||||
Reference in New Issue
Block a user