Skipped stdout draining after ProcessTerminal observes a native Windows terminal disconnect, while preserving normal postmortem cleanup and drain behavior for every other shutdown path.
Fixes#6917
(cherry picked from commit b45fc00ab4b5075ccb9650584947dde061beea20)
Bun's `process.title` setter is a JS-level no-op: it stores the value
internally but never calls `prctl(PR_SET_NAME)`, so `omp` appeared as
`bun` in ps/pgrep/killall/top and `pkill bun` became a footgun killing
every Bun process. Add `setProcessName` in pi-utils that also drives
prctl via bun:ffi on Linux, and use it at CLI startup and in the daemon
broker.
Fixes#6815
Filtered launch-directory .env and .env.local values from the base shell environment while preserving explicit per-command overrides.
Expanded the shell environment regression test across both dotenv files.
Fixes#6813
- Recorded the scoop/no-bash startup fix (No bash shell found) in pi-utils
and pi-coding-agent 17.1.4 sections, which were finalized before the fix
commit landed on the release.
- Observed timed-out child lifecycle failures without altering awaited rejection semantics.
- Added coverage for callers that settle without observing the lifecycle promise.
Fixes#6635
Tracked the effective global, project, overlay, or runtime source of shellPath so resolution errors identify the configuration users must edit.
Covered custom agent directories and higher-precedence settings layers with focused regressions.
Fixes#6579
Updated Windows shell resolution errors to point at the canonical config.yml file instead of the migration-only settings.json path.
Added a regression test for the invalid custom shell path error.
Fixes#6579
- Captured the native hard-exit function for postmortem signal, fatal, and manual exits.
- Added bounded child-process coverage for SIGINT and fatal cleanup during pending guarded loads.
- Preserved extension and hook exit isolation and made the EPIPE race assertion observe the real exit event.
Fixes#6488
installRuntimeModuleResolver patched Module._resolveFilename process-wide
with no way back. In the shared bun test process the leaked patch broke
createRequire relative requires for every later test file (Bun 1.3.14 calls
a JS _resolveFilename override with parent === undefined, so './x' resolves
'from ""'), failing legacy-pi-inplace-load only in full-suite runs.
The installer now returns an uninstaller that drops the registration and
restores the pristine resolver when no runtime roots remain; the known Bun
limitation is documented so the patch stays scoped to worker runtimes.
The 50ms budget raced external-process spawn on cold CI runners: cancel
could fire before yes produced output, so the builtin tail flushed an
empty ring buffer (0 lines instead of 5, Linux x64 modern). 750ms keeps
the post-cancel drain scenario while outlasting spawn latency.
Default ChildProcess unconditionally pushed every raw stderr chunk into
`#stderrChunks`, so long-lived noisy subprocesses (LSP/DAP/RPC) grew OMP
memory linearly despite the 32 KiB visible tail cap.
- Allocate `#stderrChunks` only when full capture is requested at spawn.
- Decouple retention from stream exposure via `spawnInternal`, so
`exec({ stderr: "full" })` retains without an unused live tee.
- Reject retroactive `wait({ stderr: "full" })` on a default child with a
clear error instead of returning truncated data.
Fixes#5759
Made fatal reporting bypass revoked stderr streams and armed a referenced forced-exit watchdog around bounded cleanup.
Separated rotating log and audit namespaces by PID and disabled compression pipelines so concurrent TUI processes cannot race shared rotation state.
Fixes#5716
Extended the OTLP export bootstrap beyond traces so omp emits the full
OpenTelemetry signal set from a single session.
- Registered a LoggerProvider + BatchLogRecordProcessor and a MeterProvider
+ PeriodicExportingMetricReader when their OTLP endpoints (or the shared
endpoint) are set, each gated independently by OTEL_*_EXPORTER=none,
OTEL_SDK_DISABLED, and http/protobuf protocol checks.
- Bridged the centralized logger through a new registerLogSink API so every
log event also becomes an OTLP log record with severity, attributes, and
active span context for log-trace correlation (min level via OTEL_LOG_LEVEL).
- Recorded gen_ai.client.token.usage and pi.omp.agent.* metrics from the
agent run summary and per-chat usage hooks, and emitted a structured run
summary log event.
- Added an out-of-process logs+metrics probe and gating tests covering the
per-signal kill switches.
Fixes#4604
Argument/flag validation failures in the minimal CLI framework threw a
plain Error that bubbled to the process-level catch in cli.ts, which
dumps a Bun.inspect code frame — a minified dist/cli.js excerpt in
compiled binaries. A missing model on `omp bench` looked like a crash.
- Add CliUsageError; throw it from Command.parse for missing/invalid
args and flags.
- Catch CliUsageError in run(): print `error: <msg>` plus the command
usage line to stderr, exit 1, no stack.
- Render required variadic positionals as MODELS... in usage, not the
misleading optional [MODELS]; extract commandUsageLine helper.
Fixes#5369
Rules whose condition led with a PCRE-style inline flag group (e.g.
`(?i)`) never registered: `new RegExp("(?i)...")` throws in Bun/JS, so
the condition failed to compile and `TtsrManager.addRule` dropped the
rule as having zero usable conditions.
- Add `compileRuleCondition` in capability/rule.ts translating a leading
`(?i)`/`(?m)`/`(?s)` group into native RegExp flags; wire it into the
TtsrManager and both ttsr-cli compile sites.
- Strip surrounding quotes from scope tokens so a malformed
`scope: "text","thinking"` recovers to canonical `text`/`thinking`.
- Reparse each value in parseFrontmatter's YAML fallback so one bad line
can't leave sibling values wrapped in literal quotes.
Fixes#4796