npm / 2g
2g
What changed in 2g 0.2 to 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.
5 breaking2 new APIs and options2 behavior and defaults18 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init2g 117 changes
Breaking changes 4
Rebases log.path onto the working directory instead of the log destination directory.
Typegen rejects invalid literal registered categories and names; valid identifiers are nonempty ASCII strings using letters, digits, _, -, ., or :.
The hardcoded session format moves to the top level of meta.json and is removed from application metadata types.
Installation options and session listings use metadata.version instead of top-level version; the default version and formatVersion are removed.
New APIs and options 1
Adds typed session metadata updates that merge changes, emit root:update, and expose current metadata through ps and list().
Fixes and other changes 12
Application version metadata is preserved when filtering record exports.
Captured children and their descendants are routed to the capture pipe instead of inherited logger IPC, fixing empty captures inside instrumented processes.
Worker initialization events no longer overwrite root session metadata in Chrome Trace exports.
Explicit file and file-descriptor destinations now use the version supplied to installEventLogger when emitting root:init.
Pending flushes settle when their stream closes and report an error if shutdown discards buffered data instead of leaving callbacks unresolved.
Ending an empty log stream before its file opens now closes it and invokes the end callback.
Partial log writes no longer corrupt Unicode characters when a write splits a UTF-8 character, including under socket-draining backpressure.
Span start times are included when calculating the session span so it encloses its children.
Reports failure when the recorded command exits nonzero or is terminated by a signal, while still writing its trace.
Buffered live events stop being delivered after cancellation, and early iteration stops clean up sockets, timers, and abort listeners; already-aborted signals are honored with timeouts.
Generated declarations now quote and escape payload property names containing punctuation, quotes, backslashes, or newlines.
Ordinary child-process events now include worker IDs when the parent logs to an explicit file or file descriptor.
2g 0.46 changes
New APIs and options 1
Adds a sub-command to export traces for full command runs.
Fixes and other changes 5
The help output now mentions LOG_EVENTS for raw debug output.
Fixes IPC activation for explicit log targets such as record in child processes and worker threads.
Fixes draining on SIGINT and SIGTERM when running 2g record.
Help output is adjusted to prevent agents from running into cut-off trace outputs or logs.
Limits are adjusted to prevent agents from running into cut-off trace outputs or logs.
2g 0.32 changes
Breaking changes 1
The initial log.span call no longer accepts arguments, preventing merging and split event construction.
Fixes and other changes 1
Child
_wIDs are now present on piped events, and auto-install works in child workers.
2g 0.22 changes
Behavior and default changes 2
Event filters are more intuitive: a raw event name scopes to any sub-filter instead of matching only exactly.
The help output was adjusted for agent usage.