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
8 changes: 8 additions & 0 deletions docker/40-runtime-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ case "$coordination_overlaps" in
true|false) ;;
*) echo "40-runtime-config: DASHBOARD_COORDINATION_OVERLAPS_ENABLED must be true or false" >&2; exit 1 ;;
esac
# The Sessions page's Session intelligence view (alerts, live status, handoffs).
# Off by default even when the read API serves /v1/session-intel/workspace.
session_intel="${DASHBOARD_SESSION_INTEL_ENABLED-false}"
case "$session_intel" in
true|false) ;;
*) echo "40-runtime-config: DASHBOARD_SESSION_INTEL_ENABLED must be true or false" >&2; exit 1 ;;
esac
app_path="${DASHBOARD_APP_PATH:-/}"
api_base_path="${DASHBOARD_API_BASE_PATH:-/cloud/api}"
login_path="${DASHBOARD_LOGIN_PATH:-/login}"
Expand Down Expand Up @@ -118,6 +125,7 @@ tmp="${target}.tmp.$$"
printf ' sessionAgentFilter: %s,\n' "$session_agent_filter"
printf ' sessionShortSummaries: %s,\n' "$session_short_summaries"
printf ' coordinationOverlaps: %s,\n' "$coordination_overlaps"
printf ' sessionIntel: %s,\n' "$session_intel"
printf ' appPath: %s,\n' "$(json_string "$app_path" DASHBOARD_APP_PATH)"
printf ' apiBasePath: %s,\n' "$(json_string "$api_base_path" DASHBOARD_API_BASE_PATH)"
printf ' loginPath: %s,\n' "$(json_string "$login_path" DASHBOARD_LOGIN_PATH)"
Expand Down
2 changes: 2 additions & 0 deletions docs/repository-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ A recorded short summary can appear under each session title in the list. Enable

The Sessions page's Overlaps view (findings where agent sessions duplicated or collided with each other's work) is off by default. Enable `DASHBOARD_COORDINATION_OVERLAPS_ENABLED=true` to show it; the container accepts only literal `true` or `false` (unset defaults to false), and static hosts can supply the strict boolean `coordinationOverlaps` in the runtime config. It also needs `DASHBOARD_SESSION_READ_API_ENABLED=true` and a read API that serves `GET /v1/coordination/overlaps` (`READ_API_COORDINATION_OVERLAPS_ENABLED=true`). When it is off the page requests nothing from that endpoint, even if the read API serves it.

The Sessions page's Session intelligence view (`?tab=intel`: open coordination alerts grouped by class, live status of sessions active in the last two hours, and handoffs of idle or ended sessions from the last seven days, under a coverage strip) is off by default. Enable `DASHBOARD_SESSION_INTEL_ENABLED=true` to show it; the container accepts only literal `true` or `false` (unset defaults to false), and static hosts can supply the strict boolean `sessionIntel` in the runtime config. It also needs `DASHBOARD_SESSION_READ_API_ENABLED=true` and a read API that serves `GET /v1/session-intel/workspace` (contract `session-intel-workspace/1`, `READ_API_SESSION_INTEL_ENABLED=true`). When it is off the page requests nothing from that endpoint; when the read API answers `501` (not served, not migrated or not enabled for the workspace) the tab stays hidden. While the tab is open and the page is visible the view is read again every 60 seconds (one request at a time, plus a Refresh button); a failed refresh keeps the last view with a short note, and whether the tab is shown still comes from the first read. The view shows only titles, stored short summaries, claim titles, artifacts and ids, never transcript text, and its coverage strip says when summaries or intents/decisions are missing (the read API's `sessionsWithClaims` counts intent and decision claims only); claim-based alerts depend on claim extraction, which the read API reports as off or unknown.

The Timeline, Decision tree and Work graph views are ported from Cloud. They are off by default. Set `DASHBOARD_SESSION_VISUALIZATIONS_ENABLED=true` in the container to emit the strict boolean `sessionVisualizations` in the existing runtime config. Static-host configurations can supply that boolean directly. Missing, false or malformed values retain Conversation and never mount graph reads.

Work graph requires the relaycontrol catalog identity contract (`sessionId`, `source`, `workspaceId`, `found`). Every request uses the existing `/cloud/api` cookie and workspace routes; the dashboard does not contact History directly. Explicit workspace links must match the signed-in workspace. Links to another workspace show a mismatch message without issuing session reads; relaycontrol has no workspace-switch endpoint.
Expand Down
1 change: 1 addition & 0 deletions src/app-path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type RuntimeConfig = {
sessionAgentFilter?: unknown;
sessionShortSummaries?: unknown;
coordinationOverlaps?: unknown;
sessionIntel?: unknown;
analyticsEnabled?: unknown;
};

Expand Down
31 changes: 31 additions & 0 deletions src/runtime-session-intel.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { execFileSync } from "node:child_process";
import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join, resolve } from "node:path";
import { runInNewContext } from "node:vm";
import { expect, it } from "vitest";

it.each([undefined, "false", "true"])("writes the Session intelligence view gate as a strict boolean, off by default (%s)", (value) => {
const directory = mkdtempSync(join(tmpdir(), "dashboard-session-intel-"));
try {
const env: NodeJS.ProcessEnv = { ...process.env, DASHBOARD_HTML_ROOT: directory };
if (value === undefined) delete env.DASHBOARD_SESSION_INTEL_ENABLED;
else env.DASHBOARD_SESSION_INTEL_ENABLED = value;
execFileSync("sh", [resolve("docker/40-runtime-config.sh")], { env, stdio: "pipe" });
const context = { window: {} as { __AGENT_RELAY_DASHBOARD_CONFIG__?: { sessionIntel: unknown } } };
runInNewContext(readFileSync(join(directory, "runtime-config.js"), "utf8"), context);
expect(context.window.__AGENT_RELAY_DASHBOARD_CONFIG__?.sessionIntel).toBe(value === "true");
} finally { rmSync(directory, { recursive: true, force: true }); }
});

it.each(["", "yes", "TRUE", "1", " true ", "true\nfalse"])("refuses malformed Session intelligence view config without replacing existing config (%j)", (value) => {
const directory = mkdtempSync(join(tmpdir(), "dashboard-session-intel-"));
const target = join(directory, "runtime-config.js");
try {
writeFileSync(target, "existing config");
expect(() => execFileSync("sh", [resolve("docker/40-runtime-config.sh")], {
env: { ...process.env, DASHBOARD_HTML_ROOT: directory, DASHBOARD_SESSION_INTEL_ENABLED: value }, stdio: "pipe",
})).toThrow();
expect(readFileSync(target, "utf8")).toBe("existing config");
} finally { rmSync(directory, { recursive: true, force: true }); }
});
Loading
Loading