Skip to content

feat(session-manager): add the Session Manager service - #5332

Merged
yannickmonney merged 4 commits into
mainfrom
feat/session-manager-service
Nov 3, 2026
Merged

yannickmonney merged 4 commits into
mainfrom
feat/session-manager-service

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Rebuilds the Session Manager as services/session-manager, a TypeScript service in the Tale monorepo. It runs isolated Camoufox browser sessions on your own computer: each session has its own profile, stable fingerprint and proxy. It has a proxy pool with checks and import, a secrets vault that can be typed into pages, a live view of the browsers in the page, and an MCP endpoint (42 tools) for AI assistants. It was a Python/FastAPI app in a separate repository (kept as the behaviour reference); its data is not migrated (decided: no longer needed, no importer).

It is released like web: part of Tale's release train (the same v*.*.* cohort), published as its own image (ghcr.io/tale-project/tale/tale-session-manager), run from its own standalone compose stack, with its own container test and CI scope, build and Playwright jobs. Two deliberate differences from web: it is not a "site" (it stays out of the sites_only re-release lane), and its compose file publishes on loopback only, because it has no login and drives browsers with your proxies and secrets.

Four commits, in the order to read them:

  1. feat(ui): what the shared library needed (backwards compatible; every default path is unchanged for platform, web, docs and ui-docs).
  2. feat(session-manager): the service.
  3. ci(session-manager): release, CI, compose, guards and docs.
  4. fix(session-manager): what the first CI run showed on Linux and Windows (the secrets table beside a classic scrollbar, a focus ring of the app's own for <summary>, two timing fixes in specs).

What is in it

  • The service, scaffolded from the plop service template with the same layout as the other services. One Bun process serves the page, the HTTP API (Hono + zod), the live view (WebSocket) and /mcp; SQLite store (bun:sqlite); camoufox-js + playwright-core for the browsers. The frontend is React 19, TanStack Router, react-query and react-hook-form on @tale/ui components, laid out like the platform (rail, sessions panel, settings kit, tables, dialogs, empty and error states), in English, German and French (du/tu), WCAG 2.1 AA. The README has the security model, the HTTP API, the MCP tools and the Docker run; a manual test layer sits next to the tests.
  • Shared library (packages/ui): Input/Textarea secret mode with show/hide and copy (FieldValueActions), CopyableField masked/wrap values, Dialog sticky footer + initial focus (passed on by FormDialog), startReactServer WebSocket endpoints + idleTimeout + an analytics switch, and a 400 that carries the security headers for a malformed Host instead of a bare 500; catalogs (en/de/fr), ui-docs pages and demos, stories and tests for each.
  • Release, CI and docs: release.yml (full cohort), build.yml (session-manager-test), e2e.yml (static-sites matrix), ci-scope, the release-candidate contract, the guard tests that enumerate services, workflows and images, compose.session-manager.yml + its test override, the container test, docs/{en,de,fr}/develop/compose-files.md, .agents/repo.md, CI.md, RELEASING.md, issue templates + labeler, knip, the commitlint scope.
  • Browser tests that stay quick: the Playwright suite (815 specs) runs one isolated fake server per worker: about 9 minutes on 4 workers on a 12-core Mac, against 33 minutes serial.

Things to know before merging

  • Ops: the release-candidate contract (.github/release-candidate-contract.json) changes by 14 lines (new build job ids and names, the e2e names, the pr-scope output, the scope env, the static-sites timeout 20 → 25 minutes, the e2e success list). No digest is stored in the repo, so the Ops-side digest needs its usual review. The 25-minute timeout holds: the session-manager Playwright job took 13 to 15 minutes in CI on its two runs (the jsdom UI suite of the service, about 1.5 minutes, also joins UI shard 1).
  • Sandbox on Incus was red on the first runs, for a reason outside this change. services/sandbox/e2e/incus/lab.sh on main pinned Incus 7.5.1 builds that Zabbly's stable channel no longer carried, so the lab stopped at its install step. It runs on this pull request because the PR edits the CI scope files, which gives it the full scope. fix(sandbox): pin a current Zabbly build of Incus in the lab #5336 pinned the current 7.6 builds and is merged; this branch is rebased on it.
  • First start downloads the Camoufox browser (about 700 MB on macOS; 624 MB archive, 1.26 GB unpacked on Linux) and the GeoIP database into the data directory; old browser builds are never pruned (documented). The container reports healthy meanwhile, and its test does not depend on the download.
  • Camoufox 152 (what camoufox-js pins), not the old app's 156.
  • WebGL is not available in the container (Firefox headless has no GL; it would need Xvfb + Mesa, about 190 MB more): run natively with Bun when fingerprint fidelity matters. Documented in the README.
  • New dependencies, all in the service only: camoufox-js, playwright-core, fingerprint-generator, socks (browser, identity and SOCKS5 client; nothing equivalent in the monorepo), undici (HTTP through a proxy dispatcher for the exit-IP checks), fast-xml-parser (the CLDR territory data of the geo lookup); hono, zod, react-query, react-hook-form are the stack the other services use. bun audit --prod --audit-level=high is clean; Opengrep: 0 findings.
  • Reviewed independently (backend security, CI/release, shared library, frontend, four review rounds; every finding was fixed or is documented in the README's security model). Examples: loopback addresses go through the session's proxy, assistants see page text inside a delimited "untrusted content" block, cross-site requests are refused, request and length limits, credentials never reach logs or import reports, secret values do not stay in the query cache.
  • Found by repeating the real-browser lane: about 4 % of the Windows fingerprints of fingerprint-generator have navigator.oscpu: null; Camoufox then leaves the computer's real value in place, so a page could read the host OS under another OS's user agent. A fingerprint without it is now drawn again.

Follow-ups (not in this PR)

Library: lift the settings kit, ShellAlert, AppRail, useDocumentTitle and useConnectionTrouble into @tale/ui (copied from the platform for now); an AT-safe masked mode for Input/Textarea (CSS-masked fields are read aloud); the toaster has no close control and sits over page headers' primary actions for 5 s; use-restore-focus while a popover fades out; Radix menus and the viewer's tab strip raise scrollable-region-focusable at 844×390; <html lang> for unsupported browser locales; the toast region label in de/fr; German common.actions.clearAll; PropertyRow 80 px label column; ErrorDisplayCompact says "Try again" three times; sticky DataTable footer sliver; IconButton focus-ring contrast; Tabs/CodeBlock coarse-pointer sizes; CodeBlock copy feedback; CollapsibleDetails summary class; LanguageSwitcher alignment. Service: compose hardening flags (cap_drop, no-new-privileges) once verified with a real session; the image on arm64 is not verified; two managers on one data directory are not refused (documented).

Checklist

  • bun run check passes (format, lint, typecheck, all tests). Run locally for everything this change touches: oxfmt on the whole repo, oxlint --type-aware and tsc for the service, the service's server (2,916 tests) and UI (2,570 tests) projects, packages/ui (4,447 unit tests) and the platform suites that render the changed components; the rest of the monorepo's suites are left to CI. The guard tests under tools/cli pass except two in platform-docs.test.ts that need generated sources this checkout does not build (they fail the same way on main).
  • bun run lint:sast passes (Opengrep, 0 findings).
  • Translations: the service's messages/{en,de,fr}/*.yml (reviewed in all three languages) and the packages/ui catalogs (697 keys each, same keys in en, de and fr).
  • Docs: the compose-files pages in docs/{en,de,fr}/ are updated and ui-docs has pages and demos for the shared components. N/A for other user docs: the Session Manager is a standalone developer tool documented by its own README and manual test layer; like the other standalone services it has no pages under docs/.
  • README.md / README.de.md / README.fr.md: N/A: they describe the platform. The service has its own README.

Test plan

  • Server project: 95 files, 2,916 tests (store, routes, MCP, live view, proxies, identity, security, guards). UI project (jsdom): 174 files, 2,570 tests.
  • Playwright against the production build, fake browser: 815 specs, repeated three times per area and twice as a whole (4 workers, about 9 minutes): sessions 157, viewer 181, proxies 139, secrets 100, settings 70, navigation 92, accessibility 63 (axe in light, dark, phone and 844×390), smoke 11, plus the isolation checks.
  • Real browser (Camoufox) lane, opt-in: 6 files, 138 tests, clean in 7 full runs (the one earlier failure led to the fingerprint fix above) and 16 more runs of its key-input file alone (bun run --filter @tale/session-manager test:camoufox, needs an installed build; see the README).
  • Shared library: packages/ui 398 files, 4,447 unit tests; browser tests for the changed components; the platform, web, docs and ui-docs suites that use them.
  • Look at it: bun install, then bun run --filter @tale/session-manager dev (http://localhost:3004), or build and start it (build, then start); the Docker way is docker compose -f compose.session-manager.yml up --build. Screenshots of every screen and state (light/dark, phone, German, French) were reviewed.

…n manager

The session manager's add-secret form is built on existing components, so the
library gets what that form needed. Every default path stays as it was for the
other consumers (platform, web, docs, ui-docs).

- Input and Textarea: a secret mode with show/hide and copy buttons
  (FieldValueActions), spell check, auto-correct and auto-capitalize off for
  sensitive values, the caller's ref left alone (React 19 ref cleanup keeps
  working), the reveal state re-masks when masking turns off, and the buttons
  are inert inside Skeletonize.
- CopyableField: masked and wrap values with the same actions.
- Dialog: a sticky footer and an initial-focus ref, passed on by FormDialog.
- startReactServer: WebSocket endpoints and an idle timeout, an `analytics`
  switch (UMAMI_* is followed by default), and a 400 that carries the security
  headers for a malformed Host header instead of a bare 500.
- Catalogs (en/de/fr), ui-docs pages and demos, stories and tests for each; the
  Storybook preview gets the TooltipProvider its stories need.
Rebuilds the Session Manager as services/session-manager, a TypeScript service
in the monorepo. It runs isolated Camoufox browser sessions on your own
computer: each session has its own profile, stable fingerprint and proxy. It
has a proxy pool with checks and import, a secrets vault that can be typed
into pages, a live view of the browsers in the page, and an MCP endpoint
(42 tools) for AI assistants. It was a Python/FastAPI app; its data is not
migrated.

- Backend: one Bun process serving the page, the HTTP API (Hono + zod), the
  live view (WebSocket) and /mcp; bun:sqlite store; camoufox-js and
  playwright-core for the browsers. Host, Origin and Sec-Fetch-Site checks,
  request and length limits, loopback traffic through the session's proxy,
  page text framed as untrusted for assistants, credentials kept out of logs
  and reports.
- Frontend: React 19, TanStack Router, react-query and react-hook-form on
  @tale/ui, laid out like the platform, in English, German and French, WCAG
  2.1 AA.
- Tests: server and UI projects, a real-browser lane (opt-in), guards, and a
  Playwright suite that runs one isolated fake server per worker.
- README with the security model, the HTTP API and the MCP tools; a manual test
  layer.
The Session Manager is released like web: part of the release train, its own
image (tale-session-manager), standalone compose stack, container test, CI
scope, build job and Playwright job. It is not a site (it stays out of the
sites_only lane) and its compose file publishes on loopback only, because it
has no login.

- Workflows: release.yml (full cohort), build.yml (session-manager-test),
  e2e.yml (static-sites matrix, 25-minute job timeout), ci-scope, and the
  release-candidate contract.
- compose.session-manager.yml and its test override, the container test and
  its helper, the guard tests that enumerate services, workflows and images.
- Docs and housekeeping: compose-files pages (en/de/fr), CI, RELEASING and
  CONTRIBUTING notes, .agents/repo.md, issue templates and labeler, knip,
  commitlint scope, performance inventory, lockfile.
…t on Windows and Linux

The browser tests on the CI runner (Linux, where a scrollbar takes room from the
page) found what a Mac hides:

- Secrets table: the full table needed 932 px, and a window of 1024 px leaves
  940 px on a Mac but 925 px beside a scrollbar that is not an overlay, so
  Windows and Linux showed the compact row there. The details column needs 80 px
  least now (912 px in all).
- The summaries of collapsible details (the tool groups, the import report, the
  install issue) relied on the browser's own focus ring, whose colour differs
  per platform. They carry a ring of the app's tokens, like every other control.
- Tests: a tap waits the 700 ms the page lets go of mouse events after a drag
  (a tap sooner is one of them, and the CI runner is quicker than a Mac), and a
  dialog is measured once it has stopped sliding in.
@yannickmonney
yannickmonney force-pushed the feat/session-manager-service branch from 52a3b1c to 7ae31b5 Compare November 3, 2026 10:03
@yannickmonney
yannickmonney merged commit 046de90 into main Nov 3, 2026
113 of 115 checks passed
@yannickmonney
yannickmonney deleted the feat/session-manager-service branch November 3, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant