Skip to content

v0.7.0 — Team mode, excluding directories, operational status

Choose a tag to compare

@jstuart0 jstuart0 released this 03 Oct 13:59
· 680 commits to main since this release
b8cc1ec

Added

  • Team mode and user ownership (AGEN-64). An install now runs in one of
    two modes. Solo, the default, behaves as before. Team mode (switched in
    Settings → Team by an admin, or fixed with AGENTPULSE_MODE) records who
    owns each session, API key and host, adds admins and members, and checks
    the owner or an admin before a session is deleted, archived, renamed,
    pinned or its notes edited, before a key is revoked, and before a host is
    rotated or revoked. A session's owner is whoever's API key first reported
    it (the first write wins); a launched session is owned by whoever
    launched it. Team mode is attribution, not privacy: every signed-in
    member still sees every session, can prompt, stop or retry any managed
    session, and can launch on any host. New: GET /instance,
    PUT /instance/mode, GET/POST/PATCH /users and the disable, enable and
    reset-password routes, GET /users/directory (readable by observe
    keys), PATCH /sessions/:id/owner, PATCH /api-keys/:id,
    PATCH /admin/supervisors/:id, and an owner filter on
    GET /sessions and GET /sessions/stats. The dashboard gains
    Mine | Everyone, an Owner select, Group by (Project, User, Agent), owner
    chips, and server-counted tab badges. SSO users get an account on first
    sign-in; AGENTPULSE_ADMIN_SSO_SUBJECTS lists admin uids. New
    variables: AGENTPULSE_MODE, AGENTPULSE_ADMIN_SSO_SUBJECTS,
    AGENTPULSE_SESSION_CREATE_LIMIT (team mode: 120 new sessions a minute
    per person or ownerless key). With AGENTPULSE_MODE=team set in the
    environment, existing API keys with no owner and manage scope act as
    members until an admin keeps or assigns them, so automation using one for
    settings or key management gets 403 admin_required. After switching,
    every existing host needs an owner (or its key kept as a service key), or
    hook events for dashboard-launched sessions from it are ignored.
    Offboarding means disabling the person in AgentPulse; removing them at
    the identity provider is not enough. See the README's "Teams" section and
    deploy/k8s/RUNBOOK-secrets-rotation.md. Migration: Postgres 0007 /
    SQLite 0006.

  • Exclude rule: keep chosen directories out of AgentPulse (AGEN-63).
    ~/.agentpulse/exclude lists directories (one absolute path per line)
    whose sessions are never reported, checked on the user's own machine
    before anything is sent. Codex and Copilot hook commands, the relay and
    the supervisor apply it; an invalid rules file fails closed for each of
    them. AGENTPULSE_SKIP=1 skips one run (Claude Code's hooks forward it as
    an X-AgentPulse-Skip header, which the server drops after
    authenticating). agentpulse exclude add|list|check manage and verify
    the rules; the Setup page has an "Exclude directories" card; the
    statusline, a marker file and the Hosts page say when rules are invalid.
    The server never learns what is excluded, only a host's invalid flag
    (excludeRulesState on hosts, migration Postgres 0009 / SQLite
    0008). Claude Code posting straight to the server does not apply path
    rules. Re-run setup for Codex: it asks you to re-approve the changed hook
    command. Windows (PowerShell) support is written but has not been
    executed on Windows. An older relay or supervisor ignores the rules.

  • Operational session state: WAITING / WORKING / IDLE / ERROR (AGEN).
    Original feature contributed by @Pawel0c0l
    — thank you! Sessions now carry two acknowledgement timestamps
    (lastAgentTurnCompletedAt, stamped on Stop; lastUserAcknowledgedAt,
    stamped on UserPromptSubmit and on acknowledging) and a derived
    operationalStatus, computed identically on the server and in the
    dashboard by the shared classifier in src/shared/session-state.ts. The
    dashboard shows four status cards (a single-select filter), and
    GET /sessions/stats carries the same four counts so they're correct
    beyond one page. A session you haven't looked at since the agent
    finished shows WAITING; opening it, or using the new "mark as seen"
    controls (per-card, or "mark all waiting as seen"), clears it. A failed
    session shows ERROR until acknowledged, at which point it's dismissed as
    completed. POST /sessions/:id/acknowledge is the new endpoint behind
    "mark as seen"; it only counts for the session's owner (or anyone, on an
    unowned session or with auth disabled).

  • Split-SQLite-database detection (hosts-visibility fix). GET /api/v1/health now reports instance: { dbFingerprint, dialect } — a
    short, non-reversible fingerprint of the backing database (first 12 hex
    chars of a salted sha256 of the existing installation_id; never the raw
    id, and derived with a different salt than telemetry.ts sends, so it
    can't be correlated against a telemetry ping). On Postgres every replica
    shares one database, so this is always a single stable value — correct
    by construction. On SQLite, running more than one server instance (each
    gets its own independent local database file; SQLite is single-instance
    only — see CLAUDE.md "Single-replica constraint") produces more than one
    fingerprint. The dashboard now polls /health on load and every ~60s,
    tracks distinct fingerprints seen in the current browser session, and
    shows a persistent warning banner when it detects alternation between
    two or more (tolerating a single clean transition, e.g. a server
    restart). The server also logs a best-effort, heuristic warning once at
    boot when it detects SQLite running under an orchestrator that commonly
    scales to >1 replica (ECS_CONTAINER_METADATA_URI/_V4 or
    KUBERNETES_SERVICE_HOST set). See the README "A host registered but
    doesn't appear on the Hosts page" troubleshooting entry and
    deploy/k8s/README.md's "Detecting a split SQLite deployment" section.

  • Event retention enforcement (AGEN-24). The eventsRetentionDays
    setting (Settings → Session Configuration → Event Retention) is now
    enforced by a periodic background pass (hourly by default; override with
    AGENTPULSE_RETENTION_INTERVAL_MS, clamped to [60s, 24h] — an
    out-of-range or non-integer value falls back to the 1-hour default with a
    warning) that deletes events rows older than the configured cutoff in
    bounded batches of 1,000 rows, yielding between batches so ingest is
    never blocked. Off by default: the setting has always existed but
    was never enforced before this release, so an upgrade does not start
    deleting anything — retention only runs once an operator explicitly sets
    eventsRetentionDays to a positive number of days (unset, 0, or
    negative all mean disabled). The Settings UI field was changed from a
    misleading always-30 placeholder to a real 0-means-disabled value, and no
    longer writes on an unmodified blur. A new index,
    idx_events_created_at_id on events (created_at, id) (migration 0005),
    backs the batch-select query. Deleting from events fires the existing
    SQLite FTS/embeddings delete triggers, so search_events_fts and
    event_embeddings stay consistent automatically; the session row and its
    denormalized state (including metadata.permissionWait) are never
    touched by a retention pass. On Postgres (multi-replica capable), EACH
    BATCH runs in its own short transaction, re-acquiring a non-blocking
    pg_try_advisory_xact_lock; if the lock isn't held, the pass stops and
    is reported as skipped. SQLite deployments (single-replica) run
    unguarded. Every Postgres connection this app opens (main pool and
    migration client) now pins connection: { TimeZone: "UTC" }
    (db/client.ts's PG_CONNECTION_OPTIONS) — created_at is TEXT
    rendered in the connection's TimeZone GUC, and the retention cutoff
    comparison is a lexicographic UTC string compare, so an unpinned
    connection on a non-UTC-default Postgres server could judge rows as
    older than they are by the server's offset (in the worst case, a row
    written moments ago could look older than a tight cutoff). Upgrade
    note
    : this pin only affects new connections going forward — if your
    Postgres server's default timezone was not UTC before upgrading, rows
    already written keep their local-time-with-offset text; see
    deploy/k8s/README.md's "Event retention (AGEN-24)" section for the
    precise boundary condition this leaves. After a SQLite pass that deleted
    rows, PRAGMA incremental_vacuum runs automatically if the database was
    created with auto_vacuum = INCREMENTAL; existing installs
    (auto_vacuum = NONE) need a one-time manual VACUUM during a
    maintenance window to reclaim space — see deploy/k8s/README.md.
    GET /api/v1/health now includes a retention field with the last
    pass's rowsDeleted/durationMs/disabled, a separate lastSkip field
    for the most recent skipped pass, and the next scheduled tick.

Changed

  • Counts follow the scratch toggle. "Show scratch workspaces" now
    applies to every number on the dashboard (status cards, tab badges,
    totals), not only the grid; while it is off, how many scratch sessions
    are left out is shown beside it. This applies to solo installs too.

  • The Idle tab is gone. Idle sessions are listed under Active, and
    the Idle status card filters to them. The tabs are Active, Completed,
    Archived and All (All leaves archived sessions out, which it now says).

  • Accounts an admin creates must change their password at first
    sign-in.
    The password the admin hands over is temporary: until the
    person replaces it, their API keys get 403 password_change_required
    on every route except hook ingestion, which keeps accepting events. This
    applies on solo installs too.

  • Signup is stricter. Creating an account through /auth/signup
    refuses a request from a foreign Origin, and once any user exists it
    needs a signed-in human admin (an API key can't).

  • Open dashboard tabs are kept per person. On upgrade, the tabs the
    browser had open move into the first person who signs in (and stay with
    a solo install that signs in); after that each person gets their own.

  • Channel management is admin-only in team mode, enforced by the server.
    Creating, deleting, configuring and testing a notification channel, and
    the Telegram bot setup, return 403 admin_required for a member; the
    Team and Settings pages already hid them. Solo is unchanged.

  • Enrolling a host in team mode needs someone to own it. A key with no
    owner that isn't kept as an admin service key gets 403 admin_required
    from POST /admin/supervisors/enroll. Solo is unchanged.

  • Malformed request bodies answer 400. PUT /sessions/:id/pin,
    /archive, /notes, /rename and /claude-md now return
    400 { error: "invalid_body" } for a body that isn't a JSON object with
    the right field types. Before, some answered 500, and some changed data
    silently: a notes body without notes wiped the notes, and
    "archived": "no" archived the session. GET /sessions/:id/timeline
    now validates limit and offset (400 invalid_limit /
    invalid_offset).

  • Live updates with authentication off. With DISABLE_AUTH=true, the
    WebSocket accepts a connection only when the request's host is a
    loopback address or one named by PUBLIC_URL. Reach such an install on
    another address and set PUBLIC_URL, or the dashboard polls instead.

  • A launch refusal for a trusted-roots violation is generic while an
    exclude file exists.
    The supervisor's path_outside_trusted_roots
    error no longer names the path or the reason, so a refusal doesn't reveal
    whether a directory is excluded. The host's own log has the detail.
    Hosts with no exclude file keep the old message.

  • Postgres migrations 0007 and 0009. 0007 (user ownership) adds
    15 nullable or defaulted columns, plus idx_sessions_owner_last_activity,
    idx_api_keys_owner and a unique idx_users_provider_subject. None is
    built CONCURRENTLY: the sessions index takes a SHARE lock, so hook
    writes wait while it builds. On a large table, pre-create it first with
    CREATE INDEX CONCURRENTLY IF NOT EXISTS; the migration then skips it.
    0009 adds the nullable supervisors.exclude_rules_state. Both run in
    band under the advisory lock; see deploy/overlays/postgres/README.md.

  • Postgres event/session search is now index-backed (AGEN-27). Migration
    0006 adds pg_trgm GIN indexes covering every column/expression
    PostgresSearchBackend's ILIKE '%term%' queries already OR together —
    match semantics are unchanged (still the same OR-across-columns ILIKE);
    searches that previously did a sequential scan of the whole events
    table are now served from the index when pg_trgm is available. The
    event_type IN (...) restriction is rendered as literal SQL text (a
    hardcoded, compile-time-known list, never user input) rather than bound
    parameters — a bound list is opaque to Postgres's planner once it plans
    generically, which can silently drop all six events indexes in favor of
    a sequential scan. searchSessions runs with server-side prepared
    statements explicitly disabled (postgres-js per-query prepare: false,
    global client config untouched), so every execution sees the real bound
    values on every plan.

    searchEvents needed more: an earlier revision fenced the filter in a
    MATERIALIZED CTE, which forces Postgres to fully materialize every
    matching row before LIMIT — correct for a rare term, but a common one
    (~50% selectivity) regressed 0.18ms -> 1.8s at 1M rows (10,000x+, ~50MB
    of temp spilled per query) by defeating early-LIMIT short-circuiting;
    removing the fence (disabling prepare instead, same as searchSessions)
    fixed that. But further investigation (EXPLAIN ANALYZE against a
    worst-case fixture — a genuinely unique match at the very end of scan
    order, not a spread-out one) found the planner never picks the trigram
    index plan for this query shape at any selectivity: a rare/unique term
    degrades toward a near-full-table scan instead, measured 892-926ms at 1M
    rows and worse as events grows — a Postgres cost-misestimation for
    opaque ILIKE patterns, not a missing index (forcing the planner off
    the ordering index on the same data proved the trigram plan is
    available for a rare/unique term). searchEvents now runs an adaptive
    two-plan strategy: Plan A is the unprepared query inside a transaction
    with a 150ms statement_timeout; if canceled (SQLSTATE 57014), Plan B
    re-runs the identical query in a fresh transaction with
    enable_indexscan/enable_indexonlyscan off, forcing the trigram path,
    with a generous 10s timeout. Plan B's own cost scales with the size of
    the matched set, not just table size (~400ms measured at 500,000
    clustered matches) but stays bounded by the query's top-N heapsort
    rather than degrading further. Both SET LOCALs are transaction-scoped
    and never leak onto a pooled connection. Pagination is identical either
    way (same ORDER BY/LIMIT/OFFSET, enforced by Postgres regardless
    of physical plan). The events-side
    indexes are partial (WHERE event_type IN (...)), restricted to the
    same event types SQLite's FTS5 indexes (FTS_INDEXED_EVENT_TYPES), so
    the two dialects search the same population. pg_trgm requires CREATE EXTENSION, which some managed Postgres providers restrict — the
    migration feature-detects this and degrades to a WARNING plus the
    existing sequential-scan path when the extension can't be installed,
    and separately when an index build fails partway through — neither
    aborts the migration or blocks boot. On an existing install with
    events already over 100,000 rows (an ANALYZE-maintained estimate; a
    never-analyzed table's -1 "unknown" sentinel is treated the same as
    "too large" and skips, fail-safe, rather than the -1 accidentally
    passing the size check and locking for the full build), the automatic
    build is skipped to avoid a multi-second SHARE lock on
    sessions/events at boot; GET /api/v1/health's new searchIndexes: { present, missing[] } field (checked once at boot, and not fooled by
    an index Postgres marked INVALID after a failed CONCURRENTLY build)
    reports whether the trigram indexes are actually in place, alongside a
    startup log line when they're not. See deploy/k8s/README.md's
    "Upgrading to migration 0006" section for the CREATE INDEX CONCURRENTLY out-of-band path (including the index-size note —
    roughly 55-112% of the events heap, per percy's measurements — and a
    reminder to run ANALYZE events; after any bulk import or restore).

Fixed

  • A refused admin action could roll back hook writes (SQLite). The
    admin lock on SQLite is an open transaction on the one shared
    connection, and a hook write that landed inside it was lost with it when
    the action was refused (last admin, undecided key at the mode switch,
    disabled owner). A locked body now cannot be interleaved with: the lock
    waits a turn before it starts, its body only awaits database calls, and a
    body that yields fails tests and logs admin_lock_body_yielded.

  • An open tab learns about role and mode changes made elsewhere. The
    dashboard re-checks who you are after a refusal that names your role or
    ownership, when the tab comes back to the front and when the live
    connection reconnects, at most once every few seconds. A different
    person signed in from another tab resets the page; a changed role or
    mode updates it.

  • The dashboard returns to Everyone when the instance goes back to
    solo.
    Before, it stayed on Mine with no switch to change it.

  • A solo install whose sessions are all scratch keeps its dashboard.
    The first-run screen shows only when there are no sessions at all.

  • A first load that only /auth/me fails shows the "Can't reach the
    server" notice and keeps retrying, instead of staying on the loading
    screen.

  • Search results name the owner of a session hit (ownerUserId,
    ownerKind), on both search backends.

  • A healthy host's heartbeat no longer writes the exclude flag.

  • Smaller team-mode fixes in the dashboard. Change-owner dialogs list a
    disabled current owner ("name (disabled)") and keep Save off until the
    owner changes; the Team list and the owner chips use the same initials; a
    session you don't own shows its notes as text, with the reason and no
    editor; group-by-User headers show an owner's working and waiting counts
    only on the Active tab (otherwise they're counted from the cards shown);
    the Setup page's Codex check asks for your own sessions in team mode; a
    search no longer makes the list refetch on every count refresh; Try again
    after a partly failed "Existing items" step doesn't resend what already
    went through; switching back to solo offers Try again if the people list
    fails to load; session-page pills and the Stop and Dismiss error buttons
    reach 4.5:1 contrast in the light theme; the first-run link to the
    exclude card scrolls clear of the header and focuses its heading; the
    Hosts notice for an invalid exclude file says to run
    agentpulse exclude check on that machine.

  • Installation id minted twice on a fresh database. Concurrent first
    requests each created an id and the last write won, so a new install
    briefly reported two database fingerprints and the dashboard raised its
    split-database warning. The id is now minted once.

  • The stale-session sweep now tells open dashboards. Sessions the sweep
    idled or completed used to change in the database without a live update,
    so lists and count badges disagreed until a reload. Each changed session
    is now broadcast.

  • Hosts page silently rendered an empty list when the list request
    failed (hosts-visibility fix).
    GET /api/v1/admin/supervisors failing
    (an expired session, an under-scoped API key, a network error) used to
    render identically to a server with zero registered hosts — a
    registered-but-invisible host went unnoticed because the page never
    distinguished "no hosts" from "couldn't check." The Hosts page now shows
    a distinct error state with the status code and server message when
    available (e.g. "Couldn't load hosts: 403 insufficient_scope") and a
    Retry button; this takes priority over any stale supervisor list still
    on screen. The enrollment/revoke/rotate actions on the same page now
    surface the same status-code detail instead of a generic "Failed to
    ..." message.

  • Test suite could write to the developer's real home directory. A
    test run previously wrote a supervisor.json, appended to .zshrc, and
    created ~/.agentpulse/env in a real developer home instead of a
    sandboxed temp directory. Root cause was two Bun-specific gaps beyond
    each test's own process.env.HOME override: Bun's os.homedir()
    doesn't track a process.env.HOME/USERPROFILE mutation made after the
    process starts (Node's does), and Bun.spawn/Bun.spawnSync default to
    a snapshot of the process's own OS-level startup environment when env
    is omitted, not a live read of process.env — a subprocess spawned with
    no explicit env (e.g. src/supervisor/config.ts's
    captureExecutableVersion, which shells out to the real
    claude/codex CLI when a config under test leaves those commands
    unset) silently used the developer's real environment regardless of any
    in-test override. bunfig.toml's [test] preload
    (src/server/db/test-env-defaults.ts) now redirects
    HOME/USERPROFILE/XDG_CONFIG_HOME/XDG_DATA_HOME/CODEX_HOME/CLAUDE_CONFIG_DIR
    to a fresh per-process temp directory before any test file's own imports
    run, and patches both node:os's homedir() and Bun.spawn's/
    Bun.spawnSync's default env to match — closing the gap structurally
    for every test file rather than depending on each one remembering its
    own override. src/server/db/test-home-sandbox.test.ts guards both
    findings; src/supervisor/config.test.ts's executable-capability tests
    were also hardened to pin claudeCommand/codexCommand to
    guaranteed-nonexistent paths so they never shell out to a real installed
    CLI in the first place. See TESTING.md.

  • Backup sidecar livelock under concurrent writes (AGEN-54).
    deploy/k8s/scripts/run-backup.sh used sqlite3's .backup command, which
    restarts its page copy whenever a WAL checkpoint lands mid-copy — under
    sustained write load it can livelock indefinitely instead of finishing (one
    production run stalled at a fixed offset for 20+ minutes; backup history
    showed 12-15h completions). The script now snapshots with VACUUM INTO
    (a single bounded read transaction, read-only-safe against the live DB),
    verifies the output with PRAGMA integrity_check before promoting it, and
    checks free space up front. Naming, compression, retention
    (scripts/retention.sh), and logging are unchanged.
    Follow-up hardening from review: a signal trap now removes the in-flight
    .tmp file on SIGINT/SIGTERM, and a startup sweep clears any .tmp older
    than 60 minutes left behind by an untrappable SIGKILL; the promotion
    rename failure is now handled explicitly (exit 7) instead of falling
    through to an unhandled set -e exit; a checksum failure is now
    non-fatal, matching the existing row-count check; the VACUUM INTO
    connection sets busy_timeout=5000; and the sidecar logs its sqlite3
    version at the start of every run.

Security

  • Launch-correlation squatting. A manage-scoped caller (REST POST /api/v1/launches or MCP launch_agent) could previously set a launch's
    correlation id to an existing or guessed-future session id. On that
    session's next SessionStart event, the session would be silently
    attached to the attacker's launch instead of its real one, handing the
    attacker's supervisor ownership of record — making the session's queued
    prompt/stop control actions claimable by the attacker's supervisor
    instead of the legitimate one. The server now always mints the
    correlation id itself (createValidatedLaunchRequest) and ignores any
    caller-supplied value; the no-supervisor hook-path correlation resolver
    additionally refuses to attach a pending launch to a session that's
    already managed under a different launch, or that already existed
    before the launch was created; and queuePromptAction/
    queueStopAction/retryLaunchForSession now assert the resolved
    launch's claimant matches the session's actual owner of record before
    trusting its data or routing a new action to it. No legitimate launch
    flow (template launch, retry, AI-initiated launch, MCP's
    preview_template → launch_agent pass-through) ever depended on a
    caller-chosen correlation id being honored. The resolver's chronology
    comparison normalizes both sides to an instant (parseDbTimestamp)
    rather than comparing the stored strings directly, since a raw string
    comparison can silently flip the wrong way between the SQLite and
    Postgres default timestamp formats.
  • Supervisor and installer secret files are now written 0600, not 0644
    (AGEN-21).
    ~/.agentpulse/supervisor.json (the supervisor credential /
    enrollment token), ~/.agentpulse/.env.local /
    <install-dir>/.env.local (AGENTPULSE_INITIAL_API_KEY) were written
    with the OS-default create mode under a typical umask — world-readable,
    any local user could read the credential and act as that supervisor.
    saveSupervisorConfig (src/supervisor/config.ts) and both local
    installers (scripts/install-local.sh, scripts/install-local.ps1) now
    write through the same no-follow, 0600 primitive already used for
    hook-auth-header (src/shared/private-file.ts's
    writePrivateFileSyncNoFollow in TS; ap_write_private_no_follow in
    bash; Write-ApPrivateFile/Write-ApPrivateJsonFile — ACL-narrowed to
    the current user — in PowerShell), refusing rather than following a
    symlink at the destination. Existing installs are self-healed: the
    supervisor now tightens an over-permissive supervisor.json to 0600 on
    startup (logging once), refusing — not chmod'ing — if the path is a
    symlink. Both no-follow write helpers were themselves hardened against a
    predictable temp-file name (ap_write_private_no_follow/
    ap_write_no_follow now use mktemp's unguessable XXXXXX suffix
    rather than a guessable .$$.tmp), tightenPrivateFilePermissionsSync
    refuses a hard-linked path, and the supervisor's startup permission fix
    never crashes the process if it loses its internal TOCTOU race.
  • API key exposure in installer commands and config files (AGEN-49,
    reviewed by xander).
    v0.6.0 moved the key out of shell rc files into
    ~/.agentpulse/env (mode 0600) and added AGENTPULSE_KEY env-var
    support, but several residual exposure paths remained:
    • The dashboard's default local-install command, both README install
      snippets, install-local.sh's printed fallback instructions, and
      SetupPage's per-agent auth-step commands (claude_code, codex_cli,
      copilot_cli — POSIX side) all passed the key as --key ap_... or
      embedded it literally in copy-paste text, landing in ps and/or shell
      history. All now read the key at a hidden terminal prompt instead:
      POSIX printf 'AgentPulse API key: '; read -rs VAR; echo (not
      read -rsp — -p means "coprocess" in zsh, macOS's default shell, so
      a pasted -rsp silently misbehaves there), guarded by
      [ -n "$VAR" ] && so a blank answer skips the install instead of
      running curl unauthenticated. codex_cli/copilot_cli's PowerShell
      variant now reads the key via Read-Host -AsSecureString +
      SecureStringToBSTR/PtrToStringBSTR/ZeroFreeBSTR and adds the
      hard-link check New-ApHookAuthHeaderFile already has but this
      displayed snippet didn't. Documented as a trade-off for scripted/
      non-interactive installs, which can still set $AGENTPULSE_KEY
      beforehand (visible in shell history).
    • Added execution tests that actually run the rendered onboarding
      command and the setup-steps POSIX snippets under every shell present
      (bash, zsh, sh), feeding the key on stdin and using a stub curl —
      catching the zsh read -rsp regression a text-pattern check alone
      would have missed.
    • Claude Code's silent-401 trade-off, resolved deliberately. Claude
      Code's native HTTP hook expands $AGENTPULSE_API_KEY from its own
      process environment, not the shell that launched it — a GUI, IDE, or
      stale-terminal launch never sources ~/.agentpulse/env, so an
      env-var-only header 401s silently there. User scope
      (~/.claude/settings.json, the default for /setup.sh,
      agentpulse setup, install-local.ps1, and setup-hooks.sh's default
      --scope global) now embeds the literal key again, made acceptable by
      tightening the file to mode 0600 (POSIX) / a single-ACE user-only ACL
      (Windows) with a no-follow write (a symlinked settings.json is
      refused, not written through) — merging into an existing file preserves
      every other key already in it. Project scope
      (setup-hooks.sh --scope project, a repo's own .claude/settings.json,
      which may be committed) never gets a literal key — it keeps the
      $AGENTPULSE_API_KEY/allowedEnvVars form unconditionally, with a
      printed reminder to fully restart Claude Code (a GUI/IDE-launched
      instance may not see a shell-exported env var).
    • Regression coverage installs each of claude_code/codex_cli/copilot_cli
      (including --scope project) and the served /setup.sh against a
      temp $HOME, then scans every resulting file for the literal key —
      asserting it appears only in hook-auth-header and env (always,
      mode 0600), and in settings.json only for user/global scope (also
      mode 0600) — never in any project-scope file, at any permission.
      Also covers: an existing settings.json's other keys survive the
      merge, and a symlinked settings.json is refused.
  • First-run signup on an SSO-fronted install. When a forwardauth
    identity provider is configured (FORWARDAUTH_TRUST_SECRET set), signing
    in via SSO never creates a local account, so the local user count can
    stay at zero indefinitely. Previously, first-run signup's own gate
    (AGENTPULSE_ALLOW_SIGNUP, off by default) was the only thing standing
    between an anonymous visitor and self-registering a local admin on such
    an install — and unlike a non-SSO install, where the first real signup
    closes the window for good, an SSO-fronted install's local count never
    grows on its own, so a stray AGENTPULSE_ALLOW_SIGNUP=true left over
    from testing stays open forever instead of closing itself. Signup is now
    closed by default whenever a forwardauth provider is configured:
    boot logs one line stating that. Set AGENTPULSE_ALLOW_SIGNUP=true
    explicitly if you want local signup available alongside SSO — boot then
    logs a separate warning that it will stay open indefinitely for exactly
    the reason above, so the choice to keep it open isn't a silent one. The
    documented, recommended way to create a
    local admin on an SSO install remains AGENTPULSE_LOCAL_ADMIN_USERNAME /
    AGENTPULSE_LOCAL_ADMIN_PASSWORD, which is unaffected either way.
    Installs without forwardauth configured are unaffected.
  • Login timing for a disabled user. verifyCredentials returned
    immediately for a disabled account, skipping the password-hash cost that
    every other failure path (unknown username, wrong password) pays — a
    timing side channel that could distinguish "this username exists but is
    disabled" from "wrong password." The disabled branch now runs the same
    dummy password verify as the other failure paths.
  • Forwardauth provider label. FORWARDAUTH_PROVIDER is encoded
    directly into the synthetic SSO username as sso:<provider>:<subject>. A
    provider value containing : would make that encoding ambiguous; an
    empty or whitespace-only value would collide across installs. The server
    now refuses to boot with a clear error if the configured provider is
    invalid.

Deprecated

  • The following aliases were scheduled for removal in this release. They
    remain supported in 0.7.0 and will be removed in v0.8.0. Migrate now:
    • AGENTPULSE_AUTHENTIK_TRUST_SECRET env var → use FORWARDAUTH_TRUST_SECRET.
    • agentpulse-strip-client-authentik Traefik middleware → use
      agentpulse-strip-client-forwardauth.
    • deploy/k8s/AUTHENTIK-FORWARDAUTH.md → see deploy/k8s/FORWARDAUTH.md.
    • The "authentik" auth-source value → "forwardauth".

Upgrade notes

  • Migrations run at boot and are additive. SQLite 0005–0008 and
    Postgres 0005–0009 apply automatically on first start. Nothing is
    dropped or rewritten.
  • Postgres owner index. Postgres 0007 builds
    idx_sessions_owner_last_activity without CONCURRENTLY, which takes a
    SHARE lock on sessions while it builds, so hook writes wait. On a
    large table, pre-create it first with CREATE INDEX CONCURRENTLY IF NOT EXISTS; the migration then skips it. See deploy/overlays/postgres/README.md.
    The pg_trgm search indexes (0006) have their own out-of-band path in
    deploy/k8s/README.md ("Upgrading to migration 0006").
  • The instance stays in solo mode until you switch it. Upgrading does
    not turn on team mode; an admin switches it in Settings → Team, or set
    AGENTPULSE_MODE.
  • Re-run relay setup on each machine to pick up the current relay and
    hook shape (setup-relay.sh; re-running is safe and keeps your key and
    port). Re-approve the Codex hooks afterwards: the hook command
    changed, so Codex asks you to trust it again (/hooks inside Codex).
  • Exclude rule on Windows. The PowerShell support for the exclude rule
    has not been tested on Windows.