Skip to content

3ngram 1.14.0

Choose a tag to compare

@github-actions github-actions released this 10 Nov 13:18
5e2cb3e

3ngram v1.14.0

The Stop debrief nudge asks less often, for sessions that opted into it with
THREENGRAM_STOP_NUDGE=1. The server now waits a cooldown before re-arming a
session's nudge, and the 3ngram-hook-v1.1.1 hook stays quiet while a Claude
Code turn is waiting on background work. A default install, with the nudge
off, sees no change.

Changes

Session triage

  • Re-arm cooldown (#457). Re-entry was one nudge per turn that produced
    new provenance, so a long session that kept writing was asked to debrief
    after nearly every turn, including the turn right after a debrief.
    POST /api/v1/agent-sessions/triage/begin now declines with the new reason
    cooldown while the run's last armed attempt is younger than
    SESSION_TRIAGE_REARM_COOLDOWN_MINUTES (default 30).
  • The decline consumes nothing. The signal stays untriaged, the first Stop
    past the window arms on it, and the closer still sees it if the session ends
    first. A run that never armed has no cooldown, so the first nudge of a
    session is unchanged.
  • The age is read from triage_armed_at, which is never cleared, so a
    completed run that a later write flipped back to idle is covered too.
    The not-live, terminal, pending, pending-fresh and no-signal
    declines keep priority over the cooldown, and the cooldown is checked before
    the debounce.
  • A reader clock slightly behind the arming clock only defers the nudge. An
    age more negative than the whole window reads as no cooldown, so a badly
    skewed arming clock cannot silence a run.

Stop hook (3ngram-hook-v1.1.1)

  • No nudge while background work runs (#456, for #455). Claude Code passes
    in-flight background work to a Stop hook as background_tasks. When that
    list has an entry, the hook asks nothing: it does not call triage/begin,
    so no attempt is armed or spent, and the provenance stays untriaged for a
    later Stop or the closer. A session_crons entry with recurring: false, a
    one-shot wakeup, also pauses the nudge.
  • Teammate entries do not pause it, because an idle teammate can stay listed
    as running for the rest of the session. Recurring crons and crons that do
    not say whether they recur do not pause it either. Only each task's type
    is read; status values are not a documented contract.
  • The finalize path (stop_hook_active) still runs first, so an injected
    debrief's continuation completes its attempt, and the heartbeat still runs
    on every Stop. A list that is not an array changes nothing, and an odd shape
    cannot fail the Stop decode and skip the heartbeat.
  • Accepted costs: a long-lived background process such as a dev server keeps
    the nudge quiet while it runs, and that session falls back to the closer. An
    attempt left pending by a lost stop_hook_active or a failed finalize is
    finalized by the next quiet Stop instead of this one.
  • A harness or version that does not send background_tasks or
    session_crons behaves as before. Claude Code documents both lists as
    present only when its task registry is reachable.

Compatibility

  • Strict parsers of the triage/begin response must accept the decline
    reason cooldown. triageDeclineReasonSchema and the OpenAPI enum gain it.
    The hook branches only on pending and treats every other decline as "no
    nudge", so an installed 3ngram-hook needs no update for the cooldown.
  • For direct package users: TriageDebounceThresholds (@3ngram/db,
    re-exported by @3ngram/core) and SessionTriageConfig (@3ngram/config)
    gain the required rearmCooldownMs, in milliseconds, with 0 switching the
    cooldown off. A composition root that builds the thresholds by hand must
    supply it and fails to compile in TypeScript until it does.
    loadSessionTriageConfig() already supplies it. The managed dashboard in
    3ngram-platform does not build the thresholds and is unaffected.
  • @3ngram/server, @3ngram/worker, @3ngram/sdk and the 3ngram CLI move to
    1.14.0 together. The dependency versions are config 0.8.0, schema 0.16.0,
    llm 0.5.0, db 0.18.0 and core 0.19.0.
  • The 3ngram-hook binary ships from its own tag, 3ngram-hook-v1.1.1. The
    background-work change reaches a machine only once that binary is
    reinstalled there: download the release archive, verify it against
    checksums.txt and replace the binary on your PATH
    (cmd/3ngram-hook/README.md, "Install (released binaries)").
    3ngram-hook --version then reports 3ngram-hook 3ngram-hook-v1.1.1.
    Managed dashboard changes are delivered separately by 3ngram-platform.

Operations

  • No migrations. The schema head stays at 0047_tough_lockheed, and
    provision-roles.sql is unchanged since v1.12.0, so it does not need a
    rerun.
  • New optional server setting SESSION_TRIAGE_REARM_COOLDOWN_MINUTES: whole
    minutes from 0 to 1440, default 30. 0 switches the cooldown off and
    restores the previous one-nudge-per-writing-turn behaviour. A blank value
    reads as unset, so it means 30, not 0; set 0 explicitly to switch the
    cooldown off.
  • Worker images must be adopted separately from the server package. Verify the
    image and completion of an actual execution for every scheduled worker.

Immutable container reference

ghcr.io/b3dmar/3ngram@sha256:a598b6cce9dd1ec9beb6a56a9414168a6963211beb3a8d68a8101bdfbaa6416e